Boot From Volume

Registered by Adam Johnson on 2011-03-11


VMs should be able to boot from a volume. This requires the volume API in the OS API.

Blueprint information

Vish Ishaya
Isaku Yamahata
Series goal:
Accepted for diablo
Milestone target:
milestone icon 2011.3
Started by
Thierry Carrez on 2011-05-18
Completed by
Thierry Carrez on 2011-08-09


First appeared in diablo-4

Sure it does, and the basic implementation is available, so we can start the discussion right away :)
Vish, could you please guide me how to discuss extending openstack API?
It's just basically adding volume parameter to the servers API, and doesn't break existing at all.
-- Yoshi
I foresee that discussion on openstack native API is necessary and people would start
the discussion after seeing the first implementation of native api which will be done by D-2.
I suppose you have your ideas, others might have different ones.
So I expect the first native api implementation comes with D-2, but
the completion of native api will be by D-3.
Makes sense?
I guess openstack native can be done by D-2 (2011-06-30).
Are you seeing any blocking that should be delayed to D-3? > yamahata
-- Yoshi
I think that targetting to diablo-2 is quite feasible with ec2 api assuming snapshot/clone.
openstack native api needs consideration. Maybe D-3 milestone?
I'd like to get this in fairly early in diablo. I'm targetting to milestone 2 for this feature. Let me know if you think that is too soon. --vish

Discussion will happen in the following session:

I'd like to start the discussion on this feature as I finished COP implementation.
VM can boot with volume partition instead of snapshot because currently the snapshot
feature isn't supported yet.

 euca-run-instances ami-XXXX -k mykey -t m1.tiny -b/dev/vdb=vol-00000003::false

The branch I linked, lp:~yamahata/nova/boot-from-volume, implements EBS boot experimentally.
It requires latest euca2ools, latest boto which requires python 2.7 or later and the following patch.

=== modified file 'euca2ools/commands/'
--- euca2ools/commands/ 2011-04-11 13:23:49 +0000
+++ euca2ools/commands/ 2011-04-16 02:11:12 +0000
@@ -571,19 +571,23 @@
         return file_path

     def parse_block_device_args(self, block_device_maps_args):
- block_device_map = BlockDeviceMapping()
+ block_device_map = boto.ec2.blockdevicemapping.BlockDeviceMapping()
         for block_device_map_arg in block_device_maps_args:
             parts = block_device_map_arg.split('=')
             if len(parts) > 1:
                 device_name = parts[0]
- block_dev_type = BlockDeviceType()
+ block_dev_type = boto.ec2.blockdevicemapping.BlockDeviceType()
                 value_parts = parts[1].split(':')
                 if value_parts[0].startswith('snap'):
                     block_dev_type.snapshot_id = value_parts[0]
+ elif value_parts[0].startswith('vol-'):
+ # openstack doesn't support volume snapshot at the moment
+ # So use volume for now instead of snapshot
+ block_dev_type.snapshot_id = value_parts[0]
                     if value_parts[0].startswith('ephemeral'):
                         block_dev_type.ephemeral_name = value_parts[0]
- if len(value_parts) > 1:
+ if len(value_parts) > 1 and value_parts[1] != '':
                     block_dev_type.size = int(value_parts[1])
                 if len(value_parts) > 2:
                     if value_parts[2] == 'true':

From branch lp:~tamura-yoshiaki/nova/boot-from-volume, send command with curl like below.

curl -D - -H X-Auth-Key:your-key -H X-Auth-Token:your-token -H X-Auth-User:yoshi -H "Content-Type: application/json" -X POST -d '{"server": {"name":"yoshi", "imageRef":"6", "flavorRef": "http://localhost:8774/v1.1/flavors/1", "volume": {"id":"7", "mountpoint":"/dev/vda"}}}' http://localhost:8774/v1.1/servers

memor on the merge
- resolve the assumption that only single volume is attached
- cd boot stuff
- eliminate EC2 bias

Gerrit topic:,topic:boot-from-volume,n,z

Addressed by:
    compute: improve exceptions related to disk size checks

Addressed by:
    Don't check flavor disk attributes when booting from volume

Addressed by:
    Use original image size in volume image metadata

Addressed by:
    Don't check flavor disk size when booting from volume


Work Items

Dependency tree

* Blueprints in grey have been implemented.