Problem description: Creating multiple full backups of the same snapshot fails.
Version: Zed (master)
How reproducible: Always
Steps to Reproduce:
- Boot an instance from a volume
- Snapshot the instance: openstack volume snapshot create <vol-id> --force
- First full Backup: openstack volume backup create <vol-id> --snapshot <snap-id>
- Second full Backup: openstack volume backup create <vol-id> --snapshot <snap-id>
Actual results:
Creating a full backup from a snapshot would create a backup base image like 'volume-.backup.base'. This is a problem for Cinder because it creates the same base name for different full backups[1].
rbd.ImageExists: [errno 17] RBD image already exists (error creating image).
[1] https://opendev.org/openstack/cinder/src/branch/master/cinder/backup/drivers/ceph.py#L866
Expected results: Full backup created successfully
Additional info: c-bak logs
cinder-backup[1609127]: ERROR oslo_messaging.rpc.server Traceback (most recent call last): [13/1836]
cinder-backup[1609127]: ERROR oslo_messaging.rpc.server File "/opt/stack/cinder/cinder/backup/manager.py", line 491, in continue_backup
cinder-backup[1609127]: ERROR oslo_messaging.rpc.server updates = backup_service.backup(backup,
cinder-backup[1609127]: ERROR oslo_messaging.rpc.server File "/opt/stack/cinder/cinder/backup/drivers/ceph.py", line 1082, in backup
cinder-backup[1609127]: ERROR oslo_messaging.rpc.server self._full_backup(backup, volume_file, volume.name, length)
cinder-backup[1609127]: ERROR oslo_messaging.rpc.server File "/opt/stack/cinder/cinder/backup/drivers/ceph.py", line 909, in _full_backup
cinder-backup[1609127]: ERROR oslo_messaging.rpc.server eventlet.tpool.Proxy(self.rbd.RBD()).create(
cinder-backup[1609127]: ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.8/dist-packages/eventlet/tpool.py", line 193, in doit
cinder-backup[1609127]: ERROR oslo_messaging.rpc.server result = proxy_call(self._autowrap, f, *args, **kwargs)
cinder-backup[1609127]: ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.8/dist-packages/eventlet/tpool.py", line 151, in proxy_call
cinder-backup[1609127]: ERROR oslo_messaging.rpc.server rv = execute(f, *args, **kwargs)
cinder-backup[1609127]: ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.8/dist-packages/eventlet/tpool.py", line 132, in execute
cinder-backup[1609127]: ERROR oslo_messaging.rpc.server six.reraise(c, e, tb)
cinder-backup[1609127]: ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.8/dist-packages/six.py", line 719, in reraise
cinder-backup[1609127]: ERROR oslo_messaging.rpc.server raise value
cinder-backup[1609127]: ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.8/dist-packages/eventlet/tpool.py", line 86, in tworker
cinder-backup[1609127]: ERROR oslo_messaging.rpc.server rv = meth(*args, **kwargs)
cinder-backup[1609127]: ERROR oslo_messaging.rpc.server File "rbd.pyx", line 629, in rbd.RBD.create
cinder-backup[1609127]: ERROR oslo_messaging.rpc.server rbd.ImageExists: [errno 17] RBD image already exists (error creating image)
cinder-backup[1609127]: ERROR oslo_messaging.rpc.server
cinder-backup[1609127]: ERROR oslo_messaging.rpc.server During handling of the above exception, another exception occurred:
cinder-backup[1609127]: ERROR oslo_messaging.rpc.server
cinder-backup[1609127]: ERROR oslo_messaging.rpc.server Traceback (most recent call last):
cinder-backup[1609127]: ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.8/dist-packages/oslo_messaging/rpc/server.py", line 165, in _process_incomi
ng
cinder-backup[1609127]: ERROR oslo_messaging.rpc.server res = self.dispatcher.dispatch(message)
cinder-backup[1609127]: ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.8/dist-packages/oslo_messaging/rpc/dispatcher.py", line 309, in dispatch
cinder-backup[1609127]: ERROR oslo_messaging.rpc.server return self._do_dispatch(endpoint, method, ctxt, args)
cinder-backup[1609127]: ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.8/dist-packages/oslo_messaging/rpc/dispatcher.py", line 229, in _do_dispatc
h
cinder-backup[1609127]: ERROR oslo_messaging.rpc.server result = func(ctxt, **new_args)
cinder-backup[1609127]: ERROR oslo_messaging.rpc.server File "/opt/stack/cinder/cinder/backup/manager.py", line 525, in continue_backup
cinder-backup[1609127]: ERROR oslo_messaging.rpc.server volume_utils.update_backup_error(backup, str(err))
cinder-backup[1609127]: ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.8/dist-packages/oslo_utils/excutils.py", line 227, in __exit__
cinder-backup[1609127]: ERROR oslo_messaging.rpc.server self.force_reraise()
cinder-backup[1609127]: ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.8/dist-packages/oslo_utils/excutils.py", line 200, in force_reraise
cinder-backup[1609127]: ERROR oslo_messaging.rpc.server raise self.value
cinder-backup[1609127]: ERROR oslo_messaging.rpc.server File "/opt/stack/cinder/cinder/backup/manager.py", line 497, in continue_backup
cinder-backup[1609127]: ERROR oslo_messaging.rpc.server self.message_api.create_from_request_context(
cinder-backup[1609127]: ERROR oslo_messaging.rpc.server File "/opt/stack/cinder/cinder/message/api.py", line 140, in create_from_request_context
cinder-backup[1609127]: ERROR oslo_messaging.rpc.server self.create(context=context,
cinder-backup[1609127]: ERROR oslo_messaging.rpc.server File "/opt/stack/cinder/cinder/message/api.py", line 104, in create
cinder-backup[1609127]: ERROR oslo_messaging.rpc.server action[0],
cinder-backup[1609127]: ERROR oslo_messaging.rpc.server TypeError: 'NoneType' object is not subscriptable
cinder-backup[1609127]: ERROR oslo_messaging.rpc.server
Permanent link https:/ /opendev. org/openstack/ cinder/ src/commit/ 3e068b5ce0990a/ cinder/ backup/ drivers/ ceph.py# L866-L867