From 774b5aaa173fa04675be5252c5d47f67a07347ac Mon Sep 17 00:00:00 2001 From: Matt Dietz Date: Fri, 23 Sep 2011 15:36:50 -0500 Subject: Adds disk config Change-Id: If3e1765b659ead77f9cdaaa86ee8478a82bf67c0 --- plugins/xenserver/xenapi/etc/xapi.d/plugins/glance | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/xenserver/xenapi/etc/xapi.d/plugins/glance b/plugins/xenserver/xenapi/etc/xapi.d/plugins/glance index 950b78707..e7bf7e5a8 100755 --- a/plugins/xenserver/xenapi/etc/xapi.d/plugins/glance +++ b/plugins/xenserver/xenapi/etc/xapi.d/plugins/glance @@ -246,7 +246,7 @@ def _prepare_staging_area_for_upload(sr_path, staging_path, vdi_uuids): def _upload_tarball(staging_path, image_id, glance_host, glance_port, os_type, - auth_token): + auth_token, options): """ Create a tarball of the image and then stream that into Glance using chunked-transfer-encoded HTTP. @@ -293,6 +293,9 @@ def _upload_tarball(staging_path, image_id, glance_host, glance_port, os_type, 'x-image-meta-container-format': 'ovf', 'x-image-meta-property-os-type': os_type} + if options.get('managed_disk'): + headers['x-image-meta-property-managed-disk'] = options['managed_disk'] + # If we have an auth_token, set an x-auth-token header if auth_token: ovf_headers['x-auth-token'] = auth_token @@ -424,12 +427,13 @@ def upload_vhd(session, args): sr_path = params["sr_path"] os_type = params["os_type"] auth_token = params["auth_token"] + options = params["options"] 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, - os_type, auth_token) + os_type, auth_token, options) finally: _cleanup_staging_area(staging_path) -- cgit