HV_MIGRATION_BANDWIDTH = "migration_bandwidth"
HV_MIGRATION_DOWNTIME = "migration_downtime"
HV_MIGRATION_MODE = "migration_mode"
+HV_KVM_MIGRATION_CAPS = "migration_caps"
HV_USE_LOCALTIME = "use_localtime"
HV_DISK_CACHE = "disk_cache"
HV_SECURITY_MODEL = "security_model"
HV_MIGRATION_BANDWIDTH: VTYPE_INT,
HV_MIGRATION_DOWNTIME: VTYPE_INT,
HV_MIGRATION_MODE: VTYPE_STRING,
+ HV_KVM_MIGRATION_CAPS: VTYPE_STRING,
HV_USE_LOCALTIME: VTYPE_BOOL,
HV_DISK_CACHE: VTYPE_STRING,
HV_SECURITY_MODEL: VTYPE_STRING,
HV_MIGRATION_BANDWIDTH: 32, # MiB/s
HV_MIGRATION_DOWNTIME: 30, # ms
HV_MIGRATION_MODE: HT_MIGRATION_LIVE,
+ HV_KVM_MIGRATION_CAPS: "",
HV_USE_LOCALTIME: False,
HV_DISK_CACHE: HT_CACHE_DEFAULT,
HV_SECURITY_MODEL: HT_SM_NONE,
constants.HOTPLUG_TARGET_DISK: lambda d, e: (d, e)
}
+_MIGRATION_CAPS_DELIM = ":"
+
def _GenerateDeviceKVMId(dev_type, dev, idx=None):
"""Helper function to generate a unique device name used by KVM
constants.HV_MIGRATION_BANDWIDTH: hv_base.REQ_NONNEGATIVE_INT_CHECK,
constants.HV_MIGRATION_DOWNTIME: hv_base.REQ_NONNEGATIVE_INT_CHECK,
constants.HV_MIGRATION_MODE: hv_base.MIGRATION_MODE_CHECK,
+ constants.HV_KVM_MIGRATION_CAPS: hv_base.NO_CHECK,
constants.HV_USE_LOCALTIME: hv_base.NO_CHECK,
constants.HV_DISK_CACHE:
hv_base.ParamInSet(True, constants.HT_VALID_CACHE_TYPES),
instance.hvparams[constants.HV_MIGRATION_DOWNTIME])
self._CallMonitorCommand(instance_name, migrate_command)
+ # These commands are supported in latest qemu versions.
+ # Since _CallMonitorCommand does not catch monitor errors
+ # this does not raise an exception in case command is not supported
+ # TODO: either parse output of command or see if the command supported
+ # via info help (see hotplug)
+ 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)
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.
+migration\_caps
+ 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.
+
kvm\_path
Valid for the KVM hypervisor.