Using: OpenStack Yoga
Some of our volumes got backups in state "creating" for a unusual time and did not change. In that case we try to delete this backup by hand (openstack client). To do this, the backup state need to be in state "available" or "error". It is not possible to change the state for a backup in "creating" state with openstack client.
For that reason we restart the cinder-backup service on that host which is responsible for that backup.
What was expected: The cinder backup manager checks during its init phase backups related to that host for there state. If a backup is in state "creating"[1] a cleanup starts and set the state to "error". This behaviour works for backups with existing volumes.
Bug:
If the volume of that backup in state "creating" is deleted the cleanup as described above is throwing a VolumeNotFound exception.
INFO oslo_service.service [req-392f55c2-b353-41cd-a54e-865d64130f62 - - - - -] Starting 1 workers
NFO cinder.service [-] Starting cinder-backup node (version 20.1.0)
INFO cinder.backup.manager [req-1f53cac1-07c4-4ae4-a983-d4f6654b5618 - - - - -] Cleaning up incomplete backup operations.
INFO cinder.backup.manager [req-1f53cac1-07c4-4ae4-a983-d4f6654b5618 - - - - -] Resetting backup 20e6c872-b308-4635-b67b-d3f4aacc2c56 to error (was creating).
ERROR cinder.backup.manager [req-1f53cac1-07c4-4ae4-a983-d4f6654b5618 - - - - -] Problem cleaning up backup 20e6c872-b308-4635-b67b-d3f4aacc2c56.: cinder.exception.VolumeNotFound: Volume eb0c0145-db93-4258-b549-f1963e9cf205 could not be found.
cinder.backup.manager Traceback (most recent call last):
cinder.backup.manager File "/usr/lib/python3/dist-packages/cinder/backup/manager.py", line 202, in _cleanup_incomplete_backup_operations
cinder.backup.manager self._cleanup_one_backup(ctxt, backup)
ERROR cinder.backup.manager File "/usr/lib/python3/dist-packages/cinder/backup/manager.py", line 235, in _cleanup_one_backup
ERROR cinder.backup.manager volume = objects.Volume.get_by_id(ctxt, backup.volume_id)
ERROR cinder.backup.manager File "/usr/lib/python3/dist-packages/cinder/objects/base.py", line 339, in get_by_id
ERROR cinder.backup.manager orm_obj = db.get_by_id(context, cls.model, id, *args, **kwargs)
ERROR cinder.backup.manager File "/usr/lib/python3/dist-packages/cinder/db/api.py", line 109, in get_by_id
ERROR cinder.backup.manager return IMPL.get_by_id(context, model, id, *args, **kwargs)
ERROR cinder.backup.manager File "/usr/lib/python3/dist-packages/cinder/db/sqlalchemy/api.py", line 187, in wrapper
ERROR cinder.backup.manager return f(*args, **kwargs)
ERROR cinder.backup.manager File "/usr/lib/python3/dist-packages/cinder/db/sqlalchemy/api.py", line 427, in get_by_id
ERROR cinder.backup.manager return _GET_METHODS[model](context, id, *args, **kwargs)
ERROR cinder.backup.manager File "/usr/lib/python3/dist-packages/cinder/db/sqlalchemy/api.py", line 187, in wrapper
ERROR cinder.backup.manager return f(*args, **kwargs)
ERROR cinder.backup.manager File "/usr/lib/python3/dist-packages/cinder/db/sqlalchemy/api.py", line 2367, in volume_get
ERROR cinder.backup.manager return _volume_get(context, volume_id)
ERROR cinder.backup.manager File "/usr/lib/python3/dist-packages/cinder/db/sqlalchemy/api.py", line 187, in wrapper
ERROR cinder.backup.manager return f(*args, **kwargs)
ERROR cinder.backup.manager File "/usr/lib/python3/dist-packages/cinder/db/sqlalchemy/api.py", line 2126, in _volume_get
ERROR cinder.backup.manager raise exception.VolumeNotFound(volume_id=volume_id)
ERROR cinder.backup.manager cinder.exception.VolumeNotFound: Volume eb0c0145-db93-4258-b549-f1963e9cf205 could not be found.
---
[1]: https://github.com/openstack/cinder/blob/78fac2960d28e97f42454bb5f385b46fbae23a3c/cinder/backup/manager.py#L230
Hey Waldemar,
I hope you're doing great! 😊 I saw your bug report and it seems like you're dealing with two issues related to the backup service. Let me know if I got this right:
To help you out, I need some extra info from you:
Which Cinder backup driver are you using?
1) After restarting the service, do the backups stay in the creating state or change? Have you tried resetting the db backup status manually like this: `cinder backup-restore <backup-uuid> --state error`? Just a heads up, this will update the backup's state on the db, letting you remove it, but you'll lose the backup data. /docs.openstack .org/python- cinderclient/ latest/ cli/details. html#cinder- backup- reset-state
For more on resetting backup state, check this out: https:/
2) You want the backup service to detect failing backups and switch them to an error state:
Thing is, there should already be some code that does this. So, just let me know which backup driver you're using, and we'll figure it out together.
Looking forward to your reply!