Bug 821665

Summary: unclear error message: qemu should report 'lsi' is not supported
Product: Red Hat Enterprise Linux 6 Reporter: weizhang <weizhan>
Component: libvirtAssignee: Gunannan Ren <gren>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.3CC: acathrow, berrange, bsarathy, dallan, dyasny, dyuan, eblake, gsun, honzhang, juzhang, jyang, mkenneth, mzhan, pbonzini, rwu, tburke, virt-maint
Target Milestone: rcKeywords: Reopened
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-0.10.0-0rc1.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-21 07:13:00 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description weizhang 2012-05-15 10:09:38 UTC
Description of problem:
When do scalability test, I want to start 1024 disks with virtio scsi controller, in qemu-kvm side they can start a guest with multiple scsi disks with LUN logical unit, which can assign 16384 luns with 1 scsi-id, but with libvirt, if attach more than 7 scsi disks, it will automatically add another controller without model. 

Version-Release number of selected component (if applicable):
kernel-2.6.32-269.el6.x86_64
qemu-kvm-0.12.1.2-2.290.el6.x86_64
libvirt-0.9.10-19.el6.x86_64


How reproducible:
100%

Steps to Reproduce:
1. start a guest with multiple scsi disks(>7) with the similar xml of each like
    <disk type='block' device='lun'>
      <driver name='qemu' type='raw'/>
      <source dev='/dev/sdc'/>
      <target dev='sda' bus='scsi'/>
    </disk>

also need to add a scsi controller in the guest
    <controller type='scsi' index='0' model='virtio-scsi'/>

2. dumpxml guest, 1 more controller generated without model
    <controller type='scsi' index='1'>
    </controller>

3.
  
Actual results:
Step 1 report error
error: Failed to start domain kvm-rhel6u3-x86_64
error: internal error Process exited while reading console log output: char device redirected to /dev/pts/3
qemu-kvm: -device lsi,id=scsi1,bus=pci.0,addr=0x7: Parameter 'driver' expects a driver name
Try with argument '?' for a list.


Expected results:
should succeed without error and can start more than 1024 scsi disks with 1 controller with lun logical unit

Additional info:

Comment 1 Daniel Berrangé 2012-05-15 10:19:25 UTC
If you don't specify a model for the SCSI controller, it uses the defalt which is 'lsi'. Unfortunately RHEL builds of KVM have removed support for this model. This (horrible) error message from KVM is actually telling you that 'lsi' is not supported.

If you want to use multiple virtio-scsi controllers, you should explicitly add multiple <controller> elements requesting virtio-scsi explicitly.

Comment 2 weizhang 2012-05-15 11:05:33 UTC
(In reply to comment #1)
> If you don't specify a model for the SCSI controller, it uses the defalt which
> is 'lsi'. Unfortunately RHEL builds of KVM have removed support for this model.
> This (horrible) error message from KVM is actually telling you that 'lsi' is
> not supported.
> 
> If you want to use multiple virtio-scsi controllers, you should explicitly add
> multiple <controller> elements requesting virtio-scsi explicitly.

But for lun logical unit, it can accept more than 7 lun for 1 scsi-id like

-device scsi-block,drive=disk0,scsi-id=0,lun=0 \
-device scsi-block,drive=disk1,scsi-id=0,lun=1 \
-device scsi-block,drive=disk2,scsi-id=0,lun=2 \
-device scsi-block,drive=disk3,scsi-id=0,lun=3 \
-device scsi-block,drive=disk4,scsi-id=0,lun=4 \
-device scsi-block,drive=disk5,scsi-id=0,lun=5 \
-device scsi-block,drive=disk6,scsi-id=0,lun=6 \
-device scsi-block,drive=disk7,scsi-id=0,lun=7 \
-device scsi-block,drive=disk8,scsi-id=0,lun=8 \
-device scsi-block,drive=disk9,scsi-id=0,lun=9 \
-device scsi-block,drive=disk10,scsi-id=0,lun=10 \
-device scsi-block,drive=disk11,scsi-id=0,lun=11 \

in qemu-kvm, we can not implement it with libvirt.

Comment 3 Daniel Berrangé 2012-05-15 11:12:39 UTC
Automatic address assignment in libvirt assumes 7 luns per controller, if you want to go beyond that then you should specify the <address type="scsi" ..../> address details explicitly.

Comment 6 Dave Allan 2012-05-15 15:20:11 UTC
I'm reopening so that the qemu error can be improved.

Comment 8 RHEL Program Management 2012-07-10 06:27:06 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 9 RHEL Program Management 2012-07-11 02:08:00 UTC
This request was erroneously removed from consideration in Red Hat Enterprise Linux 6.4, which is currently under development.  This request will be evaluated for inclusion in Red Hat Enterprise Linux 6.4.

Comment 10 Paolo Bonzini 2012-07-20 13:41:11 UTC
Couldn't the error message be improved in libvirt instead?  libvirt already reports errors for all other models that are invalid for qemu.

Comment 11 Dave Allan 2012-07-20 13:49:41 UTC
I don't think it can; all libvirt knows is that qemu has exited, right?  If there is a way for libvirt to be deterministic about what went wrong, I'm happy to fix it there, but I don't know of any way.  Also, I don't think this error is any more helpful for anybody starting qemu from the command line than it is for libvirt users.

Comment 12 Paolo Bonzini 2012-07-20 14:13:59 UTC
I asked because I noticed libvirt doing something similar for usbredir:

    if (!qemuCapsGet(qemuCaps, QEMU_CAPS_USB_REDIR)) {
        qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
                        _("USB redirection is not supported "
                          "by this version of QEMU"));
        goto error;
    }

