Add validations to Compute API for block device mappings

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

Bug Description

While booting an instance with block device mappings, certain scenarios need to be
taken care of in the Compute API so that Invalid user inputs are avoided and instances do not
land up in inconsistent states.
We need to add validations in the API to ensure the request body contain correct combinations
of num_instances and block_device_mappings.

For example:
1. Boot multiple instances using a single block device mapping.
Current behavior: Only one instance boots successfully with the volume attached to it.
The other instances fail block device mapping and land up in ERROR state as the volume is "in-use".
User needs to cleanup ERROR instances.
API Response: 202 Accepted

Expected behavior: API should not allow multiple instances to boot from same volume.

2. Boot multiple instances from a list of block device mappings (snapshots or volumes):
Current behavior: Only one instance boots successfully. Only the second volume in list gets attached to the instance (first one) on vda.
The other instances fail block device mapping and land up in ERROR state as the volume is "in-use".
No 1:1 mapping between volume list and instance list
User needs to cleanup ERROR instances.
API Response: 202 Accepted
Expected behavior: API should not allow multiple instances to boot from a list of BDMs

This was discussed on the mailing list and a need for appropriate API level validations was accepted.
http://lists.openstack.org/pipermail/openstack-dev/2012-December/004149.html

Tags: ntt
Rohit Karajgi (rohitk)
Changed in nova:
assignee: nobody → Rohit Karajgi (rohitkarajgi)
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/18716

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

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

commit e34d5d9e3d416fc40f147a5914f7dceee26f5ba4
Author: Rohit Karajgi <email address hidden>
Date: Fri Dec 28 04:43:14 2012 -0800

    Add Compute API validations for block device map

    This patch adds validations to return 400 BadRequest to
    Create server(s) with block device mappings where appropriate
    and related unit tests

    Fixes bug 1094244

    Change-Id: I778d3ed4b0871561774594e950ce98b6a1ecfcb9

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