[libvirt] problem attaching/detaching disk

Hi there, Attaching/detachnig virtio disk to a VM used to work fine with RHEL-5 but with RHEL-6 it seems to have problems. Attaching seems to work. For example, I can do virsh attach-disk <vmname> <qcow2 file name> vdb --driver file --subdriver qcow2 However, it generates a bit weird XML: <disk type='file' device='disk'> <driver name='file' type='qcow2'/> <source file='<file>/> <target dev='vdb' bus='virtio'/> <alias name='virtio-disk1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/> </disk> In contrary, our original VM system disk has <disk type='file' device='disk'> <driver name='qemu' type='qcow2'/> <source file='<sys disk image>'/> <target dev='vda' bus='virtio'/> <alias name='virtio-disk0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> </disk> Note the different of driver name: qemu vs file. I think qemu is the proper name to use. This has been mentioned last year on this list [1]. I wonder if there has already been a proper fix for this problem. More seriously about this is that I am not able to detach the just attached disk, most likely due to the problem of wrong driver name. [cloudadmin@test2 ~]$ virsh detach-disk one-52 vdb error: Failed to detach disk error: operation failed: detaching virtio-disk1 device failed: Device 'virtio-disk1' not found But if I tried to remove the vda which uses qemu as driver name it would work. [cloudadmin@test2 ~]$ virsh detach-disk one-52 vda Disk detached successfully I also tried with raw disks to attach/detach and saw the same problems. Thank you very much. Shi [1]: http://www.redhat.com/archives/libvir-list/2010-August/msg00449.html -- Shi Jin, PhD

At 03/03/2011 02:11 PM, Shi Jin Write:
Hi there,
Attaching/detachnig virtio disk to a VM used to work fine with RHEL-5 but with RHEL-6 it seems to have problems.
Attaching seems to work. For example, I can do virsh attach-disk <vmname> <qcow2 file name> vdb --driver file --subdriver qcow2 However, it generates a bit weird XML: <disk type='file' device='disk'> <driver name='file' type='qcow2'/> <source file='<file>/> <target dev='vdb' bus='virtio'/> <alias name='virtio-disk1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/> </disk>
In contrary, our original VM system disk has <disk type='file' device='disk'> <driver name='qemu' type='qcow2'/> <source file='<sys disk image>'/> <target dev='vda' bus='virtio'/> <alias name='virtio-disk0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> </disk>
Note the different of driver name: qemu vs file. I think qemu is the proper name to use. This has been mentioned last year on this list [1]. I wonder if there has already been a proper fix for this problem.
More seriously about this is that I am not able to detach the just attached disk, most likely due to the problem of wrong driver name. [cloudadmin@test2 ~]$ virsh detach-disk one-52 vdb error: Failed to detach disk error: operation failed: detaching virtio-disk1 device failed: Device 'virtio-disk1' not found This error message is reported by qemu.
I try to reproduce this bug with upstream libvirt and qemu, but it works fine to me: # virsh attach-disk RHEL6RC /var/lib/libvirt/images/test3.img vdb --driver file --subdriver qcow2 Disk attached successfully # virsh detach-disk RHEL6RC vdb Disk detached successfully What is version of libvirt and qemu that you use?
But if I tried to remove the vda which uses qemu as driver name it would work. [cloudadmin@test2 ~]$ virsh detach-disk one-52 vda Disk detached successfully
I also tried with raw disks to attach/detach and saw the same problems.
Thank you very much. Shi
[1]: http://www.redhat.com/archives/libvir-list/2010-August/msg00449.html
-- Shi Jin, PhD
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

Hi Wen, Thank you very much. Here are my versoins: [cloudadmin@test2 ~]$ virsh version Compiled against library: libvir 0.8.1 Using library: libvir 0.8.1 Using API: QEMU 0.8.1 Running hypervisor: QEMU 0.12.1 [cloudadmin@test2 ~]$ cat /etc/redhat-release Red Hat Enterprise Linux Server release 6.0 (Santiago) [cloudadmin@test2 ~]$ uname -a Linux test2 2.6.32-71.el6.x86_64 #1 SMP Wed Sep 1 01:33:01 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux Could you please post the "virsh dumpxml" result of the VM after the vdb is attached? Thanks in advance. Shi
I try to reproduce this bug with upstream libvirt and qemu, but it works fine to me:
# virsh attach-disk RHEL6RC /var/lib/libvirt/images/test3.img vdb --driver file --subdriver qcow2 Disk attached successfully
# virsh detach-disk RHEL6RC vdb Disk detached successfully
What is version of libvirt and qemu that you use?
But if I tried to remove the vda which uses qemu as driver name it would work. [cloudadmin@test2 ~]$ virsh detach-disk one-52 vda Disk detached successfully
I also tried with raw disks to attach/detach and saw the same problems.
Thank you very much. Shi
[1]: http://www.redhat.com/archives/libvir-list/2010-August/msg00449.html -- Shi Jin, PhD
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

At 03/04/2011 12:34 AM, Shi Jin Write:
Hi Wen,
Thank you very much. Here are my versoins: [cloudadmin@test2 ~]$ virsh version Compiled against library: libvir 0.8.1 Using library: libvir 0.8.1 Using API: QEMU 0.8.1 Running hypervisor: QEMU 0.12.1
I use the same version of libvirt, and still can not reproduce this bug.
[cloudadmin@test2 ~]$ cat /etc/redhat-release Red Hat Enterprise Linux Server release 6.0 (Santiago) [cloudadmin@test2 ~]$ uname -a Linux test2 2.6.32-71.el6.x86_64 #1 SMP Wed Sep 1 01:33:01 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
Could you please post the "virsh dumpxml" result of the VM after the vdb is attached?
<disk type='file' device='disk'> <driver name='qemu' type='qcow2' cache='none'/> <source file='/var/lib/libvirt/images/rhel6rc_64.img'/> <target dev='hda' bus='ide'/> <alias name='ide0-0-0'/> <address type='drive' controller='0' bus='0' unit='0'/> </disk> <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <source file='/var/lib/libvirt/images/test.iso'/> <target dev='hdc' bus='ide'/> <readonly/> <alias name='ide0-1-0'/> <address type='drive' controller='0' bus='1' unit='0'/> </disk> <disk type='file' device='disk'> <driver name='file' type='qcow2'/> <source file='/var/lib/libvirt/images/test3.img'/> <target dev='vdb' bus='virtio'/> <alias name='virtio-disk1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> </disk> <controller type='ide' index='0'> <alias name='ide0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> </controller>
Thanks in advance.
Shi
I try to reproduce this bug with upstream libvirt and qemu, but it works fine to me:
# virsh attach-disk RHEL6RC /var/lib/libvirt/images/test3.img vdb --driver file --subdriver qcow2 Disk attached successfully
# virsh detach-disk RHEL6RC vdb Disk detached successfully
What is version of libvirt and qemu that you use?
But if I tried to remove the vda which uses qemu as driver name it would work. [cloudadmin@test2 ~]$ virsh detach-disk one-52 vda Disk detached successfully
I also tried with raw disks to attach/detach and saw the same problems.
Thank you very much. Shi
[1]: http://www.redhat.com/archives/libvir-list/2010-August/msg00449.html
-- Shi Jin, PhD
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

