Cannot create a volume from a backup

Bug #2025277 reported by Gorka Eguileor
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Triaged
High
Pete Zaitcev

Bug Description

Trying to create a volume from a backup fails miserably.

Command run is:

  openstack --os-volume-api-version 3.47 volume create --backup backup restored

The error in volume service is:

           |__Flow 'volume_create_manager': TypeError: restore_backup() missing 1 required positional argument: 'volume_is_new'
2023-06-28 16:18:38.158 654574 ERROR cinder.volume.manager Traceback (most recent call last):
2023-06-28 16:18:38.158 654574 ERROR cinder.volume.manager File "/usr/lib/python3.9/site-packages/cinder/volume/flows/manager/create_volume.py", line 1150, in _create_from_backup
2023-06-28 16:18:38.158 654574 ERROR cinder.volume.manager ret = self.driver.create_volume_from_backup(volume, backup)
2023-06-28 16:18:38.158 654574 ERROR cinder.volume.manager File "/usr/lib/python3.9/site-packages/cinder/volume/driver.py", line 1957, in create_volume_from_backup
2023-06-28 16:18:38.158 654574 ERROR cinder.volume.manager raise NotImplementedError()
2023-06-28 16:18:38.158 654574 ERROR cinder.volume.manager NotImplementedError
2023-06-28 16:18:38.158 654574 ERROR cinder.volume.manager
2023-06-28 16:18:38.158 654574 ERROR cinder.volume.manager During handling of the above exception, another exception occurred:
2023-06-28 16:18:38.158 654574 ERROR cinder.volume.manager
2023-06-28 16:18:38.158 654574 ERROR cinder.volume.manager Traceback (most recent call last):
2023-06-28 16:18:38.158 654574 ERROR cinder.volume.manager File "/usr/lib/python3.9/site-packages/taskflow/engines/action_engine/executor.py", line 52, in _execute_task
2023-06-28 16:18:38.158 654574 ERROR cinder.volume.manager result = task.execute(**arguments)
2023-06-28 16:18:38.158 654574 ERROR cinder.volume.manager File "/usr/lib/python3.9/site-packages/cinder/volume/flows/manager/create_volume.py", line 1241, in execute
2023-06-28 16:18:38.158 654574 ERROR cinder.volume.manager model_update, need_update_volume = self._create_from_backup(
2023-06-28 16:18:38.158 654574 ERROR cinder.volume.manager File "/usr/lib/python3.9/site-packages/cinder/volume/flows/manager/create_volume.py", line 1174, in _create_from_backup
2023-06-28 16:18:38.158 654574 ERROR cinder.volume.manager backuprpcapi.restore_backup(context, backup.host, backup,
2023-06-28 16:18:38.158 654574 ERROR cinder.volume.manager TypeError: restore_backup() missing 1 required positional argument: 'volume_is_new'

This happens because `_create_from_backup` method we have this call:
            backuprpcapi.restore_backup(context, backup.host, backup,
                                        volume.id)

Yet the signature of that method is:
    def restore_backup(self, ctxt, backup_host, backup, volume_id,
                       volume_is_new):

Which requires parameter `volume_is_new` to always be provided.

Tags: api
Revision history for this message
Gorka Eguileor (gorka) wrote :

And the backup is left is "restoring" state :-(

A workaround would be using the cinder backup-restore command that uses a different code path.

Changed in cinder:
importance: Undecided → High
tags: added: api osc
Eric Harney (eharney)
tags: removed: osc
Pete Zaitcev (zaitcev)
Changed in cinder:
assignee: nobody → Pete Zaitcev (zaitcev)
Changed in cinder:
status: New → Triaged
Revision history for this message
Pete Zaitcev (zaitcev) wrote :
Revision history for this message
Pete Zaitcev (zaitcev) wrote :

The original bug, a fix for which caused this regression, is:
https://bugs.launchpad.net/cinder/+bug/2007615

This fix will need to be backported to 2023.1 once this lands on the trunk.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/cinder 22.1.1

This issue was fixed in the openstack/cinder 22.1.1 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/cinder 23.0.0.0rc1

This issue was fixed in the openstack/cinder 23.0.0.0rc1 release candidate.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.