diff options
| author | Cerberus <matt.dietz@rackspace.com> | 2011-02-14 18:04:07 -0600 |
|---|---|---|
| committer | Cerberus <matt.dietz@rackspace.com> | 2011-02-14 18:04:07 -0600 |
| commit | 3014c0896202b592858fc1a7fc9c29b92a6f5d1b (patch) | |
| tree | 9dcf3ef60d421ad589012389932870f17e39574e /plugins | |
| parent | b7cf8f233a585043f0aa85f4d26dc2fb5a6701c7 (diff) | |
| download | nova-3014c0896202b592858fc1a7fc9c29b92a6f5d1b.tar.gz nova-3014c0896202b592858fc1a7fc9c29b92a6f5d1b.tar.xz nova-3014c0896202b592858fc1a7fc9c29b92a6f5d1b.zip | |
plugin
Diffstat (limited to 'plugins')
| -rw-r--r-- | plugins/xenserver/xenapi/etc/xapi.d/plugins/migration | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/plugins/xenserver/xenapi/etc/xapi.d/plugins/migration b/plugins/xenserver/xenapi/etc/xapi.d/plugins/migration index c1f5b7528..9c56cb379 100644 --- a/plugins/xenserver/xenapi/etc/xapi.d/plugins/migration +++ b/plugins/xenserver/xenapi/etc/xapi.d/plugins/migration @@ -111,14 +111,18 @@ def transfer_vhd(session, args): vhd_path = "%s.vhd" % vdi_uuid source_path = "%s/%s" % (sr_path, vhd_path) - dest_path = '%s:%sinstance%d/%s' % (host, IMAGE_PATH, instance_id, - dest_name) - rsync_args = ['nohup', RSYNC, '-av', '--progress', - '-e "ssh -o StrictHostKeyChecking=no"', source_path, dest_path] + dest_path = '%sinstance%d/' % (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 + + rsync_args = ['nohup', RSYNC, '-av', '--progress', ssh_cmd, source_path, + dest_path_with_vhd] if subprocess.call(rsync_args) != 0: raise Exception("Unexpected VHD transfer failure") + if __name__ == '__main__': XenAPIPlugin.dispatch({'transfer_vhd': transfer_vhd, 'move_vhds_into_sr':move_vhds_into_sr, }) |
