summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorCerberus <matt.dietz@rackspace.com>2011-02-14 15:26:08 -0600
committerCerberus <matt.dietz@rackspace.com>2011-02-14 15:26:08 -0600
commit7bb6122549ad5ac549465f0012020f8e5dc9d506 (patch)
treed27111b5bea4e8f7c3162aa1f2acc770c7da0077 /plugins
parent411d828fc3511a09420e579ceee65a9470242509 (diff)
downloadnova-7bb6122549ad5ac549465f0012020f8e5dc9d506.tar.gz
nova-7bb6122549ad5ac549465f0012020f8e5dc9d506.tar.xz
nova-7bb6122549ad5ac549465f0012020f8e5dc9d506.zip
Some refactoring
Diffstat (limited to 'plugins')
-rw-r--r--plugins/xenserver/xenapi/etc/xapi.d/plugins/migration8
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/xenserver/xenapi/etc/xapi.d/plugins/migration b/plugins/xenserver/xenapi/etc/xapi.d/plugins/migration
index 0fb7b5806..71d4473c5 100644
--- a/plugins/xenserver/xenapi/etc/xapi.d/plugins/migration
+++ b/plugins/xenserver/xenapi/etc/xapi.d/plugins/migration
@@ -78,9 +78,12 @@ def move_vhds_into_sr(session, args):
source_base_copy_path = "%s/base_copy.vhd" % source_image_path
source_cow_path = "%s/cow.vhd" % source_image_path
+ new_base_copy_uuid = str(uuid.uuid4())
+ new_cow_uuid = str(uuid.uuid4())
+
temp_vhd_path = "%s/instance%d/" % (sr_temp_path, instance_id)
- new_base_copy_path = "%s/%s.vhd" % (temp_vhd_path, str(uuid.uuid4()))
- new_cow_path = "%s/%s.vhd" % (temp_vhd_path, str(uuid.uuid4()))
+ new_base_copy_path = "%s/%s.vhd" % (temp_vhd_path, new_base_copy_uuid)
+ new_cow_path = "%s/%s.vhd" % (temp_vhd_path, new_cow_uuid)
os.mkdir(temp_vhd_path)
shutil.move(source_base_copy_path, new_base_copy_path)
@@ -94,6 +97,7 @@ def move_vhds_into_sr(session, args):
shutil.move("%s/*.vhd" % temp_vhd_path, sr_path)
os.rmdir(temp_vhd_path)
+ return (new_base_copy_uuid, new_cow_uuid)
def transfer_vhd(session, args):