<disk type='file' device='disk'> <driver name='qemu' type='qcow2' cache='none'/> <source file='/var/lib/libvirt/images/rhel6rc_64.img'/> <target dev='hda' bus='ide'/> <alias name='ide0-0-0'/> <address type='drive' controller='0' bus='0' unit='0'/> </disk> <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <source file='/var/lib/libvirt/images/test.iso'/> <target dev='hdc' bus='ide'/> <readonly/> <alias name='ide0-1-0'/> <address type='drive' controller='0' bus='1' unit='0'/> </disk> <disk type='file' device='disk'> <driver name='file' type='qcow2'/> <source file='/var/lib/libvirt/images/test3.img'/> <target dev='vdb' bus='virtio'/> <alias name='virtio-disk1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> </disk> <controller type='ide' index='0'> <alias name='ide0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> </controller>
Thank you very much. It is exactly the same output as mine, particularly
<driver name='file' type='qcow2'/> I thought it has to be name='qemu' to detach properly but since you didn't have a problem, I am very lost on why mine didn't work. My libvirtd.log shows (with debugging turned on) 14:43:18.965: debug : qemuMonitorCommandWithHandler:235 : Receive command reply ret=0 errno=0 33 bytes 'Device 'virtio-disk1' not found^M ' 14:43:18.965: debug : virEventDispatchTimeouts:405 : Dispatch 3 14:43:18.965: debug : virEventDispatchHandles:450 : Dispatch 8 14:43:18.965: error : qemuMonitorTextDelDevice:2314 : operation failed: detaching virtio-disk1 device failed: Device 'virtio-disk1' not found^M Do you know what the "device not found" error means? Thanks. Shi

At 03/04/2011 01:00 PM, Shi Jin Write:
<disk type='file' device='disk'> <driver name='qemu' type='qcow2' cache='none'/> <source file='/var/lib/libvirt/images/rhel6rc_64.img'/> <target dev='hda' bus='ide'/> <alias name='ide0-0-0'/> <address type='drive' controller='0' bus='0' unit='0'/> </disk> <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <source file='/var/lib/libvirt/images/test.iso'/> <target dev='hdc' bus='ide'/> <readonly/> <alias name='ide0-1-0'/> <address type='drive' controller='0' bus='1' unit='0'/> </disk> <disk type='file' device='disk'> <driver name='file' type='qcow2'/> <source file='/var/lib/libvirt/images/test3.img'/> <target dev='vdb' bus='virtio'/> <alias name='virtio-disk1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> </disk> <controller type='ide' index='0'> <alias name='ide0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> </controller>
Thank you very much. It is exactly the same output as mine, particularly
<driver name='file' type='qcow2'/> I thought it has to be name='qemu' to detach properly but since you didn't have a problem, I am very lost on why mine didn't work.
My libvirtd.log shows (with debugging turned on) 14:43:18.965: debug : qemuMonitorCommandWithHandler:235 : Receive command reply ret=0 errno=0 33 bytes 'Device 'virtio-disk1' not found^M ' 14:43:18.965: debug : virEventDispatchTimeouts:405 : Dispatch 3 14:43:18.965: debug : virEventDispatchHandles:450 : Dispatch 8 14:43:18.965: error : qemuMonitorTextDelDevice:2314 : operation failed: detaching virtio-disk1 device failed: Device 'virtio-disk1' not found^M
Do you know what the "device not found" error means?
It seems attaching virtio-disk1 failed. Can you provide the log when you attach virtio-disk1? Thanks. Wen Congyang
Thanks.
Shi

Here is the command [root@test2 images]# virsh attach-disk 1 /var/lib/libvirt/images/disk.qcow2 vdb --driver file --subdriver qcow2 Disk attached successfully Here is the log I found relevant (too much under debug mode) 15:31:52.902: debug : virEventInterruptLocked:668 : Interrupting 15:31:52.902: debug : qemuMonitorCommandWithHandler:235 : Receive command reply ret=0 errno=0 30 bytes 'unknown command: 'drive_add'^M ' 15:31:52.902: debug : virEventRunOnce:595 : Poll got 1 event 15:31:52.902: debug : virEventDispatchTimeouts:405 : Dispatch 3 15:31:52.902: debug : qemuMonitorAddDevice:1878 : mon=0x7f3628341370 device=virtio-blk-pci,bus=pci.0,addr=0x6,drive=drive-virtio-disk1,id=virtio-disk1 15:31:52.902: debug : virEventDispatchHandles:450 : Dispatch 8 15:31:52.902: debug : qemuMonitorCommandWithHandler:230 : Send command 'device_add virtio-blk-pci,bus=pci.0,addr=0x6,drive=drive-virtio-disk1,id=virtio-disk1' for write with FD -1 Than you very much. Shi On Thu, Mar 3, 2011 at 10:12 PM, Wen Congyang <wency@cn.fujitsu.com> wrote:
At 03/04/2011 01:00 PM, Shi Jin Write:
<disk type='file' device='disk'> <driver name='qemu' type='qcow2' cache='none'/> <source file='/var/lib/libvirt/images/rhel6rc_64.img'/> <target dev='hda' bus='ide'/> <alias name='ide0-0-0'/> <address type='drive' controller='0' bus='0' unit='0'/> </disk> <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <source file='/var/lib/libvirt/images/test.iso'/> <target dev='hdc' bus='ide'/> <readonly/> <alias name='ide0-1-0'/> <address type='drive' controller='0' bus='1' unit='0'/> </disk> <disk type='file' device='disk'> <driver name='file' type='qcow2'/> <source file='/var/lib/libvirt/images/test3.img'/> <target dev='vdb' bus='virtio'/> <alias name='virtio-disk1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> </disk> <controller type='ide' index='0'> <alias name='ide0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> </controller>
Thank you very much. It is exactly the same output as mine, particularly
<driver name='file' type='qcow2'/> I thought it has to be name='qemu' to detach properly but since you didn't have a problem, I am very lost on why mine didn't work.
My libvirtd.log shows (with debugging turned on) 14:43:18.965: debug : qemuMonitorCommandWithHandler:235 : Receive command reply ret=0 errno=0 33 bytes 'Device 'virtio-disk1' not found^M ' 14:43:18.965: debug : virEventDispatchTimeouts:405 : Dispatch 3 14:43:18.965: debug : virEventDispatchHandles:450 : Dispatch 8 14:43:18.965: error : qemuMonitorTextDelDevice:2314 : operation failed: detaching virtio-disk1 device failed: Device 'virtio-disk1' not found^M
Do you know what the "device not found" error means?
It seems attaching virtio-disk1 failed. Can you provide the log when you attach virtio-disk1?
Thanks. Wen Congyang
Thanks.
Shi
-- Shi Jin, Ph.D.

