Commit 937ff984 authored by Dimitris Aragiorgis's avatar Dimitris Aragiorgis Committed by Thomas Thrainer
Browse files

kvm: Add migration capabilities as an hvparam

Latest QEMU versions support various migration capabilities. Each
can be enabled/disabled with 'migrate_set_capability' monitor

Version 1.7.0 defines x-rdma-pin-all, auto-converge, zero-blocks,
and xbzrle migration capabilities.

Since migration capabilities are more than one, and because hvparams
accept only strings/integers and not dicts we decide to provide
the capabilities that should be on via a ":" separated string.

In other words one can use the following to enable xbzrle and

-H kvm:migration_caps=xbzrle:auto-converge

IMPORTANT: xbzrle may result to BSOD for instances running
Windows 2008r8 on drbd.

Update man page of gnt-instance to include the new hvparam.
Signed-off-by: default avatarDimitris Aragiorgis <>
Signed-off-by: default avatarThomas Thrainer <>
Reviewed-by: default avatarThomas Thrainer <>
parent cc0c1197
......@@ -115,6 +115,8 @@ _RUNTIME_ENTRY = {
constants.HOTPLUG_TARGET_DISK: lambda d, e: (d, e, None)
def _GenerateDeviceKVMId(dev_type, dev):
"""Helper function to generate a unique device name used by KVM
......@@ -743,6 +745,7 @@ class KVMHypervisor(hv_base.BaseHypervisor):
constants.HV_VGA: hv_base.NO_CHECK,
constants.HV_KVM_EXTRA: hv_base.NO_CHECK,
constants.HV_KVM_MIGRATION_CAPS: hv_base.NO_CHECK,
constants.HV_VNET_HDR: hv_base.NO_CHECK,
......@@ -2574,6 +2577,12 @@ class KVMHypervisor(hv_base.BaseHypervisor):
self._CallMonitorCommand(instance_name, migrate_command)
migration_caps = instance.hvparams[constants.HV_KVM_MIGRATION_CAPS]
if migration_caps:
for c in migration_caps.split(_MIGRATION_CAPS_DELIM):
migrate_command = ("migrate_set_capability %s on" % c)
self._CallMonitorCommand(instance_name, migrate_command)
migrate_command = "migrate -d tcp:%s:%s" % (target, port)
self._CallMonitorCommand(instance_name, migrate_command)
......@@ -804,6 +804,16 @@ machine\_version
machine version (due to e.g. outdated drivers). In case it's not set
the default version supported by your version of kvm is used.
Valid for the KVM hypervisor.
Enable specific migration capabilities by providing a ":" separated
list of supported capabilites. QEMU version 1.7.0 defines
x-rdma-pin-all, auto-converge, zero-blocks, and xbzrle. Please note
that while a combination of xbzrle and auto-converge might speed up
the migration process significantly, the first may cause BSOD on
Windows8r2 instances running on drbd.
Valid for the KVM hypervisor.
......@@ -1556,6 +1556,9 @@ hvKvmFloppyImagePath = "floppy_image_path"
hvKvmMachineVersion :: String
hvKvmMachineVersion = "machine_version"
hvKvmMigrationCaps :: String
hvKvmMigrationCaps = "migration_caps"
hvKvmPath :: String
hvKvmPath = "kvm_path"
......@@ -1741,6 +1744,7 @@ hvsParameterTypes = Map.fromList
, (hvKvmFlag, VTypeString)
, (hvKvmFloppyImagePath, VTypeString)
, (hvKvmMachineVersion, VTypeString)
, (hvKvmMigrationCaps, VTypeString)
, (hvKvmPath, VTypeString)
, (hvKvmSpiceAudioCompr, VTypeBool)
, (hvKvmSpiceBind, VTypeString)
......@@ -3776,6 +3780,7 @@ hvcDefaults =
, (hvVga, PyValueEx "")
, (hvKvmExtra, PyValueEx "")
, (hvKvmMachineVersion, PyValueEx "")
, (hvKvmMigrationCaps, PyValueEx "")
, (hvVnetHdr, PyValueEx True)])
, (Fake, Map.fromList [(hvMigrationMode, PyValueEx htMigrationLive)])
, (Chroot, Map.fromList [(hvInitScript, PyValueEx "/ganeti-chroot")])
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