Bug 1379196
| Summary: | Provide proper error message if lun device + scsi bus does not work with qcow2 format | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Yang Yang <yanyang> |
| Component: | libvirt | Assignee: | John Ferlan <jferlan> |
| Status: | CLOSED ERRATA | QA Contact: | lijuan men <lmen> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | low | ||
| Version: | 7.3 | CC: | dyuan, jferlan, laine, lcheng, lmen, pbonzini, pzhang, rbalakri, xuzhang |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | libvirt-2.5.0-1.el7 | Doc Type: | Bug Fix |
| Doc Text: |
Cause: Incorrectly configured XML for disk device causes qemu error on start.
Consequence: Domain would fail to start with QEMU error.
Fix: Add a check for a disk configuration using a block, lun device and the scsi bus using a non raw format for the device.
Result: Error message from libvirt is displayed: "disk device 'lun' using target 'scsi' must use 'raw' format"
|
Story Points: | --- |
| Clone Of: | Environment: | ||
| Last Closed: | 2017-08-01 17:16:43 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: | |||
Paolo, Was this always an illegal combination? Is it a requirement that the device be backed by real SCSI hardware in order for scsi=on to be useful? This is not scsi=on, it's using virtio-scsi. This one has always been illegal (it wasn't illegal for virtio-blk SCSI support, and that's one reason why it was messy). The following doesn't fail: <disk type='block' device='lun'> <driver name='qemu' type='raw' cache='none'/> <source dev='/dev/sdi'/> <target dev='sda' bus='scsi'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> <controller type='scsi' index='0' model='virtio-scsi'/> ... in a running VM:... -drive file=/dev/sdi,format=raw,if=none,id=drive-scsi0-0-0-0,cache=none -device scsi-block,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0-0-0-0,id=scsi0-0-0-0 ... However, by just using a qcow2 formatted /dev/sdj - that is a failure... Yuck, makes an ugly libvirt check! and of course I hit save too fast... Using: <disk type='block' device='lun'> <driver name='qemu' type='qcow2' cache='none'/> <source dev='/dev/sdj'/> <target dev='vdd' bus='virtio'/> </disk> succeeds as well. So that matches the virtio-blk comment. Still, the question for Paolo is, would it be a "safe" assumption then to say that only "<driver ... type='raw'.../>" may be used when "<disk type='block' device='lun'> and "<target ... bus='scsi'/>" (IOW: 'scsi-block')? I see that qcow2 and qed certainly don't work. History on what can be used seems to be sparse and rather than continue to get bz's on "this format doesn't work", it just seems like a larger hammer is required. In qemu format - does only 'raw' work for the following: -device virtio-scsi-pci,id=scsi0,bus=pci.0,addr=0x9 -drive file=/dev/sdj,format=%s,if=none,id=drive=scsi0-0-0-0,cache=none [where %s is raw, dir, bochs, cloop, dmg, iso, vpc, vdi, fat, vhd, ploop, cow, qcow, qcow2, qed, or vmdk] -device scsi-block,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0-0-0-0,id=scsi0-0-0-0 > would it be a "safe" assumption then to say that only "<driver ...
> type='raw'.../>" may be used when "<disk type='block' device='lun'>
> and "<target ... bus='scsi'/>"
Yes, it's a safe assumption. Anything else shouldn't start at all (for bus='scsi') or only starts because of historical reasons (for bus='virtio').
Patch posted upstream: http://www.redhat.com/archives/libvir-list/2016-November/msg00388.html and pushed after ACK: $ git show commit f694f3ff6bd8a94d71582adab669b0dcd1f7bfe5 Author: John Ferlan <jferlan> Date: Mon Oct 31 15:44:34 2016 -0400 qemu: Only allow 'raw' format for scsi-block using virtio-scsi ... Add check in qemuCheckDiskConfig for an invalid combination of using the 'scsi' bus for a block 'lun' device and any disk source format other than 'raw'. $ git describe f694f3ff6bd8a94d71582adab669b0dcd1f7bfe5 v2.4.0-29-gf694f3f $ verify the bug
version:
libvirt-3.0.0-1.el7.x86_64
qemu-kvm-rhev-2.8.0-3.el7.x86_64
steps:
1.prepare another partition in the host,such as sdb.
2.change the format of the partition as qcow2
#qemu-img convert /dev/sdb -O qcow2 /dev/sdb
3.start a guest with the xml:
...
<disk type='block' device='lun'>
<driver name='qemu' type='qcow2' cache='none'/>
<source dev='/dev/sdb'/>
<target dev='sdd' bus='scsi'/>
<address type='drive' controller='0' bus='0' target='0' unit='3'/>
</disk>
...
<controller type='scsi' index='0' model='virtio-scsi'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
</controller>
...
# virsh start qq
error: Failed to start domain qq
error: unsupported configuration: disk device 'lun' using target 'scsi' must use 'raw' format
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. https://access.redhat.com/errata/RHEA-2017:1846 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. https://access.redhat.com/errata/RHEA-2017:1846 |
Description of problem: QEMU error out when starting vm with lun device + qcow2 format + scsi bus. And the error message does not clear enough. Libvirt should provide proper error message if lun device + scsi bus does not work with qcow2 format Version-Release number of selected component (if applicable): libvirt-2.0.0-10.el7.x86_64 qemu-kvm-rhev-2.6.0-27.el7.x86_64 How reproducible: 100% Steps to Reproduce: 1. start vm with lun device + qcow2 format + scsi bus <disk type='block' device='lun'> <driver name='qemu' type='qcow2' cache='none'/> <source dev='/dev/sdl'/> <target dev='sda' bus='scsi'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> #virsh start vm1 error: Failed to start domain vm1 error: internal error: qemu unexpectedly closed the monitor: 2016-09-26T02:34:47.304915Z qemu-kvm: -device scsi-block,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0-0-0-0,id=scsi0-0-0-0,bootindex=1: cannot get SG_IO version number: Operation not supported. Is this a SCSI device? 2. 3. Actual results: Qemu error out when starting vm with lun device + qcow2 format + scsi bus Expected results: Libvirt provides proper error message if lun device + scsi bus does not work with qcow2 format Additional info: