Revision 8351df2f lib/hypervisor/hv_xen.py
b/lib/hypervisor/hv_xen.py | ||
---|---|---|
721 | 721 |
cluster_name = ssconf.SimpleStore().GetClusterName() |
722 | 722 |
|
723 | 723 |
return self._MigrateInstance(cluster_name, instance.name, target, port, |
724 |
live) |
|
724 |
live, instance.hvparams)
|
|
725 | 725 |
|
726 | 726 |
def _MigrateInstance(self, cluster_name, instance_name, target, port, live, |
727 |
_ping_fn=netutils.TcpPing): |
|
727 |
hvparams, _ping_fn=netutils.TcpPing):
|
|
728 | 728 |
"""Migrate an instance to a target node. |
729 | 729 |
|
730 | 730 |
@see: L{MigrateInstance} for details |
731 | 731 |
|
732 | 732 |
""" |
733 |
if self.GetInstanceInfo(instance_name) is None: |
|
733 |
if hvparams is None: |
|
734 |
raise errors.HypervisorError("No hvparams provided.") |
|
735 |
|
|
736 |
if self.GetInstanceInfo(instance_name, hvparams=hvparams) is None: |
|
734 | 737 |
raise errors.HypervisorError("Instance not running, cannot migrate") |
735 | 738 |
|
736 |
cmd = self._GetCommand() |
|
739 |
cmd = self._GetCommand(hvparams=hvparams)
|
|
737 | 740 |
|
738 | 741 |
if (cmd == constants.XEN_CMD_XM and |
739 | 742 |
not _ping_fn(target, port, live_port_needed=True)): |
Also available in: Unified diff