Create Server Snapshot returns incorrect Image Location

Bug #1679285 reported by Monty Taylor
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Matt Riedemann

Bug Description

The createImage action for nova returns a URL to the Image created in a Location header. However, it returns one constructed from the internal glance.api_servers config values, which in clouds that have an internal and a public glance api will result in internal URLs being returned to the end user - who likely does not have routable access, given that they are internal API servers.

novaclient currently does not experience any issues since it does not treat the URL as a URL to be used, and instead pops the last element from the url, knowing it to be the image_id and it returns that to the user.

Perhaps a better option would be to add a microversion and return the image id in a json dict response so that everyone can do what nova is doing without feeling dirty about it.


* We should put in a warning to the API docs that createImage is by default a cold snapshot
* We should probably put in a note in the API docs that the Location header return value is more likely than not to be broken, and that if the cloud in question doens't have the new microversion, that the user should pop the ID off the end of the URL

Tags: api image
Matt Riedemann (mriedem)
Changed in nova:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Matt Riedemann (mriedem) wrote :

From looking at the glance API reference docs, it looks like /v1/ or /v2/ is always required in a request, so the fact that nova returns an unversioned '/images/{image_id}' URL in the location header makes me think this all predated the split of glance from nova, unless you can configure things in your cloud to alias /images to /v1/images or /v2/images but I'm not sure if anyone does that.

tags: added: api image
Revision history for this message
Matt Riedemann (mriedem) wrote :
Matt Riedemann (mriedem)
Changed in nova:
assignee: nobody → Matt Riedemann (mriedem)
Changed in nova:
status: Confirmed → In Progress
Revision history for this message
Matt Riedemann (mriedem) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Submitter: Jenkins
Branch: master

commit 66b0cf333758b5793208c2a734959aa192bbc39b
Author: Matt Riedemann <email address hidden>
Date: Thu Apr 20 16:46:24 2017 -0400

    2.45: Remove Location header from createImage and createBackup responses

    This changes the response for the createImage and createBackup
    server action APIs to no longer return a Location header and instead
    returns a json dict body with the snapshot image ID. This is done
    in a new microversion.

    Implements blueprint remove-create-image-location-header-response

    Closes-Bug: #1679285

    Change-Id: Idc899ee76b8265b1c9e0871b6c7c277424cdd442

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

This issue was fixed in the openstack/nova development milestone.

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.