'DescribeInstances' in ec2 shows wrong image-message to instance booting from volumes

Bug #1278696 reported by wingwj
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
wingwj

Bug Description

'DescribeInstances' in ec2 shows the wrong image message('ami-00000002') to the instance booting from a volume:

n781dba539a84:~ # euca-describe-instances i-0000003a
RESERVATION r-mdcwadip c1c092e1c88f4027aeb203d50d63135b
INSTANCE i-0000003a ami-00000002 wjvm1 running None (c1c092e1c88f4027aeb203d50d63135b, n781dba57c996) 0 m1.small 2014-02-10T07:00:40.000Z nova 20.20.16.12 ebs
BLOCKDEVICE /dev/vda vol-0000000d false

More info can be found here: http://paste.openstack.org/show/64087/

--------------

The codes in ec2utils.py:

def glance_id_to_id(context, glance_id):
    """Convert a glance id to an internal (db) id."""
    if glance_id is None:
        return
    try:
        return db.s3_image_get_by_uuid(context, glance_id)['id']
    except exception.NotFound:
        return db.s3_image_create(context, glance_id)['id']

------

The image_ref (as glance_id in this function) of the instance booting from a volume, will be "", not None.
The protected codes above can't take efforts.

Tags: ec2
wingwj (wingwj)
Changed in nova:
assignee: nobody → wingwj (wingwj)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/72579

Changed in nova:
status: New → In Progress
Revision history for this message
Openstack Gerrit (openstack-gerrit) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/72579
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=f1b76971ba9f670b0ee916625318d65f18c3c4aa
Submitter: Jenkins
Branch: master

commit f1b76971ba9f670b0ee916625318d65f18c3c4aa
Author: wingwj <email address hidden>
Date: Tue Feb 11 15:53:44 2014 +0800

    DescribeInstances in ec2 shows wrong image-message

    If one instance boots from a volume,
    the value of 'image_id' by 'DescribeInstances' in ec2,
    will be a wrong number.

    The value of 'image_ref' for this type of instances, is '', not None.
    So the original protected codes can't take efforts.

    Change-Id: I8c5e1c626f2b7873e7720f3615db1ee1ec6c681a
    Closes-Bug: #1278696

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → juno-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: juno-1 → 2014.2
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.