backup unable to retrieve based on backup name

Bug #1407805 reported by Steve Martinelli
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-openstackclient
Invalid
Undecided
Zhiyuan Cai

Bug Description

I backed up a volume to a swift container, the backups name was myBack
(.venv)steve:python-openstackclient$ openstack backup create vol1 --name myBack
+-------+--------------------------------------+
| Field | Value |
+-------+--------------------------------------+
| id | fbffeb59-0f6e-40ba-9d37-dbb9ffe62a79 |
| name | myBack |
+-------+--------------------------------------+

Trying to use names for the backup to be restored will result in an error:
(.venv)steve:python-openstackclient$ openstack backup restore myBack vol1
ERROR: openstack list() got an unexpected keyword argument 'search_opts'

(.venv)steve:python-openstackclient$ openstack backup restore fbffeb59-0f6e-40ba-9d37-dbb9ffe62a79 vol1
seems to work

Volume list for reference:
(.venv)steve:python-openstackclient$ openstack volume list
+--------------------------------------+--------------+-----------+------+-------------+
| ID | Display Name | Status | Size | Attached to |
+--------------------------------------+--------------+-----------+------+-------------+
| 2be140f6-95c7-46c2-b055-c13776595d17 | vol1 | available | 1 | |
+--------------------------------------+--------------+-----------+------+-------------+

code block that is likely failing:
https://github.com/openstack/python-openstackclient/blob/master/openstackclient/volume/v1/backup.py#L139-L147
backup = utils.find_resource(volume_client.backups, parsed_args.backup)

Probably since name is not a required arg for backup, then the client manager for backups doesn't use name in a GET request, looks like the utils.find_resource function tries that and then tries a list with search filters, but that fails too.

Changed in python-openstackclient:
assignee: nobody → Zhiyuan Cai (luckyvega-g)
Revision history for this message
Zhiyuan Cai (luckyvega-g) wrote :

I tried but restoring a backup with its name worked fine.

openstack@Openstack-Vega:~/Vega/devstack$ openstack backup create vol --name myBack
+-------+--------------------------------------+
| Field | Value |
+-------+--------------------------------------+
| id | cdaba81b-bf3a-4b93-9a5c-8dc444a281c5 |
| name | myBack |
+-------+--------------------------------------+

openstack@Openstack-Vega:~/Vega/devstack$ openstack backup restore myBack vol

openstack@Openstack-Vega:~/Vega/devstack$ openstack volume list
+--------------------------------------+--------------+------------------+------+----------+
| ID | Display Name | Status | Size | Attached |
+--------------------------------------+--------------+------------------+------+----------+
| 89109fb6-879c-47b4-9d61-3ff2a9e325eb | vol | restoring-backup | 1 | |
+--------------------------------------+--------------+------------------+------+----------+

After the restoring process:
openstack@Openstack-Vega:~/Vega/devstack$ openstack volume list
+--------------------------------------+--------------+-----------+------+----------+
| ID | Display Name | Status | Size | Attached |
+--------------------------------------+--------------+-----------+------+----------+
| 89109fb6-879c-47b4-9d61-3ff2a9e325eb | vol | available | 1 | |
+--------------------------------------+--------------+-----------+------+----------+

Revision history for this message
Steve Martinelli (stevemar) wrote :

Hmm, that's funny, I wonder what the differences are.

Are you using devstack? Did you enable cinder's backup service by enabled c-bak service? I was using cinder v1 APIs.

Revision history for this message
Zhiyuan Cai (luckyvega-g) wrote :

Yes, I am using devstack. Cinder's backup service and Swift service are enabled. Are you using the latest cinder client? I think you met this bug[1] and it's fixed by this patch[2].

[1] https://bugs.launchpad.net/python-cinderclient/+bug/1282324
[2] https://review.openstack.org/#/c/74880

Revision history for this message
Steve Martinelli (stevemar) wrote :

Ah yes, i think you are right, let me update and get back to you, but it looks like the issue you mention

Revision history for this message
Steve Martinelli (stevemar) wrote :

confirmed, it was the cinder client issue, i was using the lib from pypi and not from git.

Changed in python-openstackclient:
status: New → Invalid
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.