summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorCory Wright <cory.wright@rackspace.com>2011-03-11 22:10:07 +0000
committerTarmac <>2011-03-11 22:10:07 +0000
commit2002b0920fb4a5ad3403e2243eb19809b3cb631b (patch)
tree7f8726868c335846807f138724283a60147c6fc7 /plugins
parent271692fd80aaf3a045849ef8a87060e15ab8c69e (diff)
parent0eb3fefea2dbf53bdc9cc4d6b5f9682a32b346d4 (diff)
downloadnova-2002b0920fb4a5ad3403e2243eb19809b3cb631b.tar.gz
nova-2002b0920fb4a5ad3403e2243eb19809b3cb631b.tar.xz
nova-2002b0920fb4a5ad3403e2243eb19809b3cb631b.zip
This change adds the ability to boot Windows and Linux instances in XenServer using different sets of vm-params.
Images in glance should have a property set with a key of `os_type` and a value of either `windows` or `linux`. Images without `os_type` set default to `linux`. Linux images boot para-virtualized, while Windows images boot via HVM.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/xenserver/xenapi/etc/xapi.d/plugins/glance11
1 files changed, 8 insertions, 3 deletions
diff --git a/plugins/xenserver/xenapi/etc/xapi.d/plugins/glance b/plugins/xenserver/xenapi/etc/xapi.d/plugins/glance
index 201b99fda..c996f6ef4 100644
--- a/plugins/xenserver/xenapi/etc/xapi.d/plugins/glance
+++ b/plugins/xenserver/xenapi/etc/xapi.d/plugins/glance
@@ -191,7 +191,7 @@ def _prepare_staging_area_for_upload(sr_path, staging_path, vdi_uuids):
os.link(source, link_name)
-def _upload_tarball(staging_path, image_id, glance_host, glance_port):
+def _upload_tarball(staging_path, image_id, glance_host, glance_port, os_type):
"""
Create a tarball of the image and then stream that into Glance
using chunked-transfer-encoded HTTP.
@@ -215,7 +215,10 @@ def _upload_tarball(staging_path, image_id, glance_host, glance_port):
'x-image-meta-is-public': 'True',
'x-image-meta-status': 'queued',
'x-image-meta-disk-format': 'vhd',
- 'x-image-meta-container-format': 'ovf'}
+ 'x-image-meta-container-format': 'ovf',
+ 'x-image-meta-property-os-type': os_type
+ }
+
for header, value in headers.iteritems():
conn.putheader(header, value)
conn.endheaders()
@@ -337,11 +340,13 @@ def upload_vhd(session, args):
glance_host = params["glance_host"]
glance_port = params["glance_port"]
sr_path = params["sr_path"]
+ os_type = params["os_type"]
staging_path = _make_staging_area(sr_path)
try:
_prepare_staging_area_for_upload(sr_path, staging_path, vdi_uuids)
- _upload_tarball(staging_path, image_id, glance_host, glance_port)
+ _upload_tarball(staging_path, image_id, glance_host, glance_port,
+ os_type)
finally:
_cleanup_staging_area(staging_path)