summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorChris Behrens <cbehrens@codestud.com>2011-05-23 14:38:37 -0500
committerChris Behrens <cbehrens@codestud.com>2011-05-23 14:38:37 -0500
commitffac2aa8162ba5111a01b495d9dd7e43bfda4af4 (patch)
tree0026787a684d89a70573e4a7f9143cd71aa82c6d /plugins
parente1795bd73c71a20290bc988c410e0cc30afe6bd8 (diff)
downloadnova-ffac2aa8162ba5111a01b495d9dd7e43bfda4af4.tar.gz
nova-ffac2aa8162ba5111a01b495d9dd7e43bfda4af4.tar.xz
nova-ffac2aa8162ba5111a01b495d9dd7e43bfda4af4.zip
initial fudging in of swap disk
Diffstat (limited to 'plugins')
-rw-r--r--plugins/xenserver/xenapi/etc/xapi.d/plugins/glance12
1 files changed, 9 insertions, 3 deletions
diff --git a/plugins/xenserver/xenapi/etc/xapi.d/plugins/glance b/plugins/xenserver/xenapi/etc/xapi.d/plugins/glance
index 4b45671ae..9d6ee78ab 100644
--- a/plugins/xenserver/xenapi/etc/xapi.d/plugins/glance
+++ b/plugins/xenserver/xenapi/etc/xapi.d/plugins/glance
@@ -177,8 +177,15 @@ def _fixup_vhds(sr_path, staging_path, uuid_stack):
else:
assert_vhd_not_hidden(base_copy_path)
+ # If we find a swap.vhd, go ahead and copy it into the SR
+ swap_uuid = None
+ orig_swap_path = os.path.join(staging_path, 'swap.vhd')
+ if os.path.exists(orig_swap_path):
+ swap_path, swap_uuid = rename_with_uuid(orig_swap_path)
+ move_into_sr(swap_path)
+
move_into_sr(base_copy_path)
- return vdi_uuid
+ return dict(primary_vdi_uuid=vdi_uuid, swap_vdi_uuid=swap_uuid)
def _prepare_staging_area_for_upload(sr_path, staging_path, vdi_uuids):
@@ -324,8 +331,7 @@ def download_vhd(session, args):
try:
_download_tarball(sr_path, staging_path, image_id, glance_host,
glance_port)
- vdi_uuid = _fixup_vhds(sr_path, staging_path, uuid_stack)
- return vdi_uuid
+ return _fixup_vhds(sr_path, staging_path, uuid_stack)
finally:
_cleanup_staging_area(staging_path)