Este conteúdo não está disponível no idioma selecionado.
Chapter 2. Creating Red Hat Ansible Automation Platform backup resources
Backing up your Red Hat Ansible Automation Platform deployment involves creating backup resources for your deployed instances.
Use the following procedures to create backup resources for your Red Hat Ansible Automation Platform deployment. We recommend taking backups before upgrading the Ansible Automation Platform Operator. Take a backup regularly in case you want to restore the platform to a previous state.
2.1. Back up your Ansible Automation Platform deployment Copiar o linkLink copiado para a área de transferência!
Regularly backing up your Ansible Automation Platform deployment is vital to protect against unexpected data loss and application errors. Ansible Automation Platform hosts any enabled components (such as, automation controller, automation hub, and Event-Driven Ansible), when you back up Ansible Automation Platform the operator will also back up these components.
Ansible Automation Platform Operator creates a PersistentVolumeClaim (PVC) for your Ansible Automation Platform Backup automatically. You can use your own pre-created PVC by using the backup_pvc spec and specifying your PVC.
Prerequisites
- You must be authenticated on OpenShift cluster.
- You have installed Ansible Automation Platform Operator on the cluster.
- You have deployed a Ansible Automation Platform instance using the Ansible Automation Platform Operator.
Procedure
- Log in to Red Hat OpenShift Container Platform.
-
Navigate to
. - Select your Ansible Automation Platform Operator deployment.
- Go to your All Instances tab, and click .
Select Ansible Automation Platform Backup from the list.
NoteWhen creating the Ansible Automation Platform Backup resource it also creates backup resources for each of the nested components that are enabled.
- In the Name field, enter a name for the backup.
- In the Deployment name field, enter the name of the deployed Ansible Automation Platform instance being backed up. For example if your Ansible Automation Platform deployment must be backed up and the deployment name is aap, enter 'aap' in the Deployment name field.
Click . This results in an AnsibleAutomationPlatformBackup resource similar to the following:
apiVersion: aap.ansible.com/v1alpha1 kind: AnsibleAutomationPlatformBackup metadata: name: backup namespace: aap spec: no_log: true deployment_name: aapVerification
To verify that your backup was successful you can:
- Log in to Red Hat OpenShift Container Platform.
-
Navigate to
. - Select your Ansible Automation Platform Operator deployment.
- Click All Instances.
The All Instances page displays the main backup and the backups for each component with the name you specified when creating your backup resource. The status for the following instances must be either Running or Successful:
- AnsibleAutomationPlatformBackup
- AutomationControllerBackup
- EDABackup
- AutomationHubBackup
2.2. Define custom backup Persistent Volume Claims Copiar o linkLink copiado para a área de transferência!
Define custom Persistent Volume Claims (PVCs) to control backup storage allocation for each Ansible Automation Platform component. Specify unique PVC names, storage classes, and volume sizes at both global and component levels to differentiate between backup runs.
Prerequisites
- You have an active Red Hat Ansible Automation Platform deployment on OpenShift Container Platform.
-
You have the
ocCLI tool installed and cluster administrator access.
Procedure
Create a backup YAML file, for example
custom-pvc-backup.yaml, that defines thebackup_pvcandcreate_backup_pvcparameters for each component:apiVersion: aap.ansible.com/v1alpha1 kind: AnsibleAutomationPlatformBackup metadata: name: aapbackup spec: backup_pvc: custom-aap-backup-pvc1 backup_storage_class: nfs-local-rwx backup_storage_requirements: 7Gi create_backup_pvc: true2 deployment_name: aap controller:3 backup_pvc: custom-controller-backup-pvc backup_resource_requirements: limits: cpu: "4" memory: 8Gi requests: cpu: "2" memory: 4Gi backup_storage_class: standard-csi backup_storage_requirements: 7Gi create_backup_pvc: true eda: backup_pvc: custom-eda-backup-pvc backup_storage_class: standard-csi backup_storage_requirements: 7Gi create_backup_pvc: true hub: backup_pvc: custom-hub-backup-pvc backup_storage_class: nfs-local-rwx backup_storage_requirements: 7Gi create_backup_pvc: true- 1
- Sets a custom PVC name for the platform gateway backup.
- 2
- When set to
true, the operator creates the PVC automatically if it does not already exist. - 3
- Component-level settings override the global values for
backup_pvc,backup_storage_class, andbackup_storage_requirements. Each component can define its ownbackup_pvcto create a uniquely named PVC.
Apply the configuration:
$ oc apply -f custom-pvc-backup.yaml
Verification
Confirm that the PVCs were created:
$ oc get pvc -n <namespace>The output displays the custom PVCs for each component:
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS custom-aap-backup-pvc Bound pv-aap 7Gi RWX nfs-local-rwx custom-controller-backup-pvc Bound pv-ctrl 7Gi RWO standard-csi custom-eda-backup-pvc Bound pv-eda 7Gi RWO standard-csi custom-hub-backup-pvc Bound pv-hub 7Gi RWX nfs-local-rwx
2.3. Custom backup configurations for specific components Copiar o linkLink copiado para a área de transferência!
You can override the global backup configuration for specific components, such as automation controller, private automation hub, or Event-Driven Ansible controller. This enables each component to use its own storage class, PVC name, storage size, or resource limits during the backup process.
Example: Overriding component backup settings
In this backup custom resource, each component has a unique PVC name and storage class:
apiVersion: aap.ansible.com/v1alpha1
kind: AnsibleAutomationPlatformBackup
metadata:
name: custom-backup
spec:
deployment_name: myaap
no_log: false
backup_storage_class: rook-cephfs
hub:
backup_pvc: custom-hub-backup-pvc
backup_storage_requirements: 25Gi
backup_storage_class: rook-cephfs
create_backup_pvc: true
no_log: false
controller:
backup_pvc: custom-controller-backup-pvc
backup_storage_requirements: 15Gi
backup_storage_class: rook-block
create_backup_pvc: true
no_log: false
eda:
backup_pvc: custom-eda-backup-pvc
backup_storage_requirements: 7Gi
backup_storage_class: rook-block
create_backup_pvc: true
no_log: false
- 1
- The global
backup_storage_classapplies to the platform gateway. Components that do not specify their ownbackup_storage_classinherit this value. - 2
- Each component can define its own
backup_pvcto create a uniquely named PVC. Setcreate_backup_pvc: trueto have the operator create the PVC automatically. - 3
- Component-level values, such as
backup_storage_class: rook-block, override the global setting for that component.