At 03/04/2011 01:36 PM, Shi Jin Write:
Here is the command [root@test2 images]# virsh attach-disk 1 /var/lib/libvirt/images/disk.qcow2 vdb --driver file --subdriver qcow2 Disk attached successfully
Here is the log I found relevant (too much under debug mode) 15:31:52.902: debug : virEventInterruptLocked:668 : Interrupting 15:31:52.902: debug : qemuMonitorCommandWithHandler:235 : Receive command reply ret=0 errno=0 30 bytes 'unknown command: 'drive_add'^M '
It seems that your qemu does not support monitor command 'drive_add'. What's version of your qemu?
15:31:52.902: debug : virEventRunOnce:595 : Poll got 1 event 15:31:52.902: debug : virEventDispatchTimeouts:405 : Dispatch 3 15:31:52.902: debug : qemuMonitorAddDevice:1878 : mon=0x7f3628341370 device=virtio-blk-pci,bus=pci.0,addr=0x6,drive=drive-virtio-disk1,id=virtio-disk1
When 'drive_add' failes, we do not call qemuMonitorAddDevice(). But it is called.
15:31:52.902: debug : virEventDispatchHandles:450 : Dispatch 8 15:31:52.902: debug : qemuMonitorCommandWithHandler:230 : Send command 'device_add virtio-blk-pci,bus=pci.0,addr=0x6,drive=drive-virtio-disk1,id=virtio-disk1' for write with FD -1
What's the reply of command 'device_add'? Can you provide it. I think it should fail. Thanks. Wen Congyang
Than you very much.
Shi
On Thu, Mar 3, 2011 at 10:12 PM, Wen Congyang <wency@cn.fujitsu.com> wrote:
At 03/04/2011 01:00 PM, Shi Jin Write:
<disk type='file' device='disk'> <driver name='qemu' type='qcow2' cache='none'/> <source file='/var/lib/libvirt/images/rhel6rc_64.img'/> <target dev='hda' bus='ide'/> <alias name='ide0-0-0'/> <address type='drive' controller='0' bus='0' unit='0'/> </disk> <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <source file='/var/lib/libvirt/images/test.iso'/> <target dev='hdc' bus='ide'/> <readonly/> <alias name='ide0-1-0'/> <address type='drive' controller='0' bus='1' unit='0'/> </disk> <disk type='file' device='disk'> <driver name='file' type='qcow2'/> <source file='/var/lib/libvirt/images/test3.img'/> <target dev='vdb' bus='virtio'/> <alias name='virtio-disk1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> </disk> <controller type='ide' index='0'> <alias name='ide0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> </controller>
Thank you very much. It is exactly the same output as mine, particularly
<driver name='file' type='qcow2'/> I thought it has to be name='qemu' to detach properly but since you didn't have a problem, I am very lost on why mine didn't work.
My libvirtd.log shows (with debugging turned on) 14:43:18.965: debug : qemuMonitorCommandWithHandler:235 : Receive command reply ret=0 errno=0 33 bytes 'Device 'virtio-disk1' not found^M ' 14:43:18.965: debug : virEventDispatchTimeouts:405 : Dispatch 3 14:43:18.965: debug : virEventDispatchHandles:450 : Dispatch 8 14:43:18.965: error : qemuMonitorTextDelDevice:2314 : operation failed: detaching virtio-disk1 device failed: Device 'virtio-disk1' not found^M
Do you know what the "device not found" error means?
It seems attaching virtio-disk1 failed. Can you provide the log when you attach virtio-disk1?
Thanks. Wen Congyang
Thanks.
Shi

It seems that your qemu does not support monitor command 'drive_add'. What's version of your qemu?
Thank you. Here is my version
[cloudadmin@test2 ~]$ /usr/libexec/qemu-kvm -version QEMU PC emulator version 0.12.1 (qemu-kvm-0.12.1.2), Copyright (c) 2003-2008 Fabrice Bellard I finally think it is a permission issue. If I run commands as root and get kvm run by the default qemu user, both attach-disk and detach-disk works like your case. However, if I set to run as another user, such as cloudamin, attach-disk works but detach-disk does not. My libvirtd.conf has unix_sock_group = "cloudadmin" unix_sock_rw_perms = "0770" auth_unix_ro = "none" auth_unix_rw = "none" log_level = 3 log_outputs="3:file:/var/log/libvirt/libvirtd.log" and qemu.conf has user = "cloudadmin" group = "cloudadmin" dynamic_ownership = 0 All images are owned by the cloudadmin:cloudadmin. Is there a problem with this setup? Thank you very much. Shi
15:31:52.902: debug : virEventRunOnce:595 : Poll got 1 event 15:31:52.902: debug : virEventDispatchTimeouts:405 : Dispatch 3 15:31:52.902: debug : qemuMonitorAddDevice:1878 : mon=0x7f3628341370
device=virtio-blk-pci,bus=pci.0,addr=0x6,drive=drive-virtio-disk1,id=virtio-disk1
When 'drive_add' failes, we do not call qemuMonitorAddDevice(). But it is called.
15:31:52.902: debug : virEventDispatchHandles:450 : Dispatch 8 15:31:52.902: debug : qemuMonitorCommandWithHandler:230 : Send command 'device_add
virtio-blk-pci,bus=pci.0,addr=0x6,drive=drive-virtio-disk1,id=virtio-disk1'
for write with FD -1
What's the reply of command 'device_add'? Can you provide it. I think it should fail.
Thanks. Wen Congyang
Than you very much.
Shi
On Thu, Mar 3, 2011 at 10:12 PM, Wen Congyang <wency@cn.fujitsu.com>
wrote:
At 03/04/2011 01:00 PM, Shi Jin Write:
<disk type='file' device='disk'> <driver name='qemu' type='qcow2' cache='none'/> <source file='/var/lib/libvirt/images/rhel6rc_64.img'/> <target dev='hda' bus='ide'/> <alias name='ide0-0-0'/> <address type='drive' controller='0' bus='0' unit='0'/> </disk> <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <source file='/var/lib/libvirt/images/test.iso'/> <target dev='hdc' bus='ide'/> <readonly/> <alias name='ide0-1-0'/> <address type='drive' controller='0' bus='1' unit='0'/> </disk> <disk type='file' device='disk'> <driver name='file' type='qcow2'/> <source file='/var/lib/libvirt/images/test3.img'/> <target dev='vdb' bus='virtio'/> <alias name='virtio-disk1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> </disk> <controller type='ide' index='0'> <alias name='ide0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> </controller>
Thank you very much. It is exactly the same output as mine,
particularly
<driver name='file' type='qcow2'/> I thought it has to be name='qemu' to detach properly but since you didn't have a problem, I am very lost on why mine didn't work.
My libvirtd.log shows (with debugging turned on) 14:43:18.965: debug : qemuMonitorCommandWithHandler:235 : Receive command reply ret=0 errno=0 33 bytes 'Device 'virtio-disk1' not found^M ' 14:43:18.965: debug : virEventDispatchTimeouts:405 : Dispatch 3 14:43:18.965: debug : virEventDispatchHandles:450 : Dispatch 8 14:43:18.965: error : qemuMonitorTextDelDevice:2314 : operation failed: detaching virtio-disk1 device failed: Device 'virtio-disk1' not found^M
Do you know what the "device not found" error means?
It seems attaching virtio-disk1 failed. Can you provide the log when you attach virtio-disk1?
Thanks. Wen Congyang
Thanks.
Shi
-- Shi Jin, Ph.D.

