[Openstack] booting from volume

Isaku Yamahata yamahata at valinux.co.jp
Sat Apr 16 16:48:49 UTC 2011


Hi. I've implemented the basic support for boot from volume
and uploaded lp:~yamahata/nova/boot-from-volume
blue print:
https://blueprints.launchpad.net/nova/+spec/boot-from-volume
Adam Johnson, do you have any progress?

With the patches, VM can boot with a attached partion based on volume
(including root partition). For example,
euca-run-instances ami-XXXX -k mykey -t m1.tiny \
	--block-device-mapping /dev/vda=vol-00000001::false \
	--block-device-mapping /dev/vdb=vol-00000002::false

Although EBS manual syas that snapshot should be specified to,
I chose to volume id because creating snapshot/volume from snapshot/volume
isn't supported yet. They are proposed as
https://blueprints.launchpad.net/nova/+spec/snapshot-volume
https://blueprints.launchpad.net/nova/+spec/clone-volume

My next step is to add ephemeral device and no device support
and ami support. Comments?

thanks,

Note:
For --block-device-mapping options support,
you need latest euca2ools, latest boto which requires python 2.7 or later
and the following patch

--- euca2ools/commands/eucacommand.py	2011-04-11 13:23:49 +0000
+++ euca2ools/commands/eucacommand.py	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]
                 else:
                     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':



-- 
yamahata





More information about the Openstack mailing list