Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 627178

Summary: Cannot start VM with 12 disks and append a cdrom device at the end of the command line
Product: Red Hat Enterprise Linux 6 Reporter: Cao, Chen <kcao>
Component: qemu-kvmAssignee: Virtualization Maintenance <virt-maint>
Status: CLOSED DUPLICATE QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: low    
Version: 6.0CC: kwolf, lcapitulino, mkenneth, virt-maint
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-08-26 13:27:25 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Cao, Chen 2010-08-25 10:08:03 UTC
Description of problem:
seems that qemu-kvm failed to parse/save the command line info.

VM can be launched successfully if the params for the cdrom is at
the beginning of the command line.


Version-Release number of selected component (if applicable):
qemu-kvm-0.12.1.2-2.113.el6.x86_64


How reproducible:
100%

Steps to Reproduce:
1. start vm with command:
qemu-kvm -name 'vm1' \
-chardev socket,id=human_monitor_UrYk,path=/tmp/monitor-humanmonitor1-20100821-002100-V75Q,server,nowait \
-mon chardev=human_monitor_UrYk,mode=readline \
-drive file='images/win2008-32-virtio.qcow2',if=none,id=drive-virtio-disk1,media=disk,cache=none,boot=on,format=qcow2,aio=native \
-device virtio-blk-pci,bus=pci.0,addr=0x4,drive=drive-virtio-disk1,id=virtio-disk1 \
-drive file='images/storage.qcow2',if=none,id=drive-virtio-disk2,media=disk,cache=none,format=qcow2,aio=native \
-device virtio-blk-pci,bus=pci.0,addr=0x5,drive=drive-virtio-disk2,id=virtio-disk2 \
-drive file='images/storage2.qcow2',if=none,id=drive-virtio-disk3,media=disk,cache=none,format=qcow2,aio=native \
-device virtio-blk-pci,bus=pci.0,addr=0x6,drive=drive-virtio-disk3,id=virtio-disk3 \
-drive file='images/storage3.qcow2',if=none,id=drive-virtio-disk4,media=disk,cache=none,format=qcow2,aio=native \
-device virtio-blk-pci,bus=pci.0,addr=0x7,drive=drive-virtio-disk4,id=virtio-disk4 \
-drive file='images/storage4.qcow2',if=none,id=drive-virtio-disk5,media=disk,cache=none,format=qcow2,aio=native \
-device virtio-blk-pci,bus=pci.0,addr=0x8,drive=drive-virtio-disk5,id=virtio-disk5 \
-drive file='images/storage5.qcow2',if=none,id=drive-virtio-disk6,media=disk,cache=none,format=qcow2,aio=native \
-device virtio-blk-pci,bus=pci.0,addr=0x9,drive=drive-virtio-disk6,id=virtio-disk6 \
-drive file='images/storage6.qcow2',if=none,id=drive-virtio-disk7,media=disk,cache=none,format=qcow2,aio=native \
-device virtio-blk-pci,bus=pci.0,addr=0xa,drive=drive-virtio-disk7,id=virtio-disk7 \
-drive file='images/storage7.qcow2',if=none,id=drive-virtio-disk8,media=disk,cache=none,format=qcow2,aio=native \
-device virtio-blk-pci,bus=pci.0,addr=0xb,drive=drive-virtio-disk8,id=virtio-disk8 \
-drive file='images/storage8.qcow2',if=none,id=drive-virtio-disk9,media=disk,cache=none,format=qcow2,aio=native \
-device virtio-blk-pci,bus=pci.0,addr=0xc,drive=drive-virtio-disk9,id=virtio-disk9 \
-drive file='images/storage9.qcow2',if=none,id=drive-virtio-disk10,media=disk,cache=none,format=qcow2,aio=native \
-device virtio-blk-pci,bus=pci.0,addr=0xd,drive=drive-virtio-disk10,id=virtio-disk10 \
-drive file='images/storage10.qcow2',if=none,id=drive-virtio-disk11,media=disk,cache=none,format=qcow2,aio=native \
-device virtio-blk-pci,bus=pci.0,addr=0xe,drive=drive-virtio-disk11,id=virtio-disk11 \
-drive file='images/storage11.qcow2',if=none,id=drive-virtio-disk12,media=disk,cache=none,format=qcow2,aio=native \
-device virtio-blk-pci,bus=pci.0,addr=0xf,drive=drive-virtio-disk12,id=virtio-disk12 \
-device virtio-net-pci,netdev=idP02PX9,id=ndev00idP02PX9,mac='02:77:09:7F:a2:86',bus=pci.0,addr=0x3 -netdev tap,id=idP02PX9,ifname='virtio_0_8000',script='qemu-ifup-switch',downscript='no' \
-m 2048 -smp 2 \
-drive file='winutils.iso',index=1,if=none,id=drive-ide0-0-0,media=cdrom,readonly=on,format=raw \
-device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
-cpu qemu64,+sse2 -vnc :11 \
-rtc base=localtime,clock=host,driftfix=none -M rhel6.0.0 \
-usbdevice tablet

