Commit 0625d08f authored by René Nussbaumer's avatar René Nussbaumer
Browse files

Support xl as a xen interface command

xm and xl are mostly compatible, there is just a change in migrate,
which for now we simple bridge by comparing the command string.

Also XEN_CMD is now set during configure time. This will then be fixed
in Ganeti 2.7 when we make it an hvparams.
Signed-off-by: default avatarRené Nussbaumer <>
Reviewed-by: default avatarIustin Pop <>
parent 1eb37421
......@@ -267,7 +267,10 @@ EXPORT_CONF_FILE = "config.ini"
XEN_CMD = "xm"
XEN_CMD_XM = "xm"
XEN_CMD_XL = "xl"
# FIXME: This will be made configurable using hvparams in Ganeti 2.7
XEN_CMD = _autoconf.XEN_CMD
KVM_PATH = _autoconf.KVM_PATH
......@@ -537,13 +537,19 @@ class XenHypervisor(hv_base.BaseHypervisor):
" %s, cannot migrate" % (target, port))
# FIXME: migrate must be upgraded for transitioning to "xl" (xen 4.1).
# -l doesn't exist anymore
# -p doesn't exist anymore
# -C config_file must be passed
# This should be reworked in Ganeti 2.7
# ssh must recognize the key of the target host for the migration
args = [constants.XEN_CMD, "migrate", "-p", "%d" % port]
if live:
args = [constants.XEN_CMD, "migrate"]
if constants.XEN_CMD == constants.XEN_CMD_XM:
args.extend(["-p", "%d" % port])
if live:
elif constants.XEN_CMD == constants.XEN_CMD_XL:
args.extend(["-C", self._ConfigFileName(])
raise errors.HypervisorError("Unsupported xen command: %s" %
args.extend([, target])
result = utils.RunCmd(args)
if result.failed:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment