diff options
author | Renuka Apte <renuka.apte@citrix.com> | 2012-06-04 13:48:34 -0700 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2012-07-09 17:59:36 +0000 |
commit | ed118dfd6ebe06a095620e93f4318c4e7ac9cfed (patch) | |
tree | e00d5cd00b2cf842cc0341860e51823e22ea0367 /nova/block_device.py | |
parent | a97de51e017c9c07eaa3e4a9ddde4193e9528373 (diff) | |
download | nova-ed118dfd6ebe06a095620e93f4318c4e7ac9cfed.tar.gz nova-ed118dfd6ebe06a095620e93f4318c4e7ac9cfed.tar.xz nova-ed118dfd6ebe06a095620e93f4318c4e7ac9cfed.zip |
Boot from volume for Xen
Implements bp xenapi-boot-from-volume
Ensure boot from volume works for XenAPI (tested using XenServer).
1. Add strip_prefix to block_device to make the command mountpoint
agnostic.
2. Pass block device and delete on terminate information to driver
layer.
3. Add ability to recognize and boot from the specified nova volume.
Change-Id: If117087086eab809217d2b173f921bf9319a52c7
Diffstat (limited to 'nova/block_device.py')
-rw-r--r-- | nova/block_device.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/nova/block_device.py b/nova/block_device.py index 1b7d38145..caa521e83 100644 --- a/nova/block_device.py +++ b/nova/block_device.py @@ -72,3 +72,12 @@ _dev = re.compile('^/dev/') def strip_dev(device_name): """remove leading '/dev/'""" return _dev.sub('', device_name) + + +_pref = re.compile('^((x?v|s)d)') + + +def strip_prefix(device_name): + """ remove both leading /dev/ and xvd or sd or vd """ + device_name = strip_dev(device_name) + return _pref.sub('', device_name) |