ec2 id mapping can be incorrect during attach volume

Bug #1145490 reported by Vish Ishaya
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Invalid
Undecided
Unassigned
Folsom
Fix Released
High
Vish Ishaya

Bug Description

Leads to a 404 when trying to attach to an instance:

2013-03-04 15:09:58 DEBUG nova.api.ec2 req-05eacb09-2823-4e1a-8795-5a07078957ac f323106c06e3464bb24f3b9a24adc993 1c1abd0ba1fa4aec932386731b974fb0 action: AttachVolume _call_ /usr/lib/python2.7/dist-packages/nova/api/ec2/_init_.py:328
2013-03-04 15:09:58 DEBUG nova.api.ec2 req-05eacb09-2823-4e1a-8795-5a07078957ac f323106c06e3464bb24f3b9a24adc993 1c1abd0ba1fa4aec932386731b974fb0 arg: InstanceId val: i-00001534 _call_ /usr/lib/python2.7/dist-packages/nova/api/ec2/_init_.py:330
2013-03-04 15:09:58 DEBUG nova.api.ec2 req-05eacb09-2823-4e1a-8795-5a07078957ac f323106c06e3464bb24f3b9a24adc993 1c1abd0ba1fa4aec932386731b974fb0 arg: VolumeId val: vol-000000d0 _call_ /usr/lib/python2.7/dist-packages/nova/api/ec2/_init_.py:330
2013-03-04 15:09:58 DEBUG nova.api.ec2 req-05eacb09-2823-4e1a-8795-5a07078957ac f323106c06e3464bb24f3b9a24adc993 1c1abd0ba1fa4aec932386731b974fb0 arg: Device val: /dev/vdc _call_ /usr/lib/python2.7/dist-packages/nova/api/ec2/_init_.py:330
2013-03-04 15:09:58 INFO nova.api.ec2 req-05eacb09-2823-4e1a-8795-5a07078957ac f323106c06e3464bb24f3b9a24adc993 1c1abd0ba1fa4aec932386731b974fb0 InstanceNotFound raised: Instance 5428 could not be found.
2013-03-04 15:09:58 ERROR nova.api.ec2 req-05eacb09-2823-4e1a-8795-5a07078957ac f323106c06e3464bb24f3b9a24adc993 1c1abd0ba1fa4aec932386731b974fb0 InstanceNotFound: Instance i-00001534 could not be found.

This is due to some code paths using the instance id from the instances table instead of the mapping table.

Changed in nova:
status: New → Invalid
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/folsom)

Reviewed: https://review.openstack.org/23485
Committed: http://github.com/openstack/nova/commit/67eb495e37f3622d68bd07997b8680049a2426d1
Submitter: Jenkins
Branch: stable/folsom

commit 67eb495e37f3622d68bd07997b8680049a2426d1
Author: MotoKen <email address hidden>
Date: Mon Nov 5 19:45:11 2012 +0800

    Decouple EC2 API from using instance id

    Continuation of 0dc32690fe158e4cb11c2c9bcc65acaf73b94a7a

    Some code in ec2 api use Instance.id rather than InstanceIdMapping.id
    directly while converting ec2 id to an instance object. This is very
    dangerous if Instance.id is not equal to InstanceIdMapping.id for the
    same instance uuid.

    To avoid the id mapping confusion, this patch:

     * uses instance_id_mappings.id instead of instances.id
     * uses instance_uuid in ec2utils.id_to_ec2_inst_id
     * removes ec2utils.ec2_instance_id_to_uuid

    Fixes bug 1145490

    Change-Id: I22638f667c18eefe542b03e31f1a3aa2ce782db7
    (cherry picked from commit 79cc2a21b645138f70c6ca4b54053f69c0dde81d)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers