Can not set volume attributes at instance launch by EC2 API

Bug #1370250 reported by Feodor Tersin
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Nikola Đipanov
ec2-api
Fix Released
Undecided
Unassigned

Bug Description

AWS allows to change block device attributes (such as volume size, delete on termination behavior, existence) at instance launch.

For example, image xxx has devices:
vda, size 10, delete on termination
vdb, size 100, delete on termination
vdc, size 100, delete on termination
We can run an instance by
euca-run-instances ... xxx -b /dev/vda=:20 -b /dev/vdb=::false -b /dev/vdc=none
to get the instance with devices:
vda, size 20, delete on termination
vdb, size 100, not delete on termination

For Nova we get now:
$ euca-run-instances --instance-type m1.nano -b /dev/vda=::true ami-0000000a
euca-run-instances: error (InvalidBDMFormat): Block Device Mapping is Invalid: Unrecognized legacy format.

Tags: ec2
Sean Dague (sdague)
tags: added: ec2
Changed in nova:
status: New → Confirmed
importance: Undecided → Medium
Changed in ec2-api:
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to nova (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/190323

Changed in nova:
assignee: nobody → Nikola Đipanov (ndipanov)
status: Confirmed → In Progress
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/190324

Revision history for this message
Nikola Đipanov (ndipanov) wrote :

NB: the above only makes the fix possible if done on the EC2 API layer, as Nova would override the whole device instead of just some selected fields like EC2 (see the commit message for more details).

Changed in nova:
status: In Progress → Won't Fix
Revision history for this message
Nikola Đipanov (ndipanov) wrote :

Not sure why this was moved to "won't fix" the fix is up and has a +2. Moving back

Changed in nova:
status: Won't Fix → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

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

commit 4bd8a4bd8e7651aae115a50d237f909fdc0f3389
Author: Nikola Dipanov <email address hidden>
Date: Wed Jun 10 17:26:24 2015 +0100

    Fix overloading of block device on boot by device name

    Currently it is not possible to override an existing image block device
    by supplying the device with the same name at boot (see also
    Ib1ba130042aabbbe7bb8d60fc212c66e446c1d73). Even though we want to
    discourage usage of device names as much as possible in the Nova API (as
    not all hypervisors can honour them), EC2 API requires that this is possible.

    While we want to make sure we document that supplying device names at
    boot is only really desirable if you want to override some of the ones
    contained in the image, introducing a different labeling system just so
    that we don't use the device names seems like an overkill for a feature
    that does not seem to be very used.

    This patch adds a method that will do this deterministically when
    compiling all the block device information for the request.

    It is also worth noting that The EC2 API allows only subset of block
    device attributes to be overridden in this way (see [1]). This limitation
    did not exist previously in Nova, and there seems to be no reason why we
    would need that complexity, so it would be up to the EC2 compatibility
    code to deal with this.

    [1] https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html#Using_OverridingAMIBDM

    Doc-Impact
    Closes-bug: #1370250

    Change-Id: I60ecdcae81ff5dec34f0fa0a39e0739759a6fa59

Changed in nova:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to ec2-api (master)

Reviewed: https://review.openstack.org/199172
Committed: https://git.openstack.org/cgit/stackforge/ec2-api/commit/?id=92355bf4d98b22c00eebc56f5cdb045d5da6be05
Submitter: Jenkins
Branch: master

commit 92355bf4d98b22c00eebc56f5cdb045d5da6be05
Author: Feodor Tersin <email address hidden>
Date: Tue Jul 7 18:59:09 2015 +0300

    Enable functional tests on bdm modification at instance launch

    Since LP #1370250 is fixed by
    https://review.openstack.org/#/c/190324/

    Related-Bug: #1370250
    Depends-On: Ifb9c215527cd84a60f21ab73fee672928b604300
    Depends-On: I60ecdcae81ff5dec34f0fa0a39e0739759a6fa59
    Change-Id: I9117cb596ab626c8b664d9be581b7a4da1fc2f9c

Feodor Tersin (ftersin)
Changed in ec2-api:
status: Confirmed → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → liberty-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: liberty-3 → 12.0.0
Changed in ec2-api:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers