Skip to content

fix: handle Nova create image response for microversion 2.45 and above#3543

Merged
mandre merged 1 commit intogophercloud:mainfrom
ycalansy:nova-create-image-microversion-aware-id-extraction
Nov 17, 2025
Merged

fix: handle Nova create image response for microversion 2.45 and above#3543
mandre merged 1 commit intogophercloud:mainfrom
ycalansy:nova-create-image-microversion-aware-id-extraction

Conversation

@ycalansy
Copy link
Copy Markdown
Contributor

Description

This change addresses an issue where the Nova CreateImage API response was not handled correctly for microversion 2.45 and above.

Prior to microversion 2.45, the image ID was extracted from the Location header. Starting with 2.45, Nova no longer includes the Location header. Instead, the image ID is returned in the response body as a small JSON object. (see API reference)

The CreateImage function has been updated to:

  • Read and store the response body in CreateImageResult.
  • Extract the image ID based on the X-OpenStack-Nova-API-Version header:
    • For microversions prior to 2.45, extract from the Location header.
    • For microversion 2.45 and above, extract from the response body.

This fix resolves the issue where the image ID was previously empty for Nova 2.45+, while maintaining compatibility with older microversions.

Fixes #3542

Since microversion 2.45, the Location header is removed from the create image
response. The image ID is now returned in the response body as JSON.

CreateImage now reads the response body and stores it in CreateImageResult.
The image ID extraction checks X-OpenStack-Nova-API-Version to determine
whether to extract the ID from the Location header (< 2.45) or the response
body (>= 2.45).
@github-actions github-actions bot added edit:compute This PR updates compute code semver:patch No API change backport-v2 This PR will be backported to v2 labels Oct 28, 2025
@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 63.844% (+0.02%) from 63.823%
when pulling 398a995 on ycalansy:nova-create-image-microversion-aware-id-extraction
into 1b200e1 on gophercloud:main.

Copy link
Copy Markdown
Contributor

@stephenfin stephenfin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per @mandre's comment

@mandre mandre enabled auto-merge November 17, 2025 12:53
@mandre mandre added this pull request to the merge queue Nov 17, 2025
Merged via the queue into gophercloud:main with commit a72481d Nov 17, 2025
80 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-v2 This PR will be backported to v2 edit:compute This PR updates compute code semver:patch No API change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CreateImage returns empty image ID for Nova microversion 2.45+

4 participants