Finally, everything works for if I simply change my template to use the /usr/libexec/qemu-kvm instead of /usr/bin/kvm, which is a symbolic link to it. Not sure why it matters but that does solve all the mysteries. Shi On Fri, Mar 4, 2011 at 9:56 AM, Shi Jin <jinzishuai@gmail.com> wrote:
It seems that your qemu does not support monitor command 'drive_add'.
What's version of your qemu?
Thank you. Here is my version [cloudadmin@test2 ~]$ /usr/libexec/qemu-kvm -version QEMU PC emulator version 0.12.1 (qemu-kvm-0.12.1.2), Copyright (c) 2003-2008 Fabrice Bellard
I finally think it is a permission issue. If I run commands as root and get kvm run by the default qemu user, both attach-disk and detach-disk works like your case.
However, if I set to run as another user, such as cloudamin, attach-disk works but detach-disk does not. My libvirtd.conf has unix_sock_group = "cloudadmin" unix_sock_rw_perms = "0770" auth_unix_ro = "none" auth_unix_rw = "none" log_level = 3 log_outputs="3:file:/var/log/libvirt/libvirtd.log"
and qemu.conf has user = "cloudadmin" group = "cloudadmin" dynamic_ownership = 0
All images are owned by the cloudadmin:cloudadmin.
Is there a problem with this setup?
Thank you very much. Shi
15:31:52.902: debug : virEventRunOnce:595 : Poll got 1 event
15:31:52.902: debug : virEventDispatchTimeouts:405 : Dispatch 3 15:31:52.902: debug : qemuMonitorAddDevice:1878 : mon=0x7f3628341370
device=virtio-blk-pci,bus=pci.0,addr=0x6,drive=drive-virtio-disk1,id=virtio-disk1
When 'drive_add' failes, we do not call qemuMonitorAddDevice(). But it is called.
15:31:52.902: debug : virEventDispatchHandles:450 : Dispatch 8 15:31:52.902: debug : qemuMonitorCommandWithHandler:230 : Send command 'device_add
virtio-blk-pci,bus=pci.0,addr=0x6,drive=drive-virtio-disk1,id=virtio-disk1'
for write with FD -1
What's the reply of command 'device_add'? Can you provide it. I think it should fail.
Thanks. Wen Congyang
Than you very much.
Shi
On Thu, Mar 3, 2011 at 10:12 PM, Wen Congyang <wency@cn.fujitsu.com>
wrote:
At 03/04/2011 01:00 PM, Shi Jin Write:
<disk type='file' device='disk'> <driver name='qemu' type='qcow2' cache='none'/> <source file='/var/lib/libvirt/images/rhel6rc_64.img'/> <target dev='hda' bus='ide'/> <alias name='ide0-0-0'/> <address type='drive' controller='0' bus='0' unit='0'/> </disk> <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <source file='/var/lib/libvirt/images/test.iso'/> <target dev='hdc' bus='ide'/> <readonly/> <alias name='ide0-1-0'/> <address type='drive' controller='0' bus='1' unit='0'/> </disk> <disk type='file' device='disk'> <driver name='file' type='qcow2'/> <source file='/var/lib/libvirt/images/test3.img'/> <target dev='vdb' bus='virtio'/> <alias name='virtio-disk1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> </disk> <controller type='ide' index='0'> <alias name='ide0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> </controller>
Thank you very much. It is exactly the same output as mine,
particularly
<driver name='file' type='qcow2'/> I thought it has to be name='qemu' to detach properly but since you didn't have a problem, I am very lost on why mine didn't work.
My libvirtd.log shows (with debugging turned on) 14:43:18.965: debug : qemuMonitorCommandWithHandler:235 : Receive command reply ret=0 errno=0 33 bytes 'Device 'virtio-disk1' not found^M ' 14:43:18.965: debug : virEventDispatchTimeouts:405 : Dispatch 3 14:43:18.965: debug : virEventDispatchHandles:450 : Dispatch 8 14:43:18.965: error : qemuMonitorTextDelDevice:2314 : operation failed: detaching virtio-disk1 device failed: Device 'virtio-disk1' not found^M
Do you know what the "device not found" error means?
It seems attaching virtio-disk1 failed. Can you provide the log when you attach virtio-disk1?
Thanks. Wen Congyang
Thanks.
Shi
-- Shi Jin, Ph.D.
-- Shi Jin, Ph.D.

