OS API v1.1 'Cannot find requested image' errors when creating instance

Bug #882658 reported by Dan Prince
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Critical
Brian Waldon

Bug Description

Using nova 78025e8 or later with the most recent glance commit ceab6b3 (image ids --> image refs).

I'm getting the following failures when trying to use the OSAPI to create an instance:

REQUEST: POST => /v1.1/admin/servers
{"server":{"imageRef":"a07f08e5-025b-4c8c-8624-f2a60fcdc640","flavorRef":2,"personality":[{"contents":"c3NoLXJzYSBBQUFBQjNOemFDMXljMkVBQUFBREFRQUJBQUFCQVFETVBZdW5Y\nemtEbkRyblVTNlkvbUZveS9BQjh6dnJ0TlRJOUZpUzBOaHdPdTk2aHBYNDFh\nY3FGZTI1V0w1WlNkQ2Vpa0puVFFoY1p6WjN6NzY2djR6RmdMeE1YdjlWZk5U\nR2NRU0dkZFNTVDhiTTByRVZPR0VXS0xRa3ZZWEJSZ0V0eE5oa2xlNFBlRk5X\ndHRTSmdZTkRoazJobk5XNVpUQnozUjM2cFlsRzRoeVpqK2U2OUpraUprblpl\nWTVvSzRCNUVxeW5TOExZODdhbFc1UjNaV21xQ0IzOC8vNnFWRjhVVDJMTzk5\nYUZZczRzVTFQWkpBeVllVU9uUFBLTG5SMitsQWp1ekFJVjNrMGdPWkZQNkdX\nYllGOUNtUVNvSDJTZkhNaVpNMS94VSt1Skg0NEVrS0M0eG5EODgxZmozYnJr\neXBDVWxPRGxGSEUzZnAxeFpDemIgcm9vdEBub3ZhMQo=\n","path":"/root/.ssh/authorized_keys"}],"name":"test1","key_name":"test","metadata":{"key1":"value1","key2":"value2"}}}

RESPONSE: {"badRequest": {"message": "Cannot find requested image a07f08e5-025b-4c8c-8624-f2a60fcdc640: Invalid image href a07f08e5-025b-4c8c-8624-f2a60fcdc640.", "code": 400}}

Dan Prince (dan-prince)
Changed in nova:
status: New → In Progress
importance: Undecided → Critical
assignee: nobody → Dan Prince (dan-prince)
Revision history for this message
Brian Waldon (bcwaldon) wrote :

Please deploy this code to nova and tell me if you can still reproduce the bug: https://review.openstack.org/#change,988

Revision history for this message
Dan Prince (dan-prince) wrote :

In order to boot instances with the OSAPI I need just this change in image/glance.py:

+++ b/nova/image/glance.py
@@ -54,7 +54,7 @@ def _parse_image_ref(image_href):
     o = urlparse(image_href)
     port = o.port or 80
     host = o.netloc.split(':', 1)[0]
- image_id = int(o.path.split('/')[-1])
+ image_id = o.path.split('/')[-1]
     return (image_id, host, port)

Revision history for this message
Dan Prince (dan-prince) wrote :

Waldon. Looking at the S3 branch again now. I looked at that a week ago and didn't realize it encompassed the change needed for the OSAPI as well.

Revision history for this message
Dan Prince (dan-prince) wrote :

Okay. I pushed an isolated fix for the glance href issue here:

https://review.openstack.org/#change,1140

This resolves my issue booting instances w/ the OSAPI. My preference would be to fix that first and then look at the S3 issues separately.

Revision history for this message
Dan Prince (dan-prince) wrote :

Sounds like we have a bit of a standoff on this one. Removing myself as the assignee.

Changed in nova:
assignee: Dan Prince (dan-prince) → nobody
Revision history for this message
Openstack Gerrit (openstack-gerrit) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/988
Committed: http://github.com/openstack/nova/commit/c13e7f79e52325792a130a578a74a170c01dc747
Submitter: Jenkins
Branch: master

 status fixcommitted
 done

commit c13e7f79e52325792a130a578a74a170c01dc747
Author: Brian Waldon <email address hidden>
Date: Wed Oct 19 15:02:48 2011 -0400

    Creating uuid -> id mapping for S3 Image Service

    This creates a mapping of Glance uuids to preserve the
    EC2-specific image id format. This adds a lazily generated
    mapping layer that is stored in the database.

    This also fixes bug 882658

    Change-Id: I64bf6c7297b97f206b967781a28791aa3874ca81

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → essex-1
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Mark McLoughlin (markmc)
Changed in nova:
assignee: nobody → Brian Waldon (bcwaldon)
Thierry Carrez (ttx)
Changed in nova:
milestone: essex-1 → 2012.1
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.