Chapter 15. Backing up and restoring director Operator You use Red Hat OpenStack Platform (RHOSP) Director Operator to create and restore backups of the current CR, ConfigMap, and Secret configurations. The API consists of two CustomResourceDefinition (CRDs): OpenStackBackupRequest OpenStackBackup 15.1. Director Operator CustomResourceDefinition (CRD) You use the OpenStackBackupRequest CRD to initiate the creation or restoration of a backup. You use the OpenStackBackup CRD to store the CR, ConfigMap and Secret data for a specific namespace. These CRDs provide you with the following features: You do not have to manually export and import multiple configurations, because the CRDs store the backup in a single OpenStackBackup CR. Director Operator does not backup any configuration that is in an incomplete or error state because it is aware of the state of all resources. Director operator knows which CRs, ConfigMaps and Secrets it needs to create a complete backup. 15.2. Backing up director Operator To create a backup, director Operator includes the contents of the current namespace and anything declared in the additionalConfigMaps and additionalSecrets lists. You can include manually created ConfigMaps and Secrets in the additional specifications. Procedure Create the OpenStackBackupRequest CRD and set the mode to save to request a backup: Optional: Use the additionalConfigMaps and additionalSecrets specifications to include ConfigMaps or Secrets that you created manually. Monitor the status of the OpenStackBackupRequest: Note The Quiescing state indicates that director Operator is waiting for the CRs to reach their finished state. The length of time for the backup to finish can vary depending on the number of CRs. You can investigate the director Operator logs to check progress: Replace <operator_pod> with the name of the Operator pod. Verification View the OpenStackBackupRequest to confirm that the STATUS is Saved : If the OpenStackBackupRequest enters the Error state, review the request contents to find the error: Replace <request_name> with the name of the backup request. View the OpenStackBackup to confirm it exists: 15.3. Restoring director Operator from a backup When you request director Operator to restore a backup, director Operator takes the contents of the restoreSource OpenStackBackup and attempts to apply them to all existing CR, ConfigMap, and Secret resources present within the namespace. Director operator overwrites any existing director Operator resources in the namespace, and creates new resources for those not found within the namespace. Procedure List the available backups: Note To inspect the details of a specific backup: Replace <name> with the name of the backup you want to inspect. Create the OpenStackBackupRequest CRD and set the mode to restore . For example: Replace <mode> with one of the following options: restore - to request a restore from an existing OpenStackBackup. cleanRestore - to completely wipe the existing director Operator resources within the namespace before any restoration attempt. Replace <restore_source> with the ID of the OpenStackBackup to restore, for example, openstackbackupsave-1641928378 . Monitor the status of the OpenStackBackupRequest: After all resources are loaded, director Operator begins reconciling: Note If the OpenStackBackupRequest enters the Error state, view the request contents to find the error: Verification View the OpenStackBackupRequest to confirm that the STATUS is Restored :

Commands:
apiVersion: osp-director.openstack.org/v1beta1 kind: OpenStackBackupRequest metadata: name: openstackbackupsave namespace: openstack spec: mode: save additionalConfigMaps: [] additionalSecrets: []
oc get -n openstack osbackuprequest openstackbackupsave NAME OPERATION SOURCE STATUS COMPLETION TIMESTAMP openstackbackupsave save Quiescing
oc logs <operator_pod> -c manager -f 2022-01-11T18:26:15.180Z INFO controllers.OpenStackBackupRequest Quiesce for save for OpenStackBackupRequest openstackbackupsave is waiting for: [OpenStackBaremetalSet: compute, OpenStackControlPlane: overcloud, OpenStackVMSet: controller]
oc get -n openstack osbackuprequest NAME OPERATION SOURCE STATUS COMPLETION TIMESTAMP openstackbackupsave save Saved 2022-01-11T19:12:58Z
oc get -n openstack openstackbackuprequest <request_name> -o yaml
oc get -n openstack osbackup NAME AGE openstackbackupsave-1641928378 6m7s
oc get osbackup
oc get backup <name> -o yaml
apiVersion: osp-director.openstack.org/v1beta1 kind: OpenStackBackupRequest metadata: name: openstackbackupsave namespace: openstack spec: mode: <mode> restoreSource: <restore_source>
oc get -n openstack osbackuprequest openstackbackuprestore NAME OPERATION SOURCE STATUS COMPLETION TIMESTAMP openstackbackuprestore restore openstackbackupsave-1641928378 Loading
oc get -n openstack osbackuprequest openstackbackuprestore NAME OPERATION SOURCE STATUS COMPLETION TIMESTAMP openstackbackuprestore restore openstackbackupsave-1641928378 Reconciling
oc get -n openstack openstackbackuprequest <name> -o yaml
oc get -n openstack osbackuprequest NAME OPERATION SOURCE STATUS COMPLETION TIMESTAMP openstackbackuprestore restore openstackbackupsave-1641928378 Restored 2022-01-12T13:48:57Z