This will allow the user to explicitly set the type of SCSI controller to use. The available types are: lsi, virtio-scsi-pci, and megasas. QEMU uses lsi by default and so does Ganeti.
Signed-off-by: Dimitris Aragiorgis <[email protected]> --- lib/hypervisor/hv_kvm/__init__.py | 9 +++++++-- man/gnt-instance.rst | 11 +++++++++++ src/Ganeti/Constants.hs | 22 ++++++++++++++++++++++ 3 files changed, 40 insertions(+), 2 deletions(-) diff --git a/lib/hypervisor/hv_kvm/__init__.py b/lib/hypervisor/hv_kvm/__init__.py index 5d345c1..fa7f7b3 100644 --- a/lib/hypervisor/hv_kvm/__init__.py +++ b/lib/hypervisor/hv_kvm/__init__.py @@ -455,6 +455,8 @@ class KVMHypervisor(hv_base.BaseHypervisor): hv_base.ParamInSet(True, constants.HT_KVM_VALID_NIC_TYPES), constants.HV_DISK_TYPE: hv_base.ParamInSet(True, constants.HT_KVM_VALID_DISK_TYPES), + constants.HV_KVM_SCSI_CONTROLLER_TYPE: + hv_base.ParamInSet(True, constants.HT_KVM_VALID_SCSI_CONTROLLER_TYPES), constants.HV_KVM_CDROM_DISK_TYPE: hv_base.ParamInSet(False, constants.HT_KVM_VALID_DISK_TYPES), constants.HV_USB_MOUSE: @@ -1199,11 +1201,14 @@ class KVMHypervisor(hv_base.BaseHypervisor): soundhw = hvp[constants.HV_SOUNDHW] kvm_cmd.extend(["-soundhw", soundhw]) - if hvp[constants.HV_DISK_TYPE] == constants.HT_DISK_SCSI: + if hvp[constants.HV_DISK_TYPE] in _SCSI_DEVICES: # In case a SCSI disk is given, QEMU adds # a SCSI contorller (LSI Logic / Symbios Logic 53c895a) # automatically. Here, we add it explicitly with the default id. - kvm_cmd.extend(["-device", "lsi,id=scsi"]) + kvm_cmd.extend([ + "-device", + "%s,id=scsi" % hvp[constants.HV_KVM_SCSI_CONTROLLER_TYPE] + ]) kvm_cmd.extend(["-balloon", "virtio"]) kvm_cmd.extend(["-daemonize"]) diff --git a/man/gnt-instance.rst b/man/gnt-instance.rst index 7418cad..7794df7 100644 --- a/man/gnt-instance.rst +++ b/man/gnt-instance.rst @@ -333,6 +333,17 @@ vif\_type - ioemu - vif +scsi\_controller\_type + Valid for the KVM hypervisor. + + This parameter specifies which type of SCSI controller to use. + The possible options are: + + - lsi [default] + - megasas + - virtio-scsi-pci + + disk\_type Valid for the Xen HVM and KVM hypervisors. diff --git a/src/Ganeti/Constants.hs b/src/Ganeti/Constants.hs index 1c9e16c..947fc44 100644 --- a/src/Ganeti/Constants.hs +++ b/src/Ganeti/Constants.hs @@ -1697,6 +1697,9 @@ hvKvmPath = "kvm_path" hvKvmDiskAio :: String hvKvmDiskAio = "disk_aio" +hvKvmScsiControllerType :: String +hvKvmScsiControllerType = "scsi_controller_type" + hvKvmSpiceAudioCompr :: String hvKvmSpiceAudioCompr = "spice_playback_compression" @@ -1903,6 +1906,7 @@ hvsParameterTypes = Map.fromList , (hvKvmMigrationCaps, VTypeString) , (hvKvmPath, VTypeString) , (hvKvmDiskAio, VTypeString) + , (hvKvmScsiControllerType, VTypeString) , (hvKvmSpiceAudioCompr, VTypeBool) , (hvKvmSpiceBind, VTypeString) , (hvKvmSpiceIpVersion, VTypeInt) @@ -2755,6 +2759,23 @@ htKvmValidDiskTypes = htDiskScsiHd, htDiskScsiCd] +-- * SCSI controller types + +htScsiControllerLsi :: String +htScsiControllerLsi = "lsi" + +htScsiControllerVirtio :: String +htScsiControllerVirtio = "virtio-scsi-pci" + +htScsiControllerMegasas :: String +htScsiControllerMegasas = "megasas" + +htKvmValidScsiControllerTypes :: FrozenSet String +htKvmValidScsiControllerTypes = + ConstantUtils.mkSet [htScsiControllerLsi, + htScsiControllerVirtio, + htScsiControllerMegasas] + htCacheDefault :: String htCacheDefault = "default" @@ -4029,6 +4050,7 @@ hvcDefaults = , (hvVncX509, PyValueEx "") , (hvVncX509Verify, PyValueEx False) , (hvVncPasswordFile, PyValueEx "") + , (hvKvmScsiControllerType, PyValueEx htScsiControllerLsi) , (hvKvmSpiceBind, PyValueEx "") , (hvKvmSpiceIpVersion, PyValueEx ifaceNoIpVersionSpecified) , (hvKvmSpicePasswordFile, PyValueEx "") -- 1.7.10.4
