the nova server backup api returns the image uuid of the backup image but the sdk does not

Bug #2110035 reported by sean mooney
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
openstacksdk
In Progress
Undecided
sean mooney
python-openstackclient
In Progress
Undecided
sean mooney

Bug Description

https://docs.openstack.org/api-ref/compute/#id58

currently the sdk does not return the uuid of the created image return by nova.

https://github.com/openstack/openstacksdk/blob/df1b9e4f8ca877a7caddcbb9afc66de225a8dd21/openstack/compute/v2/server.py#L635-L655

as a result the backup_server proxy api also does not return teh imag or uuid

https://github.com/openstack/openstacksdk/blob/master/openstack/compute/v2/_proxy.py#L997-L1011

which forces the openstack client to try and look up the created image by name.

this forces the openstack client to try and lookup the image by name

https://github.com/openstack/python-openstackclient/blob/master/openstackclient/compute/v2/server_backup.py#L102

which works exactly once.

the semantics of the server backup api is that you invoke it every time you want to create a backup with the same name so that nova can find the related backup images and delete them when rotation is enabeld.

the current logic in the openstack client calls find_image with the backup_name and expect to find exactly 1 image

https://github.com/openstack/python-openstackclient/blob/a49a290a2bbd6d090c186bfecbfa97d168e019b8/openstackclient/compute/v2/server_backup.py#L102

this will work the first time a backup is created and fail with a multiple images exist error on all future invocations.

The way to fix this is too modify the sdk to retrun the image uuid form backup, and the image object from
backup_server, exactly like create_image and create_server_image respectively.

https://github.com/openstack/openstacksdk/blob/df1b9e4f8ca877a7caddcbb9afc66de225a8dd21/openstack/compute/v2/server.py#L508
https://github.com/openstack/openstacksdk/blob/df1b9e4f8ca877a7caddcbb9afc66de225a8dd21/openstack/compute/v2/_proxy.py#L971

then update the client to use the returned image instead of looking it up.

Changed in openstacksdk:
status: New → In Progress
assignee: nobody → sean mooney (sean-k-mooney)
Changed in python-openstackclient:
status: New → In Progress
assignee: nobody → sean mooney (sean-k-mooney)
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.