From 482c7b57a3d0ac8bf6df98539bf8a1220470e0f7 Mon Sep 17 00:00:00 2001 From: Cerberus Date: Wed, 9 Feb 2011 15:27:23 -0600 Subject: Renamed migration plugin --- .../xenapi/etc/xapi.d/plugins/data_transfer | 53 ---------------------- .../xenserver/xenapi/etc/xapi.d/plugins/migration | 53 ++++++++++++++++++++++ 2 files changed, 53 insertions(+), 53 deletions(-) delete mode 100644 plugins/xenserver/xenapi/etc/xapi.d/plugins/data_transfer create mode 100644 plugins/xenserver/xenapi/etc/xapi.d/plugins/migration (limited to 'plugins') diff --git a/plugins/xenserver/xenapi/etc/xapi.d/plugins/data_transfer b/plugins/xenserver/xenapi/etc/xapi.d/plugins/data_transfer deleted file mode 100644 index bd46e1c0b..000000000 --- a/plugins/xenserver/xenapi/etc/xapi.d/plugins/data_transfer +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/env python - -# Copyright 2010 United States Government as represented by the -# Administrator of the National Aeronautics and Space Administration. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -""" -XenAPI Plugin for transfering data between host nodes -""" - -import os.path -import pickle -import subprocess - -import XenAPIPlugin - -SSH_HOSTS = '/root/.ssh/known_hosts' -DEVNULL = '/dev/null' -KEYSCAN = '/usr/bin/ssh-keyscan' -RSYNC = '/usr/bin/rsync' - - -def transfer_vhd(session, args): - """Rsyncs a VHD to an adjacent host""" - params = pickle.dumps(args) - instance_id = params['instance_id'] - host = params['host'] - vdi_uuid = params['vdi_uuid'] - sr_path = get_sr_path(session) - vhd_path = "%s.vhd" % vdi_uuid - - source_path = "%s/%s" % (sr_path, vhd_path) - dest_path = '%s:/images/instance%d/' % (host, instance_id) - rsync_args = [['nohup', RSYNC, '-av', '--progress', - '-e "ssh -o StrictHostKeyChecking=no"', source_path, dest_path] - - if subprocess.call(rsync_args) != 0: - raise Exception("Unexpected VHD transfer failure") - -if __name__ == '__main__': - XenAPIPlugin.dispatch({'transfer_vhd': transfer_vhd}) diff --git a/plugins/xenserver/xenapi/etc/xapi.d/plugins/migration b/plugins/xenserver/xenapi/etc/xapi.d/plugins/migration new file mode 100644 index 000000000..bd46e1c0b --- /dev/null +++ b/plugins/xenserver/xenapi/etc/xapi.d/plugins/migration @@ -0,0 +1,53 @@ +#!/usr/bin/env python + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +""" +XenAPI Plugin for transfering data between host nodes +""" + +import os.path +import pickle +import subprocess + +import XenAPIPlugin + +SSH_HOSTS = '/root/.ssh/known_hosts' +DEVNULL = '/dev/null' +KEYSCAN = '/usr/bin/ssh-keyscan' +RSYNC = '/usr/bin/rsync' + + +def transfer_vhd(session, args): + """Rsyncs a VHD to an adjacent host""" + params = pickle.dumps(args) + instance_id = params['instance_id'] + host = params['host'] + vdi_uuid = params['vdi_uuid'] + sr_path = get_sr_path(session) + vhd_path = "%s.vhd" % vdi_uuid + + source_path = "%s/%s" % (sr_path, vhd_path) + dest_path = '%s:/images/instance%d/' % (host, instance_id) + rsync_args = [['nohup', RSYNC, '-av', '--progress', + '-e "ssh -o StrictHostKeyChecking=no"', source_path, dest_path] + + if subprocess.call(rsync_args) != 0: + raise Exception("Unexpected VHD transfer failure") + +if __name__ == '__main__': + XenAPIPlugin.dispatch({'transfer_vhd': transfer_vhd}) -- cgit