Commit 5423b15f authored by Marco Casavecchia (aka MCM)'s avatar Marco Casavecchia (aka MCM) Committed by Helga Velroyen

Added support for disk native AIO mode for KVM

This patch adds support for the native aio on KVM
hypervisor.

Basically, It adds a new HV-KVM optional parameter
"disk_aio" that can be set with the followings values:
threads (the default for KVM) or native. If not set, it
uses the KVM default that is "threads". The patch also
updates the man page for gnt-instance.
Signed-off-by: default avatarMarco Casavecchia (aka MCM) <marcolinuz@gmail.com>
Reviewed-by: default avatarHelga Velroyen <helgav@google.com>
parent bd39f2c1
......@@ -331,6 +331,8 @@ class KVMHypervisor(hv_base.BaseHypervisor):
constants.HV_USE_LOCALTIME: hv_base.NO_CHECK,
constants.HV_DISK_CACHE:
hv_base.ParamInSet(True, constants.HT_VALID_CACHE_TYPES),
constants.HV_KVM_DISK_AIO:
hv_base.ParamInSet(False, constants.HT_KVM_VALID_AIO_TYPES),
constants.HV_SECURITY_MODEL:
hv_base.ParamInSet(True, constants.HT_KVM_VALID_SM_TYPES),
constants.HV_SECURITY_DOMAIN: hv_base.NO_CHECK,
......@@ -895,6 +897,12 @@ class KVMHypervisor(hv_base.BaseHypervisor):
pass
else:
if_val = ",if=%s" % disk_type
# AIO mode
aio_mode = up_hvp[constants.HV_KVM_DISK_AIO]
if aio_mode == constants.HT_KVM_AIO_NATIVE:
aio_val = ",aio=%s" % aio_mode
else:
aio_val = ""
# Cache mode
disk_cache = up_hvp[constants.HV_DISK_CACHE]
if instance.disk_template in constants.DTS_EXT_MIRROR:
......@@ -927,8 +935,8 @@ class KVMHypervisor(hv_base.BaseHypervisor):
else:
drive_uri = link_name
drive_val = "file=%s,format=raw%s%s%s" % \
(drive_uri, if_val, boot_val, cache_val)
drive_val = "file=%s,format=raw%s%s%s%s" % \
(drive_uri, if_val, boot_val, cache_val, aio_val)
if device_driver:
# kvm_disks are the 4th entry of runtime file that did not exist in
......
......@@ -586,6 +586,14 @@ disk\_cache
version of KVM used and disk type (always raw file under Ganeti),
please refer to the KVM documentation for more details.
disk\_aio
Valid for the KVM hypervisor.
This is an optional parameter that specifies the aio mode
for the disks. KVM default is to use the 'threads' mode,
so if not explicitly specified, the native mode will not
be used. Possible values are: threads or native.
security\_model
Valid for the KVM hypervisor.
......
......@@ -1565,6 +1565,9 @@ hvKvmMigrationCaps = "migration_caps"
hvKvmPath :: String
hvKvmPath = "kvm_path"
hvKvmDiskAio :: String
hvKvmDiskAio = "disk_aio"
hvKvmSpiceAudioCompr :: String
hvKvmSpiceAudioCompr = "spice_playback_compression"
......@@ -1749,6 +1752,7 @@ hvsParameterTypes = Map.fromList
, (hvKvmMachineVersion, VTypeString)
, (hvKvmMigrationCaps, VTypeString)
, (hvKvmPath, VTypeString)
, (hvKvmDiskAio, VTypeString)
, (hvKvmSpiceAudioCompr, VTypeBool)
, (hvKvmSpiceBind, VTypeString)
, (hvKvmSpiceIpVersion, VTypeInt)
......@@ -2588,6 +2592,17 @@ htValidCacheTypes =
htCacheWback,
htCacheWthrough]
htKvmAioThreads :: String
htKvmAioThreads = "threads"
htKvmAioNative :: String
htKvmAioNative = "native"
htKvmValidAioTypes :: FrozenSet String
htKvmValidAioTypes =
ConstantUtils.mkSet [htKvmAioThreads,
htKvmAioNative]
-- * Mouse types
htMouseMouse :: String
......@@ -3765,6 +3780,7 @@ hvcDefaults =
, (hvNicType, PyValueEx htNicParavirtual)
, (hvDiskType, PyValueEx htDiskParavirtual)
, (hvKvmCdromDiskType, PyValueEx "")
, (hvKvmDiskAio, PyValueEx htKvmAioThreads)
, (hvUsbMouse, PyValueEx "")
, (hvKeymap, PyValueEx "")
, (hvMigrationPort, PyValueEx (8102 :: Int))
......
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