summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorCerberus <matt.dietz@rackspace.com>2011-02-14 23:22:37 -0600
committerCerberus <matt.dietz@rackspace.com>2011-02-14 23:22:37 -0600
commite7fe96453760320ef897b9edfc39e057d565e6c0 (patch)
tree84426d28e730c14a8128346a3e91ace388f984de /plugins
parent3014c0896202b592858fc1a7fc9c29b92a6f5d1b (diff)
downloadnova-e7fe96453760320ef897b9edfc39e057d565e6c0.tar.gz
nova-e7fe96453760320ef897b9edfc39e057d565e6c0.tar.xz
nova-e7fe96453760320ef897b9edfc39e057d565e6c0.zip
Refactored
Diffstat (limited to 'plugins')
-rw-r--r--plugins/xenserver/xenapi/etc/xapi.d/plugins/migration17
1 files changed, 9 insertions, 8 deletions
diff --git a/plugins/xenserver/xenapi/etc/xapi.d/plugins/migration b/plugins/xenserver/xenapi/etc/xapi.d/plugins/migration
index 9c56cb379..3d3ad4e67 100644
--- a/plugins/xenserver/xenapi/etc/xapi.d/plugins/migration
+++ b/plugins/xenserver/xenapi/etc/xapi.d/plugins/migration
@@ -68,6 +68,9 @@ def move_vhds_into_sr(session, args):
params = pickle.loads(exists(args, 'params'))
instance_id = params['instance_id']
+ old_base_copy_uuid = params['old_base_copy_uuid']
+ old_cow_uuid = params['old_cow_uuid']
+
new_base_copy_uuid = params['new_base_copy_uuid']
new_cow_uuid = params['new_cow_uuid']
@@ -77,9 +80,9 @@ def move_vhds_into_sr(session, args):
# Discover the copied VHDs locally, and then set up paths to copy
# them to under the SR
source_image_path = "%s/instance%d" % (IMAGE_PATH, instance_id)
- source_base_copy_path = "%s/base_copy.vhd" % source_image_path
- source_cow_path = "%s/cow.vhd" % source_image_path
-
+ source_base_copy_path = "%s/%s.vhd" % (source_image_path,
+ old_base_copy_uuid)
+ source_cow_path = "%s/%s.vhd" % (source_image_path, old_cow_uuid)
temp_vhd_path = "%s/instance%d/" % (sr_temp_path, instance_id)
new_base_copy_path = "%s/%s.vhd" % (temp_vhd_path, new_base_copy_uuid)
@@ -106,18 +109,16 @@ def transfer_vhd(session, args):
instance_id = params['instance_id']
host = params['host']
vdi_uuid = params['vdi_uuid']
- dest_name = params['dest_name']
sr_path = get_sr_path(session)
vhd_path = "%s.vhd" % vdi_uuid
source_path = "%s/%s" % (sr_path, vhd_path)
- dest_path = '%sinstance%d/' % (IMAGE_PATH, instance_id)
+ dest_path = '%s:%sinstance%d/' % (host, IMAGE_PATH, instance_id)
- dest_path_with_vhd="$s:%s/%s" % (host, dest_path, dest_name)
- ssh_cmd = '-e "ssh -o StrictHostKeyChecking=no \'mkdir -p %s\' " ' % dest_path
+ ssh_cmd = '-e "ssh -o StrictHostKeyChecking=no " '
rsync_args = ['nohup', RSYNC, '-av', '--progress', ssh_cmd, source_path,
- dest_path_with_vhd]
+ dest_path]
if subprocess.call(rsync_args) != 0:
raise Exception("Unexpected VHD transfer failure")