diff options
| author | Cory Wright <cory.wright@rackspace.com> | 2011-03-02 00:19:02 +0000 |
|---|---|---|
| committer | Cory Wright <cory.wright@rackspace.com> | 2011-03-02 00:19:02 +0000 |
| commit | 6321c5047c082bba8edf10a660fdb6a56430cc44 (patch) | |
| tree | afeaf97ae3323b0cc1b3103137eced6884f499f4 /plugins | |
| parent | 1519f74bf840ad6135f5ecb4f29f1b59572aa4b6 (diff) | |
| download | nova-6321c5047c082bba8edf10a660fdb6a56430cc44.tar.gz nova-6321c5047c082bba8edf10a660fdb6a56430cc44.tar.xz nova-6321c5047c082bba8edf10a660fdb6a56430cc44.zip | |
* Added first cut of migration for os_type on instances table
* Track os_type when taking snapshots
Diffstat (limited to 'plugins')
| -rw-r--r-- | plugins/xenserver/xenapi/etc/xapi.d/plugins/glance | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/plugins/xenserver/xenapi/etc/xapi.d/plugins/glance b/plugins/xenserver/xenapi/etc/xapi.d/plugins/glance index 7531af4ec..160bf482f 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. @@ -205,9 +205,10 @@ def _upload_tarball(staging_path, image_id, glance_host, glance_port): headers = { 'content-type': 'application/octet-stream', 'transfer-encoding': 'chunked', - 'x-image-meta-is_public': 'True', + 'x-image-meta-is-public': 'True', 'x-image-meta-status': 'queued', - 'x-image-meta-type': 'vhd' + 'x-image-meta-type': 'vhd', + 'x-image-meta-property-os-type': os_type } for header, value in headers.iteritems(): conn.putheader(header, value) @@ -330,11 +331,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) |
