Protect backup metadata

Export and store backup metadata in a safe, offsite location to ensure recovery after a Block Storage service database loss. For incremental backups, you must import the metadata of all preceding backups before you can restore the volume.

Export backup metadata

You can export the metadata of a backup and store it in a file so that you can restore the volume backup even if the Block Storage database suffers a catastrophic loss.

About this task

Note
For an incremental backup, you must export the metadata of all the preceding backups.

Procedure

  1. Access the remote shell for the OpenStackClient pod from your workstation:
    $ oc rsh -n openstack openstackclient
  2. List the backups to obtain the ID or name of the backup:
    $ openstack volume backup list
  3. Export the metadata of the backup and store it in an appropriately named YAML file:
    $ openstack volume backup record export -f yaml <backup> > <filename>.yaml
    • Replace <backup> with the ID or name of the volume backup.
    • Replace <filename> with the name of the YAML file to save the exported backup_service and backup_url values for this backup.

      For example:

      $ openstack volume backup record export -f yaml vol1bu2 > vol1bu2.yaml
  4. Copy the file to a safe location, such as an offsite backup.

Results

  • Edit the file to see that the values of the backup_service and backup_url, match the values provided by this command:
    $ openstack volume backup record export -f yaml <backup>

    For example:

    $ openstack volume backup record export -f yaml vol1bu2
    backup_service: cinder.backup.drivers.ceph.CephBackupDriver
    backup_url: eyJkcml2 … YWxzZX0=
    1. Exit the openstackclient pod:
      $ exit

Import backup metadata

If you export and save the metadata of a volume backup, then you can import this metadata and use the backup if there is a loss of the Block Storage service database.

Before you begin

  • You must provide the backup_service and backup_url metadata values of this backup. For more information see Export backup metadata.
  • A Block Storage database that does not already contain this backup.

About this task

You can also use this procedure to re-create a backup that was deleted.

Note
For incremental backups, you must also import the metadata of all the preceding backups.

Procedure

  1. Access the remote shell for the OpenStackClient pod from your workstation:
    $ oc rsh -n openstack openstackclient
  2. Locate the file in which you stored the exported backup_service and backup_url metadata values of this backup.
  3. Import the metadata values of this volume backup to the Block Storage database:
    $ openstack volume backup record import <backup_service> <backup_url>
    • Replace <backup_service> with the backup_service metadata value of this volume backup.
    • Replace <backup_url> with the backup_url metadata value of this volume backup.

      This command provides the name and the ID of this backup. For example:

      $ openstack volume backup record import cinder.backup.drivers.ceph.CephBackupDriver eyJkcml2 … YWxzZX0=
      +-------+--------------------------------------+
      | Field | Value                                |
      +-------+--------------------------------------+
      | id    | 83dadc43-2aa9-4c0b-bc05-a12203a8f4cb |
      | name  | vol1bu2                              |
      +-------+--------------------------------------+
  4. Exit the openstackclient pod:
    $ exit

What to do next