Although the attach/detach problem has been solved, I fond the driver name issue still causes problems restoring from a saved VM with disk attached. For example, once saved, the checkpoint file would contains <disk type='file' device='disk'> <driver name='file' type='qcow2'/> <source file='/vrstorm/cloud/PrivateAccounts/74d37709b07be4bbae228dfc273e4339/volumes/vol-126'/> <target dev='vdf' bus='virtio'/> <alias name='virtio-disk5'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> </disk> And then the restore would fail: [cloudadmin@test2 images]$ virsh restore checkpoint error: Failed to restore domain from checkpoint error: internal error unsupported driver name 'file' for disk '/vrstorm/cloud/PrivateAccounts/74d37709b07be4bbae228dfc273e4339/volumes/vol-126' If I simply edit the checkpoint file to change file to qemu:<driver name='qemu' type='qcow2'/> Then it works. [cloudadmin@test2 images]$ virsh restore checkpoint Domain restored from checkpoint So there is indeed a problem with the driver name. Maybe I should start a new thread on it? Shi On Fri, Mar 4, 2011 at 11:44 AM, Shi Jin <jinzishuai@gmail.com> wrote:
Finally, everything works for if I simply change my template to use the /usr/libexec/qemu-kvm instead of /usr/bin/kvm, which is a symbolic link to it. Not sure why it matters but that does solve all the mysteries.
Shi
On Fri, Mar 4, 2011 at 9:56 AM, Shi Jin <jinzishuai@gmail.com> wrote:
It seems that your qemu does not support monitor command 'drive_add'.
What's version of your qemu?
Thank you. Here is my version [cloudadmin@test2 ~]$ /usr/libexec/qemu-kvm -version QEMU PC emulator version 0.12.1 (qemu-kvm-0.12.1.2), Copyright (c) 2003-2008 Fabrice Bellard
I finally think it is a permission issue. If I run commands as root and get kvm run by the default qemu user, both attach-disk and detach-disk works like your case.
However, if I set to run as another user, such as cloudamin, attach-disk works but detach-disk does not. My libvirtd.conf has unix_sock_group = "cloudadmin" unix_sock_rw_perms = "0770" auth_unix_ro = "none" auth_unix_rw = "none" log_level = 3 log_outputs="3:file:/var/log/libvirt/libvirtd.log"
and qemu.conf has user = "cloudadmin" group = "cloudadmin" dynamic_ownership = 0
All images are owned by the cloudadmin:cloudadmin.
Is there a problem with this setup?
Thank you very much. Shi
15:31:52.902: debug : virEventRunOnce:595 : Poll got 1 event
15:31:52.902: debug : virEventDispatchTimeouts:405 : Dispatch 3 15:31:52.902: debug : qemuMonitorAddDevice:1878 : mon=0x7f3628341370
device=virtio-blk-pci,bus=pci.0,addr=0x6,drive=drive-virtio-disk1,id=virtio-disk1
When 'drive_add' failes, we do not call qemuMonitorAddDevice(). But it is called.
15:31:52.902: debug : virEventDispatchHandles:450 : Dispatch 8 15:31:52.902: debug : qemuMonitorCommandWithHandler:230 : Send command 'device_add
virtio-blk-pci,bus=pci.0,addr=0x6,drive=drive-virtio-disk1,id=virtio-disk1'
for write with FD -1
What's the reply of command 'device_add'? Can you provide it. I think it should fail.
Thanks. Wen Congyang
Than you very much.
Shi
On Thu, Mar 3, 2011 at 10:12 PM, Wen Congyang <wency@cn.fujitsu.com>
wrote:
At 03/04/2011 01:00 PM, Shi Jin Write:
> > > > <disk type='file' device='disk'> > <driver name='qemu' type='qcow2' cache='none'/> > <source file='/var/lib/libvirt/images/rhel6rc_64.img'/> > <target dev='hda' bus='ide'/> > <alias name='ide0-0-0'/> > <address type='drive' controller='0' bus='0' unit='0'/> > </disk> > <disk type='file' device='cdrom'> > <driver name='qemu' type='raw'/> > <source file='/var/lib/libvirt/images/test.iso'/> > <target dev='hdc' bus='ide'/> > <readonly/> > <alias name='ide0-1-0'/> > <address type='drive' controller='0' bus='1' unit='0'/> > </disk> > <disk type='file' device='disk'> > <driver name='file' type='qcow2'/> > <source file='/var/lib/libvirt/images/test3.img'/> > <target dev='vdb' bus='virtio'/> > <alias name='virtio-disk1'/> > <address type='pci' domain='0x0000' bus='0x00' slot='0x06' > function='0x0'/> > </disk> > <controller type='ide' index='0'> > <alias name='ide0'/> > <address type='pci' domain='0x0000' bus='0x00' slot='0x01' > function='0x1'/> > </controller> > > > Thank you very much. It is exactly the same output as mine,
particularly
<driver name='file' type='qcow2'/> I thought it has to be name='qemu' to detach properly but since you didn't have a problem, I am very lost on why mine didn't work.
My libvirtd.log shows (with debugging turned on) 14:43:18.965: debug : qemuMonitorCommandWithHandler:235 : Receive command reply ret=0 errno=0 33 bytes 'Device 'virtio-disk1' not found^M ' 14:43:18.965: debug : virEventDispatchTimeouts:405 : Dispatch 3 14:43:18.965: debug : virEventDispatchHandles:450 : Dispatch 8 14:43:18.965: error : qemuMonitorTextDelDevice:2314 : operation failed: detaching virtio-disk1 device failed: Device 'virtio-disk1' not found^M
Do you know what the "device not found" error means?
It seems attaching virtio-disk1 failed. Can you provide the log when you attach virtio-disk1?
Thanks. Wen Congyang
Thanks.
Shi
-- Shi Jin, Ph.D.
-- Shi Jin, Ph.D.
-- Shi Jin, Ph.D.