2.
3.
  
Actual results:
qemu-kvm quits with error msg:
qemu-kvm: -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0: Property 'ide-drive.drive' can't find value 'drive-ide0-0-0'


Expected results:
guest is launched successfully with 12 disks and one cdrom.


Additional info:
if put the cdrom part of command before the hard disk part, everything goes well.
i.e. the following command will succeed:
qemu-kvm -name 'vm1' \
-chardev socket,id=human_monitor_UrYk,path=/tmp/monitor-humanmonitor1-20100821-002100-V75Q,server,nowait \
-mon chardev=human_monitor_UrYk,mode=readline \
-drive file='images/win2008-32-virtio.qcow2',if=none,id=drive-virtio-disk1,media=disk,cache=none,boot=on,format=qcow2,aio=native \
-device virtio-blk-pci,bus=pci.0,addr=0x4,drive=drive-virtio-disk1,id=virtio-disk1 \
-drive file='winutils.iso',index=1,if=none,id=drive-ide0-0-0,media=cdrom,readonly=on,format=raw \
-device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
-drive file='images/storage.qcow2',if=none,id=drive-virtio-disk2,media=disk,cache=none,format=qcow2,aio=native \
-device virtio-blk-pci,bus=pci.0,addr=0x5,drive=drive-virtio-disk2,id=virtio-disk2 \
-drive file='images/storage2.qcow2',if=none,id=drive-virtio-disk3,media=disk,cache=none,format=qcow2,aio=native \
-device virtio-blk-pci,bus=pci.0,addr=0x6,drive=drive-virtio-disk3,id=virtio-disk3 \
-drive file='images/storage3.qcow2',if=none,id=drive-virtio-disk4,media=disk,cache=none,format=qcow2,aio=native \
-device virtio-blk-pci,bus=pci.0,addr=0x7,drive=drive-virtio-disk4,id=virtio-disk4 \
-drive file='images/storage4.qcow2',if=none,id=drive-virtio-disk5,media=disk,cache=none,format=qcow2,aio=native \
-device virtio-blk-pci,bus=pci.0,addr=0x8,drive=drive-virtio-disk5,id=virtio-disk5 \
-drive file='images/storage5.qcow2',if=none,id=drive-virtio-disk6,media=disk,cache=none,format=qcow2,aio=native \
-device virtio-blk-pci,bus=pci.0,addr=0x9,drive=drive-virtio-disk6,id=virtio-disk6 \
-drive file='images/storage6.qcow2',if=none,id=drive-virtio-disk7,media=disk,cache=none,format=qcow2,aio=native \
-device virtio-blk-pci,bus=pci.0,addr=0xa,drive=drive-virtio-disk7,id=virtio-disk7 \
-drive file='images/storage7.qcow2',if=none,id=drive-virtio-disk8,media=disk,cache=none,format=qcow2,aio=native \
-device virtio-blk-pci,bus=pci.0,addr=0xb,drive=drive-virtio-disk8,id=virtio-disk8 \
-drive file='images/storage8.qcow2',if=none,id=drive-virtio-disk9,media=disk,cache=none,format=qcow2,aio=native \
-device virtio-blk-pci,bus=pci.0,addr=0xc,drive=drive-virtio-disk9,id=virtio-disk9 \
-drive file='images/storage9.qcow2',if=none,id=drive-virtio-disk10,media=disk,cache=none,format=qcow2,aio=native \
-device virtio-blk-pci,bus=pci.0,addr=0xd,drive=drive-virtio-disk10,id=virtio-disk10 \
-drive file='images/storage10.qcow2',if=none,id=drive-virtio-disk11,media=disk,cache=none,format=qcow2,aio=native \
-device virtio-blk-pci,bus=pci.0,addr=0xe,drive=drive-virtio-disk11,id=virtio-disk11 \
-drive file='images/storage11.qcow2',if=none,id=drive-virtio-disk12,media=disk,cache=none,format=qcow2,aio=native \
-device virtio-blk-pci,bus=pci.0,addr=0xf,drive=drive-virtio-disk12,id=virtio-disk12 \
-device virtio-net-pci,netdev=idP02PX9,id=ndev00idP02PX9,mac='02:77:09:7F:a2:86',bus=pci.0,addr=0x3 -netdev tap,id=idP02PX9,ifname='virtio_0_8000',script='qemu-ifup-switch',downscript='no' \
-m 2048 -smp 2 \
-cpu qemu64,+sse2 -vnc :11 \
-rtc base=localtime,clock=host,driftfix=none -M rhel6.0.0 \
-usbdevice tablet

Comment 1 Luiz Capitulino 2010-08-25 16:15:22 UTC
Did you get this with any of our virt tools? (eg. virt-install, virt-manager etc) or were you playing with qemu-kvm by hand?

It looks like a qdev bug to me, but if it's impossible/hard to get with libvirt (or if there's an easy workaround) this isn't important for rhel6.0.

Comment 3 Luiz Capitulino 2010-08-25 18:45:52 UTC
Okay, I've found the problem and it doesn't look like a bug to me (at least not in qemu).

What's happening is this: in the reporter's command-line, no unit or index options are specified for the virtio devices. This way the unit value is  automatically allocated by qemu, in sequential way.

However, the line specifying the winutils.iso file sets the index to 1. As qemu does unit=index, this value conflicts with the second virtio device (
drive-virtio-disk2) which also got unit=1.

That's why it works when the winutils.iso setup is moved to the beginning of the command-line: qemu will just skip unit=1. It will also work if you drop the index option.

Here's a small command-line with the same problem:

qemu-kvm \
  -drive file=image.qcow2,if=none,id=drive-virtio-disk1 \
  -device virtio-blk-pci,drive=drive-virtio-disk1,id=virtio-disk1 \
  -drive file=i386cd-5.0.2.iso,index=0,if=none,id=foo \
  -device ide-drive,drive=foo,id=ide0-0-0

This doesn't have anything to do with the number of devices. The two most important questions are:

1. Did you get this with one of our tools or were you playing with qemu by hand?

2. Kevin, can you confirm that that's the expected behavior from qemu's side?

Please, note that the error message is wrong anyway. The id is not found because the device wasn't added to the pool. I'll fix that upstream.

Comment 4 Luiz Capitulino 2010-08-25 18:55:53 UTC
For reference: the real failure happens in the drive_get() check at drive_init():392.

Comment 5 Cao, Chen 2010-08-26 01:39:55 UTC
(In reply to comment #1)
> Did you get this with any of our virt tools? (eg. virt-install, virt-manager
> etc) or were you playing with qemu-kvm by hand?

playing with qemu-kvm by hand.

Comment 6 Luiz Capitulino 2010-08-26 13:27:25 UTC
(In reply to comment #5)
> (In reply to comment #1)
> > Did you get this with any of our virt tools? (eg. virt-install, virt-manager
> > etc) or were you playing with qemu-kvm by hand?
> 
> playing with qemu-kvm by hand.

This is not an issue then, just drop 'index' and you're done.

The error message is misleading though, I've opened a new bug for it and will close this one as duplicate.

*** This bug has been marked as a duplicate of bug 627585 ***