Ce contenu n'est pas disponible dans la langue sélectionnée.
Chapter 3. Using the Block Storage backup service
You can use the Block Storage backup service to perform full or incremental backups, to protect your backups, and to restore a backup to a volume.
3.1. Creating backups Copier lienLien copié sur presse-papiers!
Create a backup of your Block Storage volume to protect your data from being lost if the volume fails. For more information, see Creating a full volume backup. You can also create a backup directly from a snapshot of a volume. For more information, see Creating a full snapshot backup. In addition to the volume data, a backup also stores the volume metadata, such as the name and description.
If you have enabled data compression for your backup repository then your backups will be compressed, which can reduce their performance.
Full backups are easier to manage but they can become resource intensive when the size of the volume increases over time. With incremental backups, you can capture periodic changes to volumes and minimize resource usage. For more information, see Incremental backups.
You can create backups of volumes that you have access to. Project administrators can back up any volume belonging to the project. These backups are hidden from the volume owners unless the administrator provides additional arguments when creating the backup. For more information, see Backup arguments to authenticate volume owners.
Each project (tenant) limits the maximum number of backups and the maximum total size of all backups that can be created for it. As a project administrator, you can view and change these quotas. For more information, see Viewing and modifying project backup quotas.
Normally you can only backup a volume that has an available status but, if you need to, you can backup a volume with an in-use status. For more information, see Creating a backup of an in-use volume.
When you create a backup of a Block Storage volume, the metadata for this backup is stored in the Block Storage service database, which is used when restoring this volume. To ensure that a backup survives a catastrophic loss of the Block Storage service database, a project administrator can manually export and store the metadata of this backup. For more information, see Protecting your backups.
3.1.1. Creating a full volume backup Copier lienLien copié sur presse-papiers!
You can create one or more full backups of a volume.
Prerequisites
- Only volume owners and project administrators can backup volumes.
- Your backup repository must have the necessary space.
- The backup quotas specified for your project have not been exceeded. For more information, see Viewing and modifying project backup quotas.
Procedure
-
Log in to the undercloud host as the
stackuser. Source the
stackrcundercloud credentials file:source ~/stackrc
$ source ~/stackrcCopy to Clipboard Copied! Toggle word wrap Toggle overflow List the volumes to obtain the ID or name of the volume you want to back up:
openstack volume list
$ openstack volume listCopy to Clipboard Copied! Toggle word wrap Toggle overflow NoteUsually you can only backup a volume that has an
availablestatus but, if you need to, you can backup a volume with anin-usestatus. For more information, see Creating a backup of an in-use volume.Back up the volume:
NoteIf you are the project administrator and not the volume owner, then to make this backup accessible by the volume owner, you need to provide additional parameters when creating this backup. For more information, see Backup arguments to authenticate volume owners.
openstack volume backup create [--name <backup_name>] <volume>
$ openstack volume backup create [--name <backup_name>] <volume>Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<volume>with the ID or name of the volume you want to back up. Optional: replace
<backup_name>with the name of this backup.This command immediately provides the ID of this backup but the volume is backed up asynchronously, in the background. For example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
-
Replace
Verification
List the backups:
openstack volume backup list
$ openstack volume backup listCopy to Clipboard Copied! Toggle word wrap Toggle overflow The volume backup is created when this backup has an
availablestatus. For example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Additional resources
3.1.2. Creating a full snapshot backup Copier lienLien copié sur presse-papiers!
You can create a full backup from a snapshot by using the ID of the volume associated with the snapshot.
The backup is created by directly attaching to the snapshot, which is faster than cloning the snapshot into a volume and then backing up this volume. But this feature can affect the backup performance because of the extra step of creating the volume from a snapshot.
Prerequisites:
- Your backup repository must have the necessary space.
- The backup quotas specified for your project have not been exceeded. For more information, see Viewing and modifying project backup quotas.
Procedure
-
Log in to the undercloud host as the
stackuser. Source the
stackrcundercloud credentials file:source ~/stackrc
$ source ~/stackrcCopy to Clipboard Copied! Toggle word wrap Toggle overflow List the snapshots to obtain the name or ID of the snapshot you want to backup:
openstack volume snapshot list
$ openstack volume snapshot listCopy to Clipboard Copied! Toggle word wrap Toggle overflow List the details of this snapshot to obtain the ID of the volume associated with this snapshot:
openstack volume snapshot show <snapshot>
$ openstack volume snapshot show <snapshot>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace
<snapshot>with the name or ID of the snapshot you want to backup.The value of the
volume_idfield is the ID of the volume associated with this snapshot. For example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Backup the snapshot:
openstack volume backup create [--name <backup_name>] --snapshot <snapshot> <volume_id>
$ openstack volume backup create [--name <backup_name>] --snapshot <snapshot> <volume_id>Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<volume_id>with the ID of the volume associated with this snapshot. Optional: replace
<backup_name>with the name of this backup.This command immediately provides the ID of this backup but the snapshot is backed up asynchronously, in the background. For example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
-
Replace
Verification
List the backups:
openstack volume backup list
$ openstack volume backup listCopy to Clipboard Copied! Toggle word wrap Toggle overflow The snapshot backup is created when this backup has an
availablestatus. For example:+--------------------------------------+------------+-------------+-----------+------+ | ID | Name | Description | Status | Size | +--------------------------------------+------------+-------------+-----------+------+ | 867e6cfb-9be7-47fa-8a79-221b0e80c757 | snap1bu1 | None | available | 1 | +--------------------------------------+------------+-------------+-----------+------+
+--------------------------------------+------------+-------------+-----------+------+ | ID | Name | Description | Status | Size | +--------------------------------------+------------+-------------+-----------+------+ | 867e6cfb-9be7-47fa-8a79-221b0e80c757 | snap1bu1 | None | available | 1 | +--------------------------------------+------------+-------------+-----------+------+Copy to Clipboard Copied! Toggle word wrap Toggle overflow
3.1.3. Creating a backup of an in-use volume Copier lienLien copié sur presse-papiers!
Usually you can only backup a volume that has an available status. But you can use the --force option when creating a backup, to back up a volume that has an in-use status.
When you use the --force volume backup option, you create a crash-consistent, but not an application-consistent, backup because the volume is not quiesced before performing the backup. Therefore, the data is intact but the backup does not have an awareness of which applications were running when the backup was performed.
Prerequisites
- Only volume owners and project administrators can backup volumes.
- Your backup repository must have the necessary space.
- The backup quotas specified for your project have not been exceeded. For more information, see Viewing and modifying project backup quotas.
Procedure
-
Log in to the undercloud host as the
stackuser. Source the
stackrcundercloud credentials file:source ~/stackrc
$ source ~/stackrcCopy to Clipboard Copied! Toggle word wrap Toggle overflow List the volumes to obtain the ID or name of the volume you want to back up:
openstack volume list
$ openstack volume listCopy to Clipboard Copied! Toggle word wrap Toggle overflow For example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Force the back up, if the volume that you want to backup has an
in-usestatus:openstack volume backup create [--name <backup_name>] --force <volume>
$ openstack volume backup create [--name <backup_name>] --force <volume>Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<volume>with the ID or name of the volume you want to back up. Optional: replace
<backup_name>with the name of this backup.This command immediately provides the ID of this backup but the volume is backed up asynchronously, in the background. For example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
-
Replace
Verification
List the backups:
openstack volume backup list
$ openstack volume backup listCopy to Clipboard Copied! Toggle word wrap Toggle overflow The volume backup is created when this backup has an
availablestatus. For example:+--------------------------------------+------------+-------------+-----------+------+ | ID | Name | Description | Status | Size | +--------------------------------------+------------+-------------+-----------+------+ | 8c72bbf3-eb8e-4459-83e9-c7654ebe6343 | panvol2bu1 | None | available | 1 | +--------------------------------------+------------+-------------+-----------+------+
+--------------------------------------+------------+-------------+-----------+------+ | ID | Name | Description | Status | Size | +--------------------------------------+------------+-------------+-----------+------+ | 8c72bbf3-eb8e-4459-83e9-c7654ebe6343 | panvol2bu1 | None | available | 1 | +--------------------------------------+------------+-------------+-----------+------+Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Additional resources
3.1.4. Incremental backups Copier lienLien copié sur presse-papiers!
If a volume has at least one full backup, you can use the Block Storage backup service to create an incremental backup. For more information, see Creating an incremental backup.
Full backups are easier to manage but they can become resource intensive when the size of the volume increases over time. With incremental backups, you can capture periodic changes to volumes and minimize your resource usage.
An incremental backup only stores the changes made to the volume since the last full or incremental backup.
Incremental backups increase the administrative overhead required for managing your backups. For instance, you cannot delete a full backup if it already has one or more incremental backups, you can only delete the latest incremental backup.
Incremental backups have a lower performance than full backups: When you create an incremental backup, all of the data in the volume must first be read and compared with the data in both the full backup and each subsequent incremental backup.
3.1.4.1. Creating an incremental backup Copier lienLien copié sur presse-papiers!
You can create an incremental backup to only store the changes made to the volume since the last full or incremental backup.
Prerequisites:
- At least one full backup of the volume. For more information, see Creating a full volume backup.
- Only volume owners and project administrators can backup volumes.
- Your backup repository must have the necessary space.
- The backup quotas specified for your project have not been exceeded. For more information, see Viewing and modifying project backup quotas.
Procedure
-
Log in to the undercloud host as the
stackuser. Source the
stackrcundercloud credentials file:source ~/stackrc
$ source ~/stackrcCopy to Clipboard Copied! Toggle word wrap Toggle overflow List the volumes to obtain the ID or name of the volume you want to back up:
openstack volume list
$ openstack volume listCopy to Clipboard Copied! Toggle word wrap Toggle overflow Back up the volume and use the
--incrementaloption:openstack volume backup create --incremental [--name <backup_name>] <volume>
$ openstack volume backup create --incremental [--name <backup_name>] <volume>Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<volume>with the ID or name of the volume you want to back up. Optional: replace
<backup_name>with the name of this backup.This command immediately provides the ID of this backup but the volume is backed up asynchronously, in the background. For example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
-
Replace
Verification
List the backups:
openstack volume backup list
$ openstack volume backup listCopy to Clipboard Copied! Toggle word wrap Toggle overflow The volume backup is created when this backup has an
availablestatus. For example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Additional resources
3.1.5. Backup performance considerations Copier lienLien copié sur presse-papiers!
Some features of the Block Storage backup service like incremental backups and data compression can reduce the performance of the backups.
By only capturing the periodic changes to volumes, incremental backups can minimize your resource usage. For more information, see Incremental backups. But incremental backups have a lower performance than full backups: When you create an incremental backup, all of the data in the volume must first be read and compared with the data in both the full backup and each subsequent incremental backup.
You can also create a backup from a snapshot by directly attaching to it, which is faster than cloning the snapshot into a volume. For more information, see Creating a full snapshot backup. But this feature can affect the backup performance because of the extra step of creating the volume from a snapshot.
Enabling data compression of your backup repository requires additional CPU power but uses less network bandwidth and storage space overall. You can configure the Block Storage backup service to enable or disable data compression of your backup repository. For more information, see Block Storage backup service configuration.
You cannot use data compression with the Red Hat Ceph Storage back end.
3.1.6. Backup arguments to authenticate volume owners Copier lienLien copié sur presse-papiers!
Project administrators can back up any volume belonging to the project, but these backups are hidden from the volume owners.
To ensure that the volume owner can also access the volume backup, the project administrator must provide the following additional arguments to authenticate as the volume owner when backing up the volume:
openstack --os-auth-url <keystoneurl> --os-project-name <projectname> --os-username <username> --os-password <password> volume backup create [--name <backup_name>] <volume>
$ openstack --os-auth-url <keystoneurl> --os-project-name <projectname> --os-username <username> --os-password <password> volume backup create [--name <backup_name>] <volume>
-
Replace
<keystoneurl>with the URL endpoint of the Identity service, which is typically http://IP:5000/v3, whereIPis the IP address of the Identity service host. -
Replace
<projectname>with the name of the project (tenant) of the owner of the volume. -
Replace
<username>and<password>with the username and password credentials of the user that is the owner of the volume within this project.
[--name <backup_name>] <volume> are the typical arguments when creating a volume backup.
3.1.7. Viewing and modifying project backup quotas Copier lienLien copié sur presse-papiers!
A project administrator can change or view the maximum number of backups and the maximum total size of all backups, in gigabytes, that can be created for a specific project (tenant) and see the usage of these backup quotas for this project.
Prerequisites
- You must be a project administrator to view or modify the backup quotas of a project.
Procedure
-
Log in to the undercloud host as the
stackuser. Source the
stackrcundercloud credentials file:source ~/stackrc
$ source ~/stackrcCopy to Clipboard Copied! Toggle word wrap Toggle overflow List the projects to obtain the ID or name of the required project:
openstack project list
$ openstack project listCopy to Clipboard Copied! Toggle word wrap Toggle overflow View the backup quotas for a specific project:
openstack quota show <project>
$ openstack quota show <project>Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<project>with the ID or name of the required project.
The value of the
backup-gigabytesfield in the table is the maximum total size of all backups that can be created in this project. The value of thebackupsfield in the table is the maximum number of backups that can be created in this project. For example:+
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
Modify the maximum total size of all backups created for a project:
openstack quota set --backup-gigabytes <maxgb> <project>
$ openstack quota set --backup-gigabytes <maxgb> <project>Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<maxgb>with the maximum total size, in gigabytes, of the backups that can be created for this project.
-
Replace
Modify the maximum number of backups that can be created for a project:
openstack quota set --backups <maxnum> <project>
$ openstack quota set --backups <maxnum> <project>Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<maxnum>with the maximum number of backups that can be created for this project.
-
Replace
View the usage of these backup quotas for a specific project:
cinder quota-usage <project_id>
$ cinder quota-usage <project_id>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace
<project_id>with the ID of the project.For example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
If you have changed either of these quotas then review these changes:
openstack quota show <project>
$ openstack quota show <project>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Ensure that the modified values are specified by the
backup-gigabytesandbackupsfields in the table. For example:+-----------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Field | Value | +-----------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | backup-gigabytes | 500 | | backups | 12
+-----------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Field | Value | +-----------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | backup-gigabytes | 500 | | backups | 12Copy to Clipboard Copied! Toggle word wrap Toggle overflow
3.1.8. Canceling a backup Copier lienLien copié sur presse-papiers!
You must request a force delete on the backup to cancel it.
You cannot cancel backups if you use the Red Hat Ceph Storage back end for your backup repository.
Procedure
-
Log in to the undercloud host as the
stackuser. Source the
stackrcundercloud credentials file:source ~/stackrc
$ source ~/stackrcCopy to Clipboard Copied! Toggle word wrap Toggle overflow List the backups to obtain the ID or name of the backup you want to cancel:
openstack volume backup list
$ openstack volume backup listCopy to Clipboard Copied! Toggle word wrap Toggle overflow Cancel the backup:
openstack volume backup delete --force <backup>
# openstack volume backup delete --force <backup>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace
<backup>with the ID or name of the volume backup that you want to cancel.There can be a slight delay for the backup to be successfully canceled.
Verification
The backup is canceled when the backup record is not listed by this command:
openstack volume backup show <backup>
$ openstack volume backup show <backup>Copy to Clipboard Copied! Toggle word wrap Toggle overflow
3.2. Backing up and restoring across edge sites Copier lienLien copié sur presse-papiers!
You can back up and restore Block Storage service (cinder) volumes across distributed compute node (DCN) architectures in edge site and availability zones. The cinder-backup service runs in the central availability zone (AZ), and backups are stored in the central AZ. The Block Storage service does not store backups at DCN sites.
Prerequisites
- Deploy the optional Block Storage backup service. For more information, see Block Storage backup service deployment in Backing up Block Storage volumes.
- Block Storage (cinder) REST API microversion 3.51 or later.
-
All sites must use a common
openstackcephx client name. For more information, see Creating a Ceph key for external access in Deploying a Distributed Compute Node (DCN) architecture.
Procedure
Create a backup of a volume in the first DCN site:
cinder --os-volume-api-version 3.51 backup-create --name <volume_backup> --availability-zone <az_central> <edge_volume>
$ cinder --os-volume-api-version 3.51 backup-create --name <volume_backup> --availability-zone <az_central> <edge_volume>Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<volume_backup>with a name for the volume backup. -
Replace
<az_central>with the name of the central availability zone that hosts thecinder-backupservice. Replace
<edge_volume>with the name of the volume that you want to back up.NoteIf you experience issues with Ceph keyrings, you might need to restart the
cinder-backupcontainer so that the keyrings copy from the host to the container successfully.
-
Replace
Restore the backup to a new volume in the second DCN site:
cinder --os-volume-api-version 3.51 create --availability-zone <az_2> --name <new_volume> --backup-id <volume_backup> <volume_size>
$ cinder --os-volume-api-version 3.51 create --availability-zone <az_2> --name <new_volume> --backup-id <volume_backup> <volume_size>Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<az_2>with the name of the availability zone where you want to restore the backup. -
Replace
<new_volume>with a name for the new volume. -
Replace
<volume_backup>with the name of the volume backup that you created in the previous step. -
Replace
<volume_size>with a value in GB equal to or greater than the size of the original volume.
-
Replace
3.3. Protecting your backups Copier lienLien copié sur presse-papiers!
When you create a backup of a Block Storage volume, the metadata for this backup is stored in the Block Storage service database, which is used to restore this volume. To ensure that a backup survives a catastrophic loss of the Block Storage service database, a project administrator can manually export and store the metadata of this backup in a safe location, such as an offsite backup. For more information, see Exporting backup metadata.
When the Block Storage service database experiences a catastrophic loss you cannot restore any of your backups because this database contains the backup metadata used when restoring backups. But if a project administrator manually exported and saved the metadata of a backup, then the project administrator can import this metadata into the new Block Storage database, so that you can use this backup to restore the volume. For more information see Importing backup metadata.
For incremental backups, you must import the metadata of all the preceding backups before you can use it to restore the volume.
3.3.1. Exporting backup metadata Copier lienLien copié sur presse-papiers!
A project administrator 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. For more information, see Protecting your backups.
For an incremental backup, you must export the metadata of all the preceding backups.
Prerequisites
- You must be a project administrator to export the backup metadata.
Procedure
-
Log in to the undercloud host as the
stackuser. Source the
stackrcundercloud credentials file:source ~/stackrc
$ source ~/stackrcCopy to Clipboard Copied! Toggle word wrap Toggle overflow List the backups to obtain the ID or name of the backup:
openstack volume backup list
$ openstack volume backup listCopy to Clipboard Copied! Toggle word wrap Toggle overflow 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
$ openstack volume backup record export -f yaml <backup> > <filename>.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<backup>with the ID or name of the volume backup. Replace
<filename>with the name of the YAML file to save the exportedbackup_serviceandbackup_urlvalues for this backup.For example:
openstack volume backup record export -f yaml vol1bu2 > vol1bu2.yaml
$ openstack volume backup record export -f yaml vol1bu2 > vol1bu2.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow
-
Replace
- Copy the file to a safe location, such as an offsite backup.
Verification
Edit the file to see that the values of the
backup_serviceandbackup_url, match the values provided by this command:openstack volume backup record export -f yaml <backup>
$ openstack volume backup record export -f yaml <backup>Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example:
openstack volume backup record export -f yaml vol1bu2
$ openstack volume backup record export -f yaml vol1bu2 backup_service: cinder.backup.drivers.ceph.CephBackupDriver backup_url: eyJkcml2 … YWxzZX0=Copy to Clipboard Copied! Toggle word wrap Toggle overflow
3.3.2. Importing backup metadata Copier lienLien copié sur presse-papiers!
If a project administrator has exported and saved the metadata of a volume backup, then after a catastrophic loss of the Block Storage service database, the project administrator can import this metadata, so that you can use this backup.
You can also use this procedure to recreate a backup that was deleted.
For incremental backups, you must also import the metadata of all the preceding backups.
Prerequisites
- You must be a project administrator to import the volume backup metadata to a Block Storage database.
-
You must provide the
backup_serviceandbackup_urlmetadata values of this backup. For more information see Exporting backup metadata. - A Block Storage database that does not already contain this backup.
Procedure
-
Log in to the undercloud host as the
stackuser. Source the
stackrcundercloud credentials file:source ~/stackrc
$ source ~/stackrcCopy to Clipboard Copied! Toggle word wrap Toggle overflow -
Locate the file in which you stored the exported
backup_serviceandbackup_urlmetadata values of this backup. Import the metadata values of this volume backup to the Block Storage database:
openstack volume backup record import <backup_service> <backup_url>
$ openstack volume backup record import <backup_service> <backup_url>Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<backup_service>with thebackup_servicemetadata value of this volume backup. Replace
<backup_url>with thebackup_urlmetadata value of this volume backup.This command provides the name and the ID of this backup. For example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
-
Replace
Next steps
3.4. Restoring backups Copier lienLien copié sur presse-papiers!
After you create a Block Storage volume backup, you can restore this backed up data if needed.
You can use one of the following methods to restore your backups:
- Restore the backup to a volume that you specify. For more information, see Restoring a backup to a specific volume.
- Restore the backup to a new volume. For more information, see Restoring a backup to a new volume.
When the Block Storage service database experiences a catastrophic loss you cannot restore any of your backups, unless you have exported and saved their metadata. For more information see Protecting your backups.
Only project administrators can cancel restoring a volume backup. For more information, see Canceling restoring a backup.
3.4.1. Restoring a backup to a specific volume Copier lienLien copié sur presse-papiers!
You can restore a volume backup to an available volume that you have already created.
If you restore a volume from an encrypted backup, then the destination volume type must also be encrypted.
Procedure
-
Log in to the undercloud host as the
stackuser. Source the
stackrcundercloud credentials file:source ~/stackrc
$ source ~/stackrcCopy to Clipboard Copied! Toggle word wrap Toggle overflow List the backups to obtain the name or ID of the backup you want to restore:
openstack volume backup list
$ openstack volume backup listCopy to Clipboard Copied! Toggle word wrap Toggle overflow For example:
+--------------------------------------+---------+-------------+-----------+------+ | ID | Name | Description | Status | Size | +--------------------------------------+---------+-------------+-----------+------+ | 83dadc43-2aa9-4c0b-bc05-a12203a8f4cb | vol1bu2 | None | available | 1 |
+--------------------------------------+---------+-------------+-----------+------+ | ID | Name | Description | Status | Size | +--------------------------------------+---------+-------------+-----------+------+ | 83dadc43-2aa9-4c0b-bc05-a12203a8f4cb | vol1bu2 | None | available | 1 |Copy to Clipboard Copied! Toggle word wrap Toggle overflow List the volumes:
openstack volume list
$ openstack volume listCopy to Clipboard Copied! Toggle word wrap Toggle overflow Ensure that the status of the required volume is
availableand then obtain the name or ID of this volume. For example:+--------------------------------------+----------------+-----------+------+--------------------------------+ | ID | Name | Status | Size | Attached to | +--------------------------------------+----------------+-----------+------+--------------------------------+ | 654e2be8-bc79-4528-96a7-5f773d31c201 | vol_3 | available | 1 | |
+--------------------------------------+----------------+-----------+------+--------------------------------+ | ID | Name | Status | Size | Attached to | +--------------------------------------+----------------+-----------+------+--------------------------------+ | 654e2be8-bc79-4528-96a7-5f773d31c201 | vol_3 | available | 1 | |Copy to Clipboard Copied! Toggle word wrap Toggle overflow Restore the backup to the volume:
openstack volume backup restore <backup> <volume>
$ openstack volume backup restore <backup> <volume>Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<backup>with the name or ID of the Block Storage volume backup. Replace
<volume>with the name or ID of theavailableBlock Storage volume.For example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
-
Replace
-
Verify that the
backup_idprovided by this command corresponds to the ID of the backup that was restored and that thevolume_nameandvolume_idvalues correspond to the name and ID of the specified volume. Delete the backup if you no longer need it:
openstack volume backup delete <backup>
$ openstack volume backup delete <backup>Copy to Clipboard Copied! Toggle word wrap Toggle overflow
3.4.2. Restoring a backup to a new volume Copier lienLien copié sur presse-papiers!
You can create a new volume when you restore a backup of a Block Storage volume.
Procedure
-
Log in to the undercloud host as the
stackuser. Source the
stackrcundercloud credentials file:source ~/stackrc
$ source ~/stackrcCopy to Clipboard Copied! Toggle word wrap Toggle overflow List the backups to obtain the name or ID of the backup you want to restore:
openstack volume backup list
$ openstack volume backup listCopy to Clipboard Copied! Toggle word wrap Toggle overflow For example:
+--------------------------------------+---------+-------------+-----------+------+ | ID | Name | Description | Status | Size | +--------------------------------------+---------+-------------+-----------+------+ | 83dadc43-2aa9-4c0b-bc05-a12203a8f4cb | vol1bu2 | None | available | 1 |
+--------------------------------------+---------+-------------+-----------+------+ | ID | Name | Description | Status | Size | +--------------------------------------+---------+-------------+-----------+------+ | 83dadc43-2aa9-4c0b-bc05-a12203a8f4cb | vol1bu2 | None | available | 1 |Copy to Clipboard Copied! Toggle word wrap Toggle overflow Restore the backup to a new volume:
cinder backup-restore <backup>
$ cinder backup-restore <backup>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace
<backup>with the name or ID of the Block Storage volume backup.For example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verify that the
backup_idprovided by this command corresponds to the ID of the backup that was restored.The
volume_idvalue is the ID of the created volume. But thevolume_namecan be a temporary name that is replaced with the name of the backed up volume.List the volumes to verify that the volume with an ID of
volume_idhas been created and to obtain this volume name:openstack volume list
$ openstack volume listCopy to Clipboard Copied! Toggle word wrap Toggle overflow For example:
+--------------------------------------+----------------+-----------+------+--------------------------------+ | ID | Name | Status | Size | Attached to | +--------------------------------------+----------------+-----------+------+--------------------------------+ | 296c853c-c749-4eb6-857a-57ec182232a6 | vol_1 | available | 1 | |
+--------------------------------------+----------------+-----------+------+--------------------------------+ | ID | Name | Status | Size | Attached to | +--------------------------------------+----------------+-----------+------+--------------------------------+ | 296c853c-c749-4eb6-857a-57ec182232a6 | vol_1 | available | 1 | |Copy to Clipboard Copied! Toggle word wrap Toggle overflow Delete the backup if you no longer need it:
openstack volume backup delete <backup>
$ openstack volume backup delete <backup>Copy to Clipboard Copied! Toggle word wrap Toggle overflow
3.4.3. Canceling restoring a backup Copier lienLien copié sur presse-papiers!
A project administrator can cancel restoring a volume backup by changing the status of the backup to error. But you cannot cancel restoring a backup when Red Hat Ceph Storage is the back end of the backup repository.
If you cancel restoring a backup after it starts, the destination volume is useless, because there is no way of knowing how much data, if any, was actually restored.
Prerequisites
- You must be a project administrator to cancel restoring a volume backup.
- Ensure that the back end of your backup repository is not Red Hat Ceph Storage.
Procedure
-
Log in to the undercloud host as the
stackuser. Source the
stackrcundercloud credentials file:source ~/stackrc
$ source ~/stackrcCopy to Clipboard Copied! Toggle word wrap Toggle overflow List the backups to obtain the name or ID of the backup that you want to stop restoring:
openstack volume backup list
$ openstack volume backup listCopy to Clipboard Copied! Toggle word wrap Toggle overflow Change the status of this backup to
errorto cancel its restore operation:openstack volume backup set --state error <backup>
$ openstack volume backup set --state error <backup>Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<backup>with the name or ID of the volume backup that you do not want to restore.
Canceling a restore is an asynchronous action, because the back end of the backup repository must detect the change in the backup status before it cancels the restore.
-
Replace
Verification
List the volume backups to verify that the restore is canceled:
openstack volume backup list
$ openstack volume backup listCopy to Clipboard Copied! Toggle word wrap Toggle overflow When the status of the backup changes to
available, then the restore is canceled.