At 03/05/2011 05:35 AM, Shi Jin Write:
Although the attach/detach problem has been solved, I fond the driver name issue still causes problems restoring from a saved VM with disk attached.
I can reproduce this a bug of libvirt: we can not restore the VM from the file we saved. Thank you for reporting this problem. I will make a patch to fix it. Thanks. Wen Congyang
For example, once saved, the checkpoint file would contains <disk type='file' device='disk'> <driver name='file' type='qcow2'/> <source file='/vrstorm/cloud/PrivateAccounts/74d37709b07be4bbae228dfc273e4339/volumes/vol-126'/> <target dev='vdf' bus='virtio'/> <alias name='virtio-disk5'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> </disk>
And then the restore would fail:
[cloudadmin@test2 images]$ virsh restore checkpoint error: Failed to restore domain from checkpoint error: internal error unsupported driver name 'file' for disk '/vrstorm/cloud/PrivateAccounts/74d37709b07be4bbae228dfc273e4339/volumes/vol-126'
If I simply edit the checkpoint file to change file to qemu:<driver name='qemu' type='qcow2'/>
Then it works.
[cloudadmin@test2 images]$ virsh restore checkpoint Domain restored from checkpoint
So there is indeed a problem with the driver name. Maybe I should start a new thread on it?
Shi
On Fri, Mar 4, 2011 at 11:44 AM, Shi Jin <jinzishuai@gmail.com> wrote:
Finally, everything works for if I simply change my template to use the /usr/libexec/qemu-kvm instead of /usr/bin/kvm, which is a symbolic link to it. Not sure why it matters but that does solve all the mysteries.
Shi
On Fri, Mar 4, 2011 at 9:56 AM, Shi Jin <jinzishuai@gmail.com> wrote:
It seems that your qemu does not support monitor command 'drive_add'.
What's version of your qemu?
Thank you. Here is my version [cloudadmin@test2 ~]$ /usr/libexec/qemu-kvm -version QEMU PC emulator version 0.12.1 (qemu-kvm-0.12.1.2), Copyright (c) 2003-2008 Fabrice Bellard
I finally think it is a permission issue. If I run commands as root and get kvm run by the default qemu user, both attach-disk and detach-disk works like your case.
However, if I set to run as another user, such as cloudamin, attach-disk works but detach-disk does not. My libvirtd.conf has unix_sock_group = "cloudadmin" unix_sock_rw_perms = "0770" auth_unix_ro = "none" auth_unix_rw = "none" log_level = 3 log_outputs="3:file:/var/log/libvirt/libvirtd.log"
and qemu.conf has user = "cloudadmin" group = "cloudadmin" dynamic_ownership = 0
All images are owned by the cloudadmin:cloudadmin.
Is there a problem with this setup?
Thank you very much. Shi
15:31:52.902: debug : virEventRunOnce:595 : Poll got 1 event
15:31:52.902: debug : virEventDispatchTimeouts:405 : Dispatch 3 15:31:52.902: debug : qemuMonitorAddDevice:1878 : mon=0x7f3628341370
device=virtio-blk-pci,bus=pci.0,addr=0x6,drive=drive-virtio-disk1,id=virtio-disk1
When 'drive_add' failes, we do not call qemuMonitorAddDevice(). But it is called.
15:31:52.902: debug : virEventDispatchHandles:450 : Dispatch 8 15:31:52.902: debug : qemuMonitorCommandWithHandler:230 : Send command 'device_add
virtio-blk-pci,bus=pci.0,addr=0x6,drive=drive-virtio-disk1,id=virtio-disk1'
for write with FD -1
What's the reply of command 'device_add'? Can you provide it. I think it should fail.
Thanks. Wen Congyang
Than you very much.
Shi
On Thu, Mar 3, 2011 at 10:12 PM, Wen Congyang <wency@cn.fujitsu.com>
wrote:
At 03/04/2011 01:00 PM, Shi Jin Write: >> >> >> >> <disk type='file' device='disk'> >> <driver name='qemu' type='qcow2' cache='none'/> >> <source file='/var/lib/libvirt/images/rhel6rc_64.img'/> >> <target dev='hda' bus='ide'/> >> <alias name='ide0-0-0'/> >> <address type='drive' controller='0' bus='0' unit='0'/> >> </disk> >> <disk type='file' device='cdrom'> >> <driver name='qemu' type='raw'/> >> <source file='/var/lib/libvirt/images/test.iso'/> >> <target dev='hdc' bus='ide'/> >> <readonly/> >> <alias name='ide0-1-0'/> >> <address type='drive' controller='0' bus='1' unit='0'/> >> </disk> >> <disk type='file' device='disk'> >> <driver name='file' type='qcow2'/> >> <source file='/var/lib/libvirt/images/test3.img'/> >> <target dev='vdb' bus='virtio'/> >> <alias name='virtio-disk1'/> >> <address type='pci' domain='0x0000' bus='0x00' slot='0x06' >> function='0x0'/> >> </disk> >> <controller type='ide' index='0'> >> <alias name='ide0'/> >> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' >> function='0x1'/> >> </controller> >> >> >> Thank you very much. It is exactly the same output as mine,
particularly
> <driver name='file' type='qcow2'/> > I thought it has to be name='qemu' to detach properly but since you didn't > have a problem, I am very lost on why mine didn't work. > > My libvirtd.log shows (with debugging turned on) > 14:43:18.965: debug : qemuMonitorCommandWithHandler:235 : Receive command > reply ret=0 errno=0 33 bytes 'Device 'virtio-disk1' not found^M > ' > 14:43:18.965: debug : virEventDispatchTimeouts:405 : Dispatch 3 > 14:43:18.965: debug : virEventDispatchHandles:450 : Dispatch 8 > 14:43:18.965: error : qemuMonitorTextDelDevice:2314 : operation failed: > detaching virtio-disk1 device failed: Device 'virtio-disk1' not found^M > > Do you know what the "device not found" error means?
It seems attaching virtio-disk1 failed. Can you provide the log when you attach virtio-disk1?
Thanks. Wen Congyang
> > Thanks. > > Shi >
-- Shi Jin, Ph.D.
-- Shi Jin, Ph.D.

I am very glad to hear that you can reproduce this problem. Please keep me posted on the status of this patch. One more question which might be more appropriate for Redhat: any idea when this fix would go into RHEL-6 as a bug fix? Should I open a bug ticket at RHEL support? Thank you very much. Shi On Sun, Mar 6, 2011 at 10:28 PM, Wen Congyang <wency@cn.fujitsu.com> wrote:
At 03/05/2011 05:35 AM, Shi Jin Write:
Although the attach/detach problem has been solved, I fond the driver name issue still causes problems restoring from a saved VM with disk attached.
I can reproduce this a bug of libvirt: we can not restore the VM from the file we saved.
Thank you for reporting this problem. I will make a patch to fix it.
Thanks. Wen Congyang
For example, once saved, the checkpoint file would contains <disk type='file' device='disk'> <driver name='file' type='qcow2'/> <source
file='/vrstorm/cloud/PrivateAccounts/74d37709b07be4bbae228dfc273e4339/volumes/vol-126'/>
<target dev='vdf' bus='virtio'/> <alias name='virtio-disk5'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> </disk>
And then the restore would fail:
[cloudadmin@test2 images]$ virsh restore checkpoint error: Failed to restore domain from checkpoint error: internal error unsupported driver name 'file' for disk
'/vrstorm/cloud/PrivateAccounts/74d37709b07be4bbae228dfc273e4339/volumes/vol-126'
If I simply edit the checkpoint file to change file to qemu:<driver name='qemu' type='qcow2'/>
Then it works.
[cloudadmin@test2 images]$ virsh restore checkpoint Domain restored from checkpoint
So there is indeed a problem with the driver name. Maybe I should start a new thread on it?
Shi
On Fri, Mar 4, 2011 at 11:44 AM, Shi Jin <jinzishuai@gmail.com> wrote:
Finally, everything works for if I simply change my template to use the /usr/libexec/qemu-kvm instead of /usr/bin/kvm, which is a symbolic link
to
it. Not sure why it matters but that does solve all the mysteries.
Shi
On Fri, Mar 4, 2011 at 9:56 AM, Shi Jin <jinzishuai@gmail.com> wrote:
It seems that your qemu does not support monitor command 'drive_add'.
What's version of your qemu?
Thank you. Here is my version [cloudadmin@test2 ~]$ /usr/libexec/qemu-kvm -version QEMU PC emulator version 0.12.1 (qemu-kvm-0.12.1.2), Copyright (c) 2003-2008 Fabrice Bellard
I finally think it is a permission issue. If I run commands as root and get kvm run by the default qemu user, both attach-disk and detach-disk works like your case.
However, if I set to run as another user, such as cloudamin, attach-disk works but detach-disk does not. My libvirtd.conf has unix_sock_group = "cloudadmin" unix_sock_rw_perms = "0770" auth_unix_ro = "none" auth_unix_rw = "none" log_level = 3 log_outputs="3:file:/var/log/libvirt/libvirtd.log"
and qemu.conf has user = "cloudadmin" group = "cloudadmin" dynamic_ownership = 0
All images are owned by the cloudadmin:cloudadmin.
Is there a problem with this setup?
Thank you very much. Shi
15:31:52.902: debug : virEventRunOnce:595 : Poll got 1 event
15:31:52.902: debug : virEventDispatchTimeouts:405 : Dispatch 3 15:31:52.902: debug : qemuMonitorAddDevice:1878 : mon=0x7f3628341370
device=virtio-blk-pci,bus=pci.0,addr=0x6,drive=drive-virtio-disk1,id=virtio-disk1
When 'drive_add' failes, we do not call qemuMonitorAddDevice(). But it
is
called.
15:31:52.902: debug : virEventDispatchHandles:450 : Dispatch 8 15:31:52.902: debug : qemuMonitorCommandWithHandler:230 : Send command 'device_add
virtio-blk-pci,bus=pci.0,addr=0x6,drive=drive-virtio-disk1,id=virtio-disk1'
for write with FD -1
What's the reply of command 'device_add'? Can you provide it. I think it should fail.
Thanks. Wen Congyang
Than you very much.
Shi
On Thu, Mar 3, 2011 at 10:12 PM, Wen Congyang <wency@cn.fujitsu.com>
wrote:
> At 03/04/2011 01:00 PM, Shi Jin Write: >>> >>> >>> >>> <disk type='file' device='disk'> >>> <driver name='qemu' type='qcow2' cache='none'/> >>> <source file='/var/lib/libvirt/images/rhel6rc_64.img'/> >>> <target dev='hda' bus='ide'/> >>> <alias name='ide0-0-0'/> >>> <address type='drive' controller='0' bus='0' unit='0'/> >>> </disk> >>> <disk type='file' device='cdrom'> >>> <driver name='qemu' type='raw'/> >>> <source file='/var/lib/libvirt/images/test.iso'/> >>> <target dev='hdc' bus='ide'/> >>> <readonly/> >>> <alias name='ide0-1-0'/> >>> <address type='drive' controller='0' bus='1' unit='0'/> >>> </disk> >>> <disk type='file' device='disk'> >>> <driver name='file' type='qcow2'/> >>> <source file='/var/lib/libvirt/images/test3.img'/> >>> <target dev='vdb' bus='virtio'/> >>> <alias name='virtio-disk1'/> >>> <address type='pci' domain='0x0000' bus='0x00' slot='0x06' >>> function='0x0'/> >>> </disk> >>> <controller type='ide' index='0'> >>> <alias name='ide0'/> >>> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' >>> function='0x1'/> >>> </controller> >>> >>> >>> Thank you very much. It is exactly the same output as mine,
particularly
>> <driver name='file' type='qcow2'/> >> I thought it has to be name='qemu' to detach properly but since you > didn't >> have a problem, I am very lost on why mine didn't work. >> >> My libvirtd.log shows (with debugging turned on) >> 14:43:18.965: debug : qemuMonitorCommandWithHandler:235 : Receive command >> reply ret=0 errno=0 33 bytes 'Device 'virtio-disk1' not found^M >> ' >> 14:43:18.965: debug : virEventDispatchTimeouts:405 : Dispatch 3 >> 14:43:18.965: debug : virEventDispatchHandles:450 : Dispatch 8 >> 14:43:18.965: error : qemuMonitorTextDelDevice:2314 : operation failed: >> detaching virtio-disk1 device failed: Device 'virtio-disk1' not found^M >> >> Do you know what the "device not found" error means? > > It seems attaching virtio-disk1 failed. > Can you provide the log when you attach virtio-disk1? > > Thanks. > Wen Congyang > >> >> Thanks. >> >> Shi >> > >
-- Shi Jin, Ph.D.
-- Shi Jin, Ph.D.
-- Shi Jin, Ph.D.

On Sun, Mar 06, 2011 at 10:36:14PM -0700, Shi Jin wrote:
I am very glad to hear that you can reproduce this problem. Please keep me posted on the status of this patch. One more question which might be more appropriate for Redhat: any idea when this fix would go into RHEL-6 as a bug fix? Should I open a bug ticket at RHEL support?
Yes, if you have questions about Red Hat products, you should direct them to Red Hat support. Dave
Thank you very much. Shi
On Sun, Mar 6, 2011 at 10:28 PM, Wen Congyang <wency@cn.fujitsu.com> wrote:
At 03/05/2011 05:35 AM, Shi Jin Write:
Although the attach/detach problem has been solved, I fond the driver name issue still causes problems restoring from a saved VM with disk attached.
I can reproduce this a bug of libvirt: we can not restore the VM from the file we saved.
Thank you for reporting this problem. I will make a patch to fix it.
Thanks. Wen Congyang
For example, once saved, the checkpoint file would contains <disk type='file' device='disk'> <driver name='file' type='qcow2'/> <source
file='/vrstorm/cloud/PrivateAccounts/74d37709b07be4bbae228dfc273e4339/volumes/vol-126'/>
<target dev='vdf' bus='virtio'/> <alias name='virtio-disk5'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> </disk>
And then the restore would fail:
[cloudadmin@test2 images]$ virsh restore checkpoint error: Failed to restore domain from checkpoint error: internal error unsupported driver name 'file' for disk
'/vrstorm/cloud/PrivateAccounts/74d37709b07be4bbae228dfc273e4339/volumes/vol-126'
If I simply edit the checkpoint file to change file to qemu:<driver name='qemu' type='qcow2'/>
Then it works.
[cloudadmin@test2 images]$ virsh restore checkpoint Domain restored from checkpoint
So there is indeed a problem with the driver name. Maybe I should start a new thread on it?
Shi
On Fri, Mar 4, 2011 at 11:44 AM, Shi Jin <jinzishuai@gmail.com> wrote:
Finally, everything works for if I simply change my template to use the /usr/libexec/qemu-kvm instead of /usr/bin/kvm, which is a symbolic link
to
it. Not sure why it matters but that does solve all the mysteries.
Shi
On Fri, Mar 4, 2011 at 9:56 AM, Shi Jin <jinzishuai@gmail.com> wrote:
It seems that your qemu does not support monitor command 'drive_add'.
What's version of your qemu?
Thank you. Here is my version [cloudadmin@test2 ~]$ /usr/libexec/qemu-kvm -version QEMU PC emulator version 0.12.1 (qemu-kvm-0.12.1.2), Copyright (c) 2003-2008 Fabrice Bellard
I finally think it is a permission issue. If I run commands as root and get kvm run by the default qemu user, both attach-disk and detach-disk works like your case.
However, if I set to run as another user, such as cloudamin, attach-disk works but detach-disk does not. My libvirtd.conf has unix_sock_group = "cloudadmin" unix_sock_rw_perms = "0770" auth_unix_ro = "none" auth_unix_rw = "none" log_level = 3 log_outputs="3:file:/var/log/libvirt/libvirtd.log"
and qemu.conf has user = "cloudadmin" group = "cloudadmin" dynamic_ownership = 0
All images are owned by the cloudadmin:cloudadmin.
Is there a problem with this setup?
Thank you very much. Shi
> 15:31:52.902: debug : virEventRunOnce:595 : Poll got 1 event
> 15:31:52.902: debug : virEventDispatchTimeouts:405 : Dispatch 3 > 15:31:52.902: debug : qemuMonitorAddDevice:1878 : mon=0x7f3628341370 >
device=virtio-blk-pci,bus=pci.0,addr=0x6,drive=drive-virtio-disk1,id=virtio-disk1
When 'drive_add' failes, we do not call qemuMonitorAddDevice(). But it
is
called.
> 15:31:52.902: debug : virEventDispatchHandles:450 : Dispatch 8 > 15:31:52.902: debug : qemuMonitorCommandWithHandler:230 : Send command > 'device_add >
virtio-blk-pci,bus=pci.0,addr=0x6,drive=drive-virtio-disk1,id=virtio-disk1'
> for write with FD -1
What's the reply of command 'device_add'? Can you provide it. I think it should fail.
Thanks. Wen Congyang
> > Than you very much. > > Shi > > > > > > On Thu, Mar 3, 2011 at 10:12 PM, Wen Congyang <wency@cn.fujitsu.com> wrote: > >> At 03/04/2011 01:00 PM, Shi Jin Write: >>>> >>>> >>>> >>>> <disk type='file' device='disk'> >>>> <driver name='qemu' type='qcow2' cache='none'/> >>>> <source file='/var/lib/libvirt/images/rhel6rc_64.img'/> >>>> <target dev='hda' bus='ide'/> >>>> <alias name='ide0-0-0'/> >>>> <address type='drive' controller='0' bus='0' unit='0'/> >>>> </disk> >>>> <disk type='file' device='cdrom'> >>>> <driver name='qemu' type='raw'/> >>>> <source file='/var/lib/libvirt/images/test.iso'/> >>>> <target dev='hdc' bus='ide'/> >>>> <readonly/> >>>> <alias name='ide0-1-0'/> >>>> <address type='drive' controller='0' bus='1' unit='0'/> >>>> </disk> >>>> <disk type='file' device='disk'> >>>> <driver name='file' type='qcow2'/> >>>> <source file='/var/lib/libvirt/images/test3.img'/> >>>> <target dev='vdb' bus='virtio'/> >>>> <alias name='virtio-disk1'/> >>>> <address type='pci' domain='0x0000' bus='0x00' slot='0x06' >>>> function='0x0'/> >>>> </disk> >>>> <controller type='ide' index='0'> >>>> <alias name='ide0'/> >>>> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' >>>> function='0x1'/> >>>> </controller> >>>> >>>> >>>> Thank you very much. It is exactly the same output as mine, particularly >>> <driver name='file' type='qcow2'/> >>> I thought it has to be name='qemu' to detach properly but since you >> didn't >>> have a problem, I am very lost on why mine didn't work. >>> >>> My libvirtd.log shows (with debugging turned on) >>> 14:43:18.965: debug : qemuMonitorCommandWithHandler:235 : Receive command >>> reply ret=0 errno=0 33 bytes 'Device 'virtio-disk1' not found^M >>> ' >>> 14:43:18.965: debug : virEventDispatchTimeouts:405 : Dispatch 3 >>> 14:43:18.965: debug : virEventDispatchHandles:450 : Dispatch 8 >>> 14:43:18.965: error : qemuMonitorTextDelDevice:2314 : operation failed: >>> detaching virtio-disk1 device failed: Device 'virtio-disk1' not found^M >>> >>> Do you know what the "device not found" error means? >> >> It seems attaching virtio-disk1 failed. >> Can you provide the log when you attach virtio-disk1? >> >> Thanks. >> Wen Congyang >> >>> >>> Thanks. >>> >>> Shi >>> >> >> > >
-- Shi Jin, Ph.D.
-- Shi Jin, Ph.D.
-- Shi Jin, Ph.D.
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

More information: If I simply insert this in the XML and call "virsh create", <disk type='file' device='disk'> <driver name='file' type='qcow2'/> <source file='/vrstorm/cloud/PrivateAccounts/74d37709b07be4bbae228dfc273e4339/volumes/vol-126'/> <target dev='vdb' bus='virtio'/> </disk> it would fail with [cloudadmin@test2 images]$ virsh create vdb.xml error: Failed to create domain from vdb.xml error: internal error unsupported driver name 'file' for disk '<diskname>' On the other hand, if I change the driver name to 'qemu', not only "virsh create" works, I can also call "virsh detach-disk <vmname> vdb" to detach the disk successfully. It seems to clear to me that this is a bug in libvirt attach-disk in terms of setting driver name to 'file' instead of 'qemu'. Shi
participants (4)
-
Dave Allan
-
Shi Jin
-
Shi Jin
-
Wen Congyang