Can be fixed in QEMU too, marking as Capacity.

Comment 13 Dave Allan 2012-07-20 14:26:42 UTC
Yeah, so that was my question--does qemu report that lsi isn't supported in a way that we can gather it into the caps?

Comment 14 Paolo Bonzini 2012-07-20 16:03:42 UTC
Yes,

name "lsi53c895a", bus PCI, alias "lsi"

is present in the output of "qemu -device ?" iff the device is supported.

Comment 15 Dave Allan 2012-07-20 16:17:57 UTC
Eric, do we keep info like supported devices in caps?

Comment 16 Eric Blake 2012-07-20 16:22:30 UTC
We have in the past - we already do a 'qemu -device ?' when computing qemu caps, so it wouldn't be too hard to add another cap and use that to improve our error message.

Comment 17 Dave Allan 2012-07-20 16:57:56 UTC
Ok, thanks all.  I like the error message better from libvirt, so I'm moving back to libvirt.

Comment 18 Gunannan Ren 2012-08-07 06:54:28 UTC
On qemu-kvm-0.15.1, it supports only lsi scsi controller model.
On qemu-kvm-0.12.1.2, it supports only virtio-scsi-pci scsi model
On qemu 1.1.50, it supports both.
So, instead of using the lsilogic model by default, the patch tries
to check which model the current QEMU supports, then choose it, lsi
has the priority.

If a scsi model is given in XML explicitly, we try to check if
the underlying QEMU supports it or not, raise an error on checking
failure.

Patch sent to upstream
https://www.redhat.com/archives/libvir-list/2012-August/msg00414.html

Comment 19 Gunannan Ren 2012-08-08 07:26:13 UTC
commit 015c603bcd854b0c8d7ebf613e8f2ebe14c254be
Author: Guannan Ren <gren>
Date:   Wed Aug 8 15:06:33 2012 +0800

    qemu: add two qemu caps for lsi and virtio-scsi SCSI controllers
    
    Rename qemuDefaultScsiControllerModel to qemuCheckScsiControllerModel.
    When scsi model is given explicitly in XML(model > 0) checking if the
    underlying QEMU supports it or not first, raise an error on checking
    failure.
    When the model is not given(mode <= 0), return LSI by default, if
    the QEMU doesn't support it, raise an error.

commit 8694c716ae64a62f3452ed732ef3f74b929aabe8
Author: Guannan Ren <gren>
Date:   Wed Aug 8 14:25:24 2012 +0800

    qemu: add capabilities flags related to scsi controller
    
      QEMU_CAPS_SCSI_LSI
        set the flag when "lsi53c895a", bus PCI, alias "lsi" in
        the output of "qemu -device ?"
        -device lsi in qemu command line
    
      QEMU_CAPS_VIRTIO_SCSI_PCI
        set the flag when "name "virtio-scsi-pci", bus PCI" in
        the output of qemu devices query.
        -device virtio-scsi-pci in qemu command line

Comment 21 hongming 2012-08-27 03:44:26 UTC
Verified it using the following versions. The result is expected.So move its status to VERIFIED.

libvirt-0.10.0-0rc1.el6.x86_64
qemu-kvm-0.12.1.2-2.295.el6.x86_64


Steps
1.# cat rhel6.2.xml
<domain type='kvm'>
......
    <controller type='scsi' index='0' model='lsilogic'/>
......
</domain>


2. # virsh define rhel6.2.xml
error: Failed to define domain from rhel6.2.xml
error: unsupported configuration: This QEMU doesn't support lsi scsi controller


3. Change the model to "virtio-scsi"
# cat rhel6.2.xml
<domain type='kvm'>
......
    <controller type='scsi' index='0' model='virtio-scsi'/>
......
</domain>


4.# virsh define rhel6.2.xml
Domain rhel6.2 defined from rhel6.2.xml


5.# virsh start rhel6.2
Domain rhel6.2 started


6.# virsh edit rhel6.2 ,and Change the model to "lsilogic".


7.# Save it
# virsh edit rhel6.2
error: unsupported configuration: This QEMU doesn't support lsi scsi controller
Failed. Try again? [y,n,f,?]:

Comment 22 errata-xmlrpc 2013-02-21 07:13:00 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2013-0276.html