Search

Chapter 15. Backing up and restoring a director Operator deployed overcloud

download PDF

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

  1. Create a file named openstack_backup.yaml on your workstation.
  2. Add the following configuration to your openstack_backup.yaml file to create the OpenStackBackupRequest custom resource (CR):

    apiVersion: osp-director.openstack.org/v1beta1
    kind: OpenStackBackupRequest
    metadata:
      name: openstackbackupsave
      namespace: openstack
    spec:
      mode: save 1
      additionalConfigMaps: [] 2
      additionalSecrets: [] 3
    1
    Set the mode to save to request creation of an OpenStackBackup CR.
    2
    Optional: Include any ConfigMap resources that you created manually.
    3
    Optional: Include any Secret resources that you created manually.
    Note

    OSPdO attempts to include all ConfigMap and Secret objects associated with the OSPdO CRs in the namespace, such as OpenStackControlPlane and OpenStackBaremetalSet. You do not need to include those in the additional lists.

  3. Save the openstack_backup.yaml file.
  4. Create the OpenStackBackupRequest CR:

    $ oc create -f openstack_backup.yaml -n openstack
  5. 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.
    • The Saved state indicates that the OpenStackBackup 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
  6. 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

  1. List the available backups:

    $ oc get osbackup
  2. 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.
  3. Create a file named openstack_restore.yaml on your workstation.
  4. Add the following configuration to your openstack_restore.yaml file to create the OpenStackBackupRequest 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 existing OpenStackBackup.
      • cleanRestore: Completely wipes the existing OSPdO resources within the namespace before restoring and creating new resources from the existing OpenStackBackup.
    • Replace <restore_source> with the ID of the OpenStackBackup to restore, for example, openstackbackupsave-1641928378.
  5. Save the openstack_restore.yaml file.
  6. Create the OpenStackBackupRequest CR:

    $ oc create -f openstack_restore.yaml -n openstack
  7. Monitor the creation status of the OpenStackBackupRequest CR:

    $ oc get openstackbackuprequest openstackbackuprestore -n openstack
    • The Loading state indicates that all resources from the OpenStackBackup 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 the OpenStackBackup 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
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.