7b635086cbf4c374d73e6915636cb1e44b10b77d

The current implementation of the `_full_restore` method in the Ceph backup driver is causing restoration to fail when restoring to another volume type. This is because the method generates an incorrect image name in the Ceph pool, resulting in the error message: ``` rbd.ImageNotFound: [errno 2] error opening image b'volume-a91c11af-1147-4ac7-a5ce-61676736e076.backup.base' at snapshot None. ``` Originally, the format `volume-<vol-uuid>.backup-<backup-uuid>` was used for every backup created on the Ceph pool. However, after the change introduced in commit Ia08c252d747148e624f8d9e8b0e43f94773421e0, the base name format was altered to volume-<uuid>.backup.base when creating backups from Cinder snapshots. This patch modifies the current if statement in _full_restore() to check for the presence of a snapshot_id attribute in the backup. If the attribute exists, the old base name format is used; otherwise, the new format is applied. The if block statement in _full_restore() should now match the format generated by the _full_backup() method. Additionally, src_snap is activated when the destination volume is RBD or if the backup is incremental. Currently, the Ceph backup driver only supports incremental RBD backups, so incremental backups from non-RBD volumes are not permitted. NOTE: This patch primarily mirrors the modifications in Ia08c252d747148e624f8d9e8b0e43f94773421e0, addressing it as a partial bug fix. There's a consequential patch that further strengthens the backup restore operations, which should be considered to fully resolve the bug. These two should be squashed and backported together for optimal implementation. Partial-Bug: #1895035 Change-Id: Iff8e1e90ab3c7b519819577ec3aafff838e6934f
OpenStack Cinder
OpenStack Cinder is a storage service for an open cloud computing service.
You can learn more about Cinder at:
Getting Started
If you'd like to run from the master branch, you can clone the git repo:
git clone https://opendev.org/openstack/cinder
If you'd like to contribute, please see the information in CONTRIBUTING.rst
You can raise bugs on Launchpad
Python client
Description
Languages
Python
99.7%
Smarty
0.3%