Ce contenu n'est pas disponible dans la langue sélectionnée.
Chapter 15. Backing up and restoring a director Operator deployed overcloud
Red Hat OpenStack Platform (RHOSP) director Operator (OSPdO) provides custom resource definitions (CRDs) for backing up and restoring a deployment. You do not have to manually export and import multiple configurations. OSPdO knows which custom resources (CRs), including the ConfigMap
and Secret
CRs, that it needs to create a complete backup because it is aware of the state of all resources. Therefore, OSPdO does not backup any configuration that is in an incomplete or error state.
To backup and restore an OSPdO deployment, you create an OpenStackBackupRequest
CR to initiate the creation or restoration of a backup. Your OpenStackBackupRequest
CR creates the OpenStackBackup
CR that stores the backup of the custom resources (CRs), the ConfigMap
and the Secret
configurations for the specified namespace.
15.1. Backing up director Operator
To create a backup you must create an OpenStackBackupRequest
custom resource (CR) for the namespace. The OpenStackBackup
CR is created when the OpenStackBackupRequest
object is created in save
mode.
Procedure
-
Create a file named
openstack_backup.yaml
on your workstation. Add the following configuration to your
openstack_backup.yaml
file to create theOpenStackBackupRequest
custom resource (CR):apiVersion: osp-director.openstack.org/v1beta1 kind: OpenStackBackupRequest metadata: name: openstackbackupsave namespace: openstack spec: mode: save 1 additionalConfigMaps: [] 2 additionalSecrets: [] 3
NoteOSPdO attempts to include all
ConfigMap
andSecret
objects associated with the OSPdO CRs in the namespace, such asOpenStackControlPlane
andOpenStackBaremetalSet
. You do not need to include those in the additional lists.-
Save the
openstack_backup.yaml
file. Create the
OpenStackBackupRequest
CR:$ oc create -f openstack_backup.yaml -n openstack
Monitor the creation status of the
OpenStackBackupRequest
CR:$ oc get openstackbackuprequest openstackbackupsave -n openstack
The
Quiescing
state indicates that OSPdO is waiting for the CRs to reach their finished state. The number of CRs can affect how long it takes to finish creating the backup.NAME OPERATION SOURCE STATUS COMPLETION TIMESTAMP openstackbackupsave save Quiescing
If the status remains in the
Quiescing
state for longer than expected, you can investigate the OSPdO logs to check progress:$ 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]
-
Replace
<operator_pod>
with the name of the Operator pod.
-
Replace
The
Saved
state indicates that theOpenStackBackup
CR is created.NAME OPERATION SOURCE STATUS COMPLETION TIMESTAMP openstackbackupsave save Saved 2022-01-11T19:12:58Z
The
Error
state indicates the backup has failed to create. Review the request contents to find the error:$ oc get openstackbackuprequest openstackbackupsave -o yaml -n openstack
View the
OpenStackBackup
resource to confirm it exists:$ oc get openstackbackup -n openstack NAME AGE openstackbackupsave-1641928378 6m7s
15.2. Restoring director Operator from a backup
When you request to restore a backup, Red Hat OpenStack Platform (RHOSP) director Operator (OSPdO) takes the contents of the specified OpenStackBackup
resource and attempts to apply them to all existing custom resources (CRs), ConfigMap
and Secret
resources present within the namespace. OSPdO overwrites any existing resources in the namespace, and creates new resources for those not found within the namespace.
Procedure
List the available backups:
$ oc get osbackup
Inspect the details of a specific backup:
$ oc get backup <name> -o yaml
-
Replace
<name>
with the name of the backup you want to inspect.
-
Replace
-
Create a file named
openstack_restore.yaml
on your workstation. Add the following configuration to your
openstack_restore.yaml
file to create theOpenStackBackupRequest
custom resource (CR):apiVersion: osp-director.openstack.org/v1beta1 kind: OpenStackBackupRequest metadata: name: openstackbackuprestore namespace: openstack spec: mode: <mode> restoreSource: <restore_source>
Replace
<mode>
with one of the following options:-
restore
: Requests a restore from an existingOpenStackBackup
. -
cleanRestore
: Completely wipes the existing OSPdO resources within the namespace before restoring and creating new resources from the existingOpenStackBackup
.
-
-
Replace
<restore_source>
with the ID of theOpenStackBackup
to restore, for example,openstackbackupsave-1641928378
.
-
Save the
openstack_restore.yaml
file. Create the
OpenStackBackupRequest
CR:$ oc create -f openstack_restore.yaml -n openstack
Monitor the creation status of the
OpenStackBackupRequest
CR:$ oc get openstackbackuprequest openstackbackuprestore -n openstack
The
Loading
state indicates that all resources from theOpenStackBackup
are being applied against the cluster.NAME OPERATION SOURCE STATUS COMPLETION TIMESTAMP openstackbackuprestore restore openstackbackupsave-1641928378 Loading
The
Reconciling
state indicates that all resources are loaded and OSPdO has begun reconciling to attempt to provision all resources.NAME OPERATION SOURCE STATUS COMPLETION TIMESTAMP openstackbackuprestore restore openstackbackupsave-1641928378 Reconciling
The
Restored
state indicates that theOpenStackBackup
CR has been restored.NAME OPERATION SOURCE STATUS COMPLETION TIMESTAMP openstackbackuprestore restore openstackbackupsave-1641928378 Restored 2022-01-12T13:48:57Z
The
Error
state indicates the restoration has failed. Review the request contents to find the error:$ oc get openstackbackuprequest openstackbackuprestore -o yaml -n openstack