XEN_CMD_XL = "xl"
# FIXME: This will be made configurable using hvparams in Ganeti 2.7
XEN_CMD = _autoconf.XEN_CMD
+# When the Xen toolstack used is "xl", live migration requires the source host
+# to connect to the target host via ssh (xl runs this command). We need to pass
+# the command xl runs some extra info so that it can use Ganeti's key
+# verification and not fail. Note that this string is incomplete: it must be
+# filled with the cluster name before being used.
+XL_SSH_CMD = ("ssh -l root -oGlobalKnownHostsFile=%s"
+ " -oUserKnownHostsFile=/dev/null"
+ " -oCheckHostIp=no -oStrictHostKeyChecking=yes"
+ " -oHostKeyAlias=%%s") % SSH_KNOWN_HOSTS_FILE
KVM_PATH = _autoconf.KVM_PATH
KVM_KERNEL = _autoconf.KVM_KERNEL
from ganeti.hypervisor import hv_base
from ganeti import netutils
from ganeti import objects
+from ganeti import ssconf
XEND_CONFIG_FILE = "/etc/xen/xend-config.sxp"
if live:
args.append("-l")
elif constants.XEN_CMD == constants.XEN_CMD_XL:
+ cluster_name = ssconf.SimpleStore().GetClusterName()
+ args.extend(["-s", constants.XL_SSH_CMD % cluster_name])
args.extend(["-C", self._ConfigFileName(instance.name)])
else:
raise errors.HypervisorError("Unsupported xen command: %s" %