summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorSalvatore Orlando <salvatore.orlando@eu.citrix.com>2010-12-09 16:42:52 +0000
committerSalvatore Orlando <salvatore.orlando@eu.citrix.com>2010-12-09 16:42:52 +0000
commit49a1cadd61b4badff0578ecd26adb57fb284ad9a (patch)
tree9f505c29e1b8328c88c92e05931f3f11a17587be /plugins
parent31a1c59ec2aa45400ded83d228af54b433910b8d (diff)
downloadnova-49a1cadd61b4badff0578ecd26adb57fb284ad9a.tar.gz
nova-49a1cadd61b4badff0578ecd26adb57fb284ad9a.tar.xz
nova-49a1cadd61b4badff0578ecd26adb57fb284ad9a.zip
raw instances can now be launched in xenapi (only as hvm at the moment)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/xenapi/etc/xapi.d/plugins/objectstore9
1 files changed, 5 insertions, 4 deletions
diff --git a/plugins/xenapi/etc/xapi.d/plugins/objectstore b/plugins/xenapi/etc/xapi.d/plugins/objectstore
index cbae1e552..071494160 100644
--- a/plugins/xenapi/etc/xapi.d/plugins/objectstore
+++ b/plugins/xenapi/etc/xapi.d/plugins/objectstore
@@ -48,6 +48,7 @@ def get_vdi(session, args):
src_url = exists(args, 'src_url')
username = exists(args, 'username')
password = exists(args, 'password')
+ raw_image=validate_bool(args, 'raw', 'false')
add_partition = validate_bool(args, 'add_partition', 'false')
(proto, netloc, url_path, _, _, _) = urlparse.urlparse(src_url)
@@ -69,19 +70,19 @@ def get_vdi(session, args):
vdi = create_vdi(session, sr, src_url, vdi_size, False)
with_vdi_in_dom0(session, vdi, False,
lambda dev: get_vdi_(proto, netloc, url_path,
- username, password, add_partition,
+ username, password, add_partition,raw_image,
virtual_size, '/dev/%s' % dev))
return session.xenapi.VDI.get_uuid(vdi)
-def get_vdi_(proto, netloc, url_path, username, password, add_partition,
+def get_vdi_(proto, netloc, url_path, username, password, add_partition,raw_image,
virtual_size, dest):
#Salvatore: vdi should not be partitioned for raw images
- if add_partition:
+ if (add_partition and not raw_image):
write_partition(virtual_size, dest)
- offset = add_partition and MBR_SIZE_BYTES or 0
+ offset = (add_partition and MBR_SIZE_BYTES and not raw_image) or 0
get(proto, netloc, url_path, username, password, dest, offset)