On Tue, Sep 1, 2015 at 8:28 PM, Dimitris Aragiorgis < [email protected]> wrote:
> * Hrvoje Ribicic <[email protected]> [2015-09-01 12:48:17 +0200]: > > > On Tue, Aug 18, 2015 at 12:07 PM, Dimitris Aragiorgis < > > [email protected]> wrote: > > > > > 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: > > > > > > > Wasn't this supposed to be a part of an earlier patch? > > Probably the other way around. > Then perhaps it'd be better to move the change here to unburden the huge patch 2, if it does not lead you to a hell of rebasing :) > > > > > Also, should the HT_DISK_SCSI be added into _SCSI_DEVICES for backward > > compatibility? > > > > For proper background compatibility we should not add the extra -device > option in case of 'scsi' disk type. So the previous change that adds > explicitly the lsi controller should moved here (and of course use the > hvparam instead of hardcoding it). > Understood, thanks! > > > > > > # 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 > > > > > > > > Hrvoje Ribicic > > Ganeti Engineering > > Google Germany GmbH > > Dienerstr. 12, 80331, München > > > > Geschäftsführer: Graham Law, Christine Elizabeth Flores > > Registergericht und -nummer: Hamburg, HRB 86891 > > Sitz der Gesellschaft: Hamburg > Hrvoje Ribicic Ganeti Engineering Google Germany GmbH Dienerstr. 12, 80331, München Geschäftsführer: Graham Law, Christine Elizabeth Flores Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg
