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
Fix Released
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)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstacksdk (master)

Reviewed: https://review.opendev.org/c/openstack/openstacksdk/+/948584
Committed: https://opendev.org/openstack/openstacksdk/commit/ee3fae1a8dd8c2dcfd49b9b5d65e9ffd92e96db8
Submitter: "Zuul (22348)"
Branch: master

commit ee3fae1a8dd8c2dcfd49b9b5d65e9ffd92e96db8
Author: Sean Mooney <email address hidden>
Date: Wed Apr 30 20:13:46 2025 +0000

    Fix backup_server proxy and action

    Just like the create_image action, the server backup action returns the
    uuid of the created backup image. This change makes the backup action
    return the uuid and the backup_server proxy function return the glance
    image object, consistent with create_server_image.

    backup_server now also accepts optional wait and timeout keyword
    arguments to wait for the image to reach active status, mirroring the
    behaviour of create_server_image.

    The misleading legacy comment in create_image has also been replaced
    with an accurate description of the microversion 2.45 behaviour.

    Change-Id: I7a38ab30d215db28d396f4acee67c84b523dc2f8
    Signed-off-by: Sean Mooney <email address hidden>
    Assisted-By: claude-code sonnet 4.6
    Closes-Bug: #2110035

Changed in openstacksdk:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/openstacksdk 4.17.0

This issue was fixed in the openstack/openstacksdk 4.17.0 Hibiscus release.

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.