Bug 712266
Summary: | Hotplug virtio disk fails with error message "Duplicate ID 'drive-virtio-disk2' for drive" | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | Min Zhan <mzhan> |
Component: | libvirt | Assignee: | Osier Yang <jyang> |
Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | high | Docs Contact: | |
Priority: | medium | ||
Version: | 6.2 | CC: | dallan, dyuan, gsun, mzhan, nigil, veillard, weizhan |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | libvirt-0.9.9-1.el6 | Doc Type: | Bug Fix |
Doc Text: |
No documentaion needed.
|
Story Points: | --- |
Clone Of: | Environment: | ||
Last Closed: | 2012-06-20 06:28:15 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
Min Zhan
2011-06-10 03:21:44 UTC
Sounds like either a libvirt or qemu issue. Reassigning to libvirt. Hi, mzhan, Could you paste the qemu command line for this testing domain? # /var/log/libvirt/qemu/rhel6cd.log 2011-06-09 14:04:44.306: starting up LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin QEMU_AUDIO_DRV=none /usr/libexec/qemu-kvm -S -M rhel6.1.0 -enable-kvm -m 1024 -smp 1,sockets=1,cores=1,threads=1 -name rhel6cd -uuid 1b2822fa-3c59-f66c-d662-cbf389403bb9 -nodefconfig -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/rhel6cd.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -boot c -drive file=/var/lib/libvirt/images/rhel6cd.img,if=none,id=drive-virtio-disk0,format=raw,cache=none,aio=threads -device virtio-blk-pci,bus=pci.0,addr=0x5,drive=drive-virtio-disk0,id=virtio-disk0 -drive if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw -device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -drive file=/var/lib/libvirt/images/a4.img,if=none,id=drive-virtio-disk1,format=qcow2,cache=writeback -device virtio-blk-pci,bus=pci.0,addr=0x8,drive=drive-virtio-disk1,id=virtio-disk1 -netdev tap,fd=23,id=hostnet0,vhost=on,vhostfd=27 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:10:e9:7b,bus=pci.0,addr=0x3 -netdev tap,fd=28,id=hostnet1 -device e1000,netdev=hostnet1,id=net1,mac=52:54:00:61:5a:46,bus=pci.0,addr=0x7 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -usb -device usb-tablet,id=input0 -vnc 127.0.0.1:2 -vga cirrus -device intel-hda,id=sound0,bus=pci.0,addr=0x4 -device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x6 char device redirected to /dev/pts/3 Using CPU model "cpu64-rhel6" Actually you just see the second error, the first error is: # virsh attach-device rhel6cd /var/lib/libvirt/images/http-virtio-disk.xml Error:..... Error:operation failed: drive hotplug is not supported # virsh attach-device rhel6cd /var/lib/libvirt/images/http-virtio-disk.xml Error:.... Error:internal error unable to execute QEMU command '__com.redhat_drive_add': Duplicate ID 'drive-virtio-disk2' for drive And actually the disk was attached successfully with command "__com.redhat_drive_add" in the first time. # nc -U /var/lib/libvirt/qemu/rhel6cd.monitor {"execute":"qmp_capabilities"} {"execute":"query-block"} {"return": [{"device": "drive-virtio-disk0", "locked": false, "removable": false, "inserted": {"ro": false, "drv": "raw", "encrypted": false, "file": "/var/lib/libvirt/images/cdrom.img"}, "type": "hd"}, {"device": "drive-ide0-1-0", "locked": false, "removable": true, "type": "cdrom"}, {"device": "drive-virtio-disk1", "locked": false, "removable": false, "inserted": {"ro": false, "drv": "qcow2", "encrypted": false, "file": "/var/lib/libvirt/images/a4.img"}, "type": "hd"}, {"device": "drive-virtio-disk2", "locked": false, "removable": false, "inserted": {"ro": false, "drv": "raw", "encrypted": false, "file": "/var/lib/libvirt/images/http.img"}, "type": "hd"}]} Problem "drive hotplug is not supported" is duplicated with https://bugzilla.redhat.com/show_bug.cgi?id=712050, and the "Duplicate ID" problem was fixed along with the patch for 712050. Following is the diff which fixes the "Duplicate ID" problem. --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -2395,7 +2395,8 @@ int qemuMonitorJSONAddDrive(qemuMonitorPtr mon, VIR_DEBUG0("__com.redhat_drive_add command not found," " trying upstream way"); - } else if ((ret = qemuMonitorJSONCheckError(cmd, reply)) < 0) { + } else { + ret = qemuMonitorJSONCheckError(cmd, reply); goto cleanup; } Per above comments, move to POST. # rpm -q libvirt qemu-kvm libvirt-0.9.9-1.el6.x86_64 qemu-kvm-0.12.1.2-2.213.el6.x86_64 virt-manager-0.9.0-7.el6.x86_64 # cat attach.xml <disk type='file' device='disk'> <driver name='qemu' type='raw'/> <source file='/var/lib/libvirt/images/foo.img'/> <target dev='vdc' bus='virtio'/> </disk> # virsh list Id Name State ---------------------------------- 53 rhel6u2 running # virsh detach-device rhel6u2 attach.xml Device detached successfully Also tried with virt-manager, attach virtio disk works fine. So, this is fixed. Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: No documentaion needed. 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-2012-0748.html The bug is still valid for RHEL6.3. I have the following packages which is same/higher as said in Errata. [root@lnx132-75 new]# lsb_release -r Release: 6.3 [root@lnx132-75 new]# rpm -q libvirt qemu-kvm libvirt-0.9.10-21.el6.x86_64 qemu-kvm-0.12.1.2-2.295.el6.x86_64 I saw the issue when I tried to hotplug a disk in RHEL 5.9 VM. Neither the errata "http://rhn.redhat.com/errata/RHSA-2012-0748.html" nor the technical notes for RHEL6.3 discuss this issue. So is the code changes missed some where in the release path or not yet fixed? Please move the bug status accordingly. Errata RHSA-2012-0748, contains the bug info and says as fixed. But issue I found with RHEL 5.9 VM/Guest. I used to virt-manager to attach disk. Found the same problem(duplicate ID) even with Windows VMs too for the hypervisor RHEL6.3 KVM. (In reply to comment #16) > Found the same problem(duplicate ID) even with Windows VMs too for the > hypervisor RHEL6.3 KVM. Did you install virtio-win driver in windows guest? For rhel5.9 guest, did you run: # modprobe acpiphp before you attach/detach disk? I just tried with libvirt-0.9.10-21.el6_3.8.x86_64 it works fine with rhel5.9 guest disk hotplug, I'll contiue with winxp next. winxp also works fine for me. Hi, I am getting this issue in random. Today I got it again when I am working with Windows Vista. in VM ie Windows Vista, virtio win scsi driver is installed. [root@lnx132-75 new]# lsb_release -r Release: 6.3 [root@lnx132-75 new]# rpm -q libvirt qemu-kvm libvirt-0.9.10-21.el6.x86_64 qemu-kvm-0.12.1.2-2.295.el6.x86_64 Scenario: 1. Hotplug a qcow2 virtual disk of 10G to Windows Vista-64Bit guest OS. 2. Format in NTFS and run IO. IOs happening successfully and Size increasing as the IOs happening(qcow2 thin provisioning). 3. Stop IO. 4. Remove virtual disk. 5. Hotplug the same qcow2 virtual disk to the same VM, Below error occurs: Are you Sure you want to add this device? This device could not be attached to the running machine. Would you like to make the device available after the next guest shutdown? internal error unable to execute QEMU command '__com.redhat_drive_add': Duplicate ID 'drive-virtio-disk1' for drive Traceback (most recent call last): File "/usr/share/virt-manager/virtManager/addhardware.py", line 1033, in add_device self.vm.attach_device(self._dev) File "/usr/share/virt-manager/virtManager/domain.py", line 711, in attach_device self._backend.attachDevice(devxml) File "/usr/lib64/python2.6/site-packages/libvirt.py", line 400, in attachDevice if ret == -1: raise libvirtError ('virDomainAttachDevice() failed', dom=self) libvirtError: internal error unable to execute QEMU command '__com.redhat_drive_add': Duplicate ID 'drive-virtio-disk1' for drive I have verified comment#19 with other windows VMs and RHEL6.3 VM itself, but found issue exist in all with the scenario "detach and re hotplug same virtual disk in qcow2 format". |