blargh
This commit is contained in:
@@ -379,7 +379,7 @@ class API(base.Base):
|
|||||||
kwargs = {'method': method, 'args': params}
|
kwargs = {'method': method, 'args': params}
|
||||||
return rpc.call(context, queue, kwargs)
|
return rpc.call(context, queue, kwargs)
|
||||||
|
|
||||||
def _cast_scheduler_message(self, context, args)
|
def _cast_scheduler_message(self, context, args):
|
||||||
"""Generic handler for RPC calls to the scheduler"""
|
"""Generic handler for RPC calls to the scheduler"""
|
||||||
rpc.cast(context, FLAGS.scheduler_topic, args)
|
rpc.cast(context, FLAGS.scheduler_topic, args)
|
||||||
|
|
||||||
|
|||||||
@@ -220,6 +220,14 @@ class VMOps(object):
|
|||||||
|
|
||||||
logging.debug(_("Finished snapshot and upload for VM %s"), instance)
|
logging.debug(_("Finished snapshot and upload for VM %s"), instance)
|
||||||
|
|
||||||
|
def transfer_disk(self, instance, dest):
|
||||||
|
""" Copies a VHD from one host machine to another
|
||||||
|
|
||||||
|
:param instance: the instance that owns the VHD in question
|
||||||
|
:param dest: the destination host machine
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
def resize(self, instance, flavor):
|
def resize(self, instance, flavor):
|
||||||
"""Resize a running instance by changing it's RAM and disk size """
|
"""Resize a running instance by changing it's RAM and disk size """
|
||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
|
|||||||
@@ -193,7 +193,7 @@ class XenAPIConnection(object):
|
|||||||
self._vmops.power_on(instance)
|
self._vmops.power_on(instance)
|
||||||
|
|
||||||
def transfer_disk(self, instance, dest, callback):
|
def transfer_disk(self, instance, dest, callback):
|
||||||
self._vmops.transfer_disk(dest)
|
self._vmops.transfer_disk(instance, dest)
|
||||||
|
|
||||||
def suspend(self, instance, callback):
|
def suspend(self, instance, callback):
|
||||||
"""suspend the specified instance"""
|
"""suspend the specified instance"""
|
||||||
|
|||||||
@@ -46,11 +46,11 @@ def _key_scan_and_add(host):
|
|||||||
null.close()
|
null.close()
|
||||||
known_hosts.close()
|
known_hosts.close()
|
||||||
|
|
||||||
def transfer_vhd(host, vhd_path):
|
def transfer_file(host, file_path):
|
||||||
"""Rsyncs a VHD to an adjacent host"""
|
"""Rsyncs a VHD to an adjacent host"""
|
||||||
_key_scan_and_add(host)
|
_key_scan_and_add(host)
|
||||||
if subprocess.call([RSYNC, vhd_path, "%s:/root/" % host]) != 0:
|
if subprocess.call([RSYNC, file_path, "%s:/root/" % host]) != 0:
|
||||||
raise Exception("Unexpected VHD transfer failure")
|
raise Exception("Unexpected VHD transfer failure")
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
XenAPIPlugin.dispatch({'transfer_vhd': transfer_vhd})
|
XenAPIPlugin.dispatch({'transfer_file': transfer_file})
|
||||||
|
|||||||
Reference in New Issue
Block a user