diff options
| author | Jenkins <jenkins@review.openstack.org> | 2011-09-27 05:05:35 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2011-09-27 05:05:35 +0000 |
| commit | a51533729a262be258f99b0c5669eed78981eba5 (patch) | |
| tree | 547ea94b17524ed48a714b132683948d23b3cb07 /plugins | |
| parent | 144b5e403c211c34651ba9295d12f2077f8b15a7 (diff) | |
| parent | 774b5aaa173fa04675be5252c5d47f67a07347ac (diff) | |
| download | nova-a51533729a262be258f99b0c5669eed78981eba5.tar.gz nova-a51533729a262be258f99b0c5669eed78981eba5.tar.xz nova-a51533729a262be258f99b0c5669eed78981eba5.zip | |
Merge "Adds disk config"
Diffstat (limited to 'plugins')
| -rwxr-xr-x | plugins/xenserver/xenapi/etc/xapi.d/plugins/glance | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/xenserver/xenapi/etc/xapi.d/plugins/glance b/plugins/xenserver/xenapi/etc/xapi.d/plugins/glance index ac1a8b621..bb3737a65 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) |
