[libvirt] virDomainAttachDevice error during disk hotplug

Hi All, I am trying to do a hotplug of a disk from VDSM (which uses libvirt to get things done). I hit the below error "operation failed: open disk image file failed" comign from virDomainAttachDevice. Some background: 1) The qemu-img create cmd I use (inside vdsm) to create the file being hotplugged is /usr/bin/qemu-img create -f qcow2 -F qcow2 -b /rhev/data-center/000065de-04b8-42e2-986c-2de664708be7/11112d24-4cda-4200-8f6d-a1d8362c70fd/images/22224c45-6504-4ea1-bd24-12340017dd32/3333017d-1278-4bfb-8129-62bded257399 /var/run/vdsm/3333017d-1278-4bfb-8129-62bded257399' (cwd /var/run/vdsm) I even tried using the rel. backing path instead of abs. path as below.. /usr/bin/qemu-img create -f qcow2 -F qcow2 -b ../../../rhev/data-center/000065de-04b8-42e2-986c-2de664708be7/11112d24-4cda-4200-8f6d-a1d8362c70fd/images/22224c45-6504-4ea1-bd24-12340017dd32/3333017d-1278-4bfb-8129-62bded257399 /var/run/vdsm/3333017d-1278-4bfb-8129-62bded257399' (cwd /var/run/vdsm) but hit the same error during hotplug operation 2) qemu-img info /var/run/vdsm/3333017d-1278-4bfb-8129-62bded257399 image: /var/run/vdsm/3333017d-1278-4bfb-8129-62bded257399 file format: qcow2 virtual size: 3.8G (4096000000 bytes) disk size: 196K cluster_size: 65536 backing file: /rhev/data-center/000065de-04b8-42e2-986c-2de664708be7/11112d24-4cda-4200-8f6d-a1d8362c70fd/images/22224c45-6504-4ea1-bd24-12340017dd32/3333017d-1278-4bfb-8129-62bded257399 backing file format: qcow2 3) ls -l /rhev/data-center/000065de-04b8-42e2-986c-2de664708be7/11112d24-4cda-4200-8f6d-a1d8362c70fd/images/22224c45-6504-4ea1-bd24-12340017dd32/3333017d-1278-4bfb-8129-62bded257399 -r--r-----. 1 vdsm kvm 197120 Aug 10 11:59 /rhev/data-center/000065de-04b8-42e2-986c-2de664708be7/11112d24-4cda-4200-8f6d-a1d8362c70fd/images/22224c45-6504-4ea1-bd24-12340017dd32/3333017d-1278-4bfb-8129-62bded257399 4) libvirtd.log snippets: 2013-08-10 11:19:41.766+0000: 1103: debug : virDomainAttachDevice:9820 : dom=0x7f92f4003f20, (VM: name=dpk_BR_vm, uuid=9999017d-1278-4bfb-8129-62bded257399), xml=<disk device="disk" snapshot="no" type="file"> <source file="/var/run/vdsm/3333017d-1278-4bfb-8129-62bded257399"/> <target bus="virtio" dev="vdb"/> <serial>22224c45-6504-4ea1-bd24-12340017dd32</serial> <driver cache="none" error_policy="stop" io="threads" name="qemu" type="qcow2"/> </disk> 2013-08-10 11:19:41.766+0000: 1103: debug : qemuDomainObjBeginJobInternal:958 : Starting job: modify (async=none) 2013-08-10 11:19:41.766+0000: 1103: debug : virStorageFileGetMetadata:1007 : path=/var/run/vdsm/3333017d-1278-4bfb-8129-62bded257399 format=9 uid=107 gid=107 probe=0 2013-08-10 11:19:41.766+0000: 1103: debug : virStorageFileGetMetadataRecurse:939 : path=/var/run/vdsm/3333017d-1278-4bfb-8129-62bded257399 format=9 uid=107 gid=107 probe=0 2013-08-10 11:19:41.767+0000: 1103: debug : virStorageFileGetMetadataInternal:687 : path=/var/run/vdsm/3333017d-1278-4bfb-8129-62bded257399, fd=25, format=9 2013-08-10 11:19:41.770+0000: 1103: debug : virStorageFileGetMetadataRecurse:939 : path=/home/dpkshetty/libSM_disk/localstoragedomain/11112d24-4cda-4200-8f6d-a1d8362c70fd/images/22224c45-6504-4ea1-bd24-12340017dd32/3333017d-1278-4bfb-8129-62bded257399 format=9 uid=107 gid=107 probe=0 2013-08-10 11:19:41.770+0000: 1103: debug : virStorageFileGetMetadataInternal:687 : path=/home/dpkshetty/libSM_disk/localstoragedomain/11112d24-4cda-4200-8f6d-a1d8362c70fd/images/22224c45-6504-4ea1-bd24-12340017dd32/3333017d-1278-4bfb-8129-62bded257399, fd=25, format=9 2013-08-10 11:19:41.770+0000: 1103: debug : qemuDomainPCIAddressGetNextSlot:1826 : Found free PCI slot 0000:00:05 2013-08-10 11:19:41.770+0000: 1103: debug : qemuDomainPCIAddressReserveSlot:1710 : Reserving PCI slot 0000:00:05.0 2013-08-10 11:19:41.770+0000: 1103: debug : qemuMonitorAddDrive:2756 : mon=0x7f92f0007830 drive=file=/var/run/vdsm/3333017d-1278-4bfb-8129-62bded257399,if=none,id=drive-virtio-disk1,format=qcow2,serial=22224c45-6504-4ea1-bd24-12340017dd32,cache=none,werror=stop,rerror=stop,aio=threads 2013-08-10 11:19:41.770+0000: 1103: debug : qemuMonitorSend:887 : QEMU_MONITOR_SEND_MSG: mon=0x7f92f0007830 msg={"execute":"human-monitor-command","arguments":{"command-line":"drive_add dummy file=/var/run/vdsm/3333017d-1278-4bfb-8129-62bded257399,if=none,id=drive-virtio-disk1,format=qcow2,serial=22224c45-6504-4ea1-bd24-12340017dd32,cache=none,werror=stop,rerror=stop,aio=threads"},"id":"libvirt-67"}^M fd=-1 2013-08-10 11:19:41.771+0000: 1091: debug : qemuMonitorIOWrite:453 : QEMU_MONITOR_IO_WRITE: mon=0x7f92f0007830 buf={"execute":"human-monitor-command","arguments":{"command-line":"drive_add dummy file=/var/run/vdsm/3333017d-1278-4bfb-8129-62bded257399,if=none,id=drive-virtio-disk1,format=qcow2,serial=22224c45-6504-4ea1-bd24-12340017dd32,cache=none,werror=stop,rerror=stop,aio=threads"},"id":"libvirt-67"}^M len=292 ret=292 errno=11 2013-08-10 11:19:41.772+0000: 1091: debug : qemuMonitorIOProcess:345 : QEMU_MONITOR_IO_PROCESS: mon=0x7f92f0007830 buf={"return": "could not open disk image /var/run/vdsm/3333017d-1278-4bfb-8129-62bded257399: Invalid argument\r\n", "id": "libvirt-67"}^M len=134 2013-08-10 11:19:41.772+0000: 1103: error : qemuMonitorTextAddDrive:2697 : operation failed: open disk image file failed 2013-08-10 11:19:41.773+0000: 1103: debug : qemuDomainObjEndJob:1070 : Stopping job: modify (async=none) --------------- Any hints on what could be the issues will help. I can try out few things, if someone could provide suggestions. thanx, deepak

On 08/10/2013 05:38 PM, Deepak C Shetty wrote:
Hi All, I am trying to do a hotplug of a disk from VDSM (which uses libvirt to get things done). I hit the below error "operation failed: open disk image file failed" comign from virDomainAttachDevice.
Some background:
1) The qemu-img create cmd I use (inside vdsm) to create the file being hotplugged is
/usr/bin/qemu-img create -f qcow2 -F qcow2 -b /rhev/data-center/000065de-04b8-42e2-986c-2de664708be7/11112d24-4cda-4200-8f6d-a1d8362c70fd/images/22224c45-6504-4ea1-bd24-12340017dd32/3333017d-1278-4bfb-8129-62bded257399 /var/run/vdsm/3333017d-1278-4bfb-8129-62bded257399' (cwd /var/run/vdsm)
I even tried using the rel. backing path instead of abs. path as below..
/usr/bin/qemu-img create -f qcow2 -F qcow2 -b ../../../rhev/data-center/000065de-04b8-42e2-986c-2de664708be7/11112d24-4cda-4200-8f6d-a1d8362c70fd/images/22224c45-6504-4ea1-bd24-12340017dd32/3333017d-1278-4bfb-8129-62bded257399 /var/run/vdsm/3333017d-1278-4bfb-8129-62bded257399' (cwd /var/run/vdsm)
but hit the same error during hotplug operation
2) qemu-img info /var/run/vdsm/3333017d-1278-4bfb-8129-62bded257399 image: /var/run/vdsm/3333017d-1278-4bfb-8129-62bded257399 file format: qcow2 virtual size: 3.8G (4096000000 bytes) disk size: 196K cluster_size: 65536 backing file: /rhev/data-center/000065de-04b8-42e2-986c-2de664708be7/11112d24-4cda-4200-8f6d-a1d8362c70fd/images/22224c45-6504-4ea1-bd24-12340017dd32/3333017d-1278-4bfb-8129-62bded257399 backing file format: qcow2
3) ls -l /rhev/data-center/000065de-04b8-42e2-986c-2de664708be7/11112d24-4cda-4200-8f6d-a1d8362c70fd/images/22224c45-6504-4ea1-bd24-12340017dd32/3333017d-1278-4bfb-8129-62bded257399 -r--r-----. 1 vdsm kvm 197120 Aug 10 11:59 /rhev/data-center/000065de-04b8-42e2-986c-2de664708be7/11112d24-4cda-4200-8f6d-a1d8362c70fd/images/22224c45-6504-4ea1-bd24-12340017dd32/3333017d-1278-4bfb-8129-62bded257399
The above is the backing file path listing. Adding the file-to-be-hotplugged path listing below. ls -l /var/run/vdsm/ total 216 -rw-rw----. 1 vdsm kvm 197120 Aug 10 12:00 3333017d-1278-4bfb-8129-62bded257399 It has the right rw perms....but still I see "open disk image file failed" error thanx, deepak
4) libvirtd.log snippets:
2013-08-10 11:19:41.766+0000: 1103: debug : virDomainAttachDevice:9820 : dom=0x7f92f4003f20, (VM: name=dpk_BR_vm, uuid=9999017d-1278-4bfb-8129-62bded257399), xml=<disk device="disk" snapshot="no" type="file"> <source file="/var/run/vdsm/3333017d-1278-4bfb-8129-62bded257399"/> <target bus="virtio" dev="vdb"/> <serial>22224c45-6504-4ea1-bd24-12340017dd32</serial> <driver cache="none" error_policy="stop" io="threads" name="qemu" type="qcow2"/> </disk>
2013-08-10 11:19:41.766+0000: 1103: debug : qemuDomainObjBeginJobInternal:958 : Starting job: modify (async=none) 2013-08-10 11:19:41.766+0000: 1103: debug : virStorageFileGetMetadata:1007 : path=/var/run/vdsm/3333017d-1278-4bfb-8129-62bded257399 format=9 uid=107 gid=107 probe=0 2013-08-10 11:19:41.766+0000: 1103: debug : virStorageFileGetMetadataRecurse:939 : path=/var/run/vdsm/3333017d-1278-4bfb-8129-62bded257399 format=9 uid=107 gid=107 probe=0 2013-08-10 11:19:41.767+0000: 1103: debug : virStorageFileGetMetadataInternal:687 : path=/var/run/vdsm/3333017d-1278-4bfb-8129-62bded257399, fd=25, format=9 2013-08-10 11:19:41.770+0000: 1103: debug : virStorageFileGetMetadataRecurse:939 : path=/home/dpkshetty/libSM_disk/localstoragedomain/11112d24-4cda-4200-8f6d-a1d8362c70fd/images/22224c45-6504-4ea1-bd24-12340017dd32/3333017d-1278-4bfb-8129-62bded257399 format=9 uid=107 gid=107 probe=0 2013-08-10 11:19:41.770+0000: 1103: debug : virStorageFileGetMetadataInternal:687 : path=/home/dpkshetty/libSM_disk/localstoragedomain/11112d24-4cda-4200-8f6d-a1d8362c70fd/images/22224c45-6504-4ea1-bd24-12340017dd32/3333017d-1278-4bfb-8129-62bded257399, fd=25, format=9 2013-08-10 11:19:41.770+0000: 1103: debug : qemuDomainPCIAddressGetNextSlot:1826 : Found free PCI slot 0000:00:05 2013-08-10 11:19:41.770+0000: 1103: debug : qemuDomainPCIAddressReserveSlot:1710 : Reserving PCI slot 0000:00:05.0 2013-08-10 11:19:41.770+0000: 1103: debug : qemuMonitorAddDrive:2756 : mon=0x7f92f0007830 drive=file=/var/run/vdsm/3333017d-1278-4bfb-8129-62bded257399,if=none,id=drive-virtio-disk1,format=qcow2,serial=22224c45-6504-4ea1-bd24-12340017dd32,cache=none,werror=stop,rerror=stop,aio=threads 2013-08-10 11:19:41.770+0000: 1103: debug : qemuMonitorSend:887 : QEMU_MONITOR_SEND_MSG: mon=0x7f92f0007830 msg={"execute":"human-monitor-command","arguments":{"command-line":"drive_add dummy file=/var/run/vdsm/3333017d-1278-4bfb-8129-62bded257399,if=none,id=drive-virtio-disk1,format=qcow2,serial=22224c45-6504-4ea1-bd24-12340017dd32,cache=none,werror=stop,rerror=stop,aio=threads"},"id":"libvirt-67"}^M fd=-1 2013-08-10 11:19:41.771+0000: 1091: debug : qemuMonitorIOWrite:453 : QEMU_MONITOR_IO_WRITE: mon=0x7f92f0007830 buf={"execute":"human-monitor-command","arguments":{"command-line":"drive_add dummy file=/var/run/vdsm/3333017d-1278-4bfb-8129-62bded257399,if=none,id=drive-virtio-disk1,format=qcow2,serial=22224c45-6504-4ea1-bd24-12340017dd32,cache=none,werror=stop,rerror=stop,aio=threads"},"id":"libvirt-67"}^M len=292 ret=292 errno=11 2013-08-10 11:19:41.772+0000: 1091: debug : qemuMonitorIOProcess:345 : QEMU_MONITOR_IO_PROCESS: mon=0x7f92f0007830 buf={"return": "could not open disk image /var/run/vdsm/3333017d-1278-4bfb-8129-62bded257399: Invalid argument\r\n", "id": "libvirt-67"}^M len=134 2013-08-10 11:19:41.772+0000: 1103: error : qemuMonitorTextAddDrive:2697 : operation failed: open disk image file failed 2013-08-10 11:19:41.773+0000: 1103: debug : qemuDomainObjEndJob:1070 : Stopping job: modify (async=none)
---------------
Any hints on what could be the issues will help. I can try out few things, if someone could provide suggestions.
thanx, deepak
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

On 08/10/2013 06:20 PM, Deepak C Shetty wrote:
2013-08-10 11:19:41.772+0000: 1091: debug : qemuMonitorIOProcess:345 : QEMU_MONITOR_IO_PROCESS: mon=0x7f92f0007830 buf={"return": "could not open disk image /var/run/vdsm/3333017d-1278-4bfb-8129-62bded257399: Invalid argument\r\n", "id": "libvirt-67"}^M
Any suggestions from anyone on why "Invalid Argument" is being returned ? On the cmd line qemu-img info works just fine for /var/run/vdsm/3333017d-1278-4bfb-8129-62bded257399 thanx, deepak

On Fri, Aug 16, 2013 at 06:51:21PM +0530, Deepak C Shetty wrote:
On 08/10/2013 06:20 PM, Deepak C Shetty wrote:
2013-08-10 11:19:41.772+0000: 1091: debug : qemuMonitorIOProcess:345 : QEMU_MONITOR_IO_PROCESS: mon=0x7f92f0007830 buf={"return": "could not open disk image /var/run/vdsm/3333017d-1278-4bfb-8129-62bded257399: Invalid argument\r\n", "id": "libvirt-67"}^M
Any suggestions from anyone on why "Invalid Argument" is being returned ?
QEMU's error reporting for disk configs is known to be worse than useless. You can't infer anything useful from "Invalid Argument" I'm afraid. Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On Fri, Aug 16, 2013 at 8:30 AM, Daniel P. Berrange <berrange@redhat.com>wrote:
On Fri, Aug 16, 2013 at 06:51:21PM +0530, Deepak C Shetty wrote:
On 08/10/2013 06:20 PM, Deepak C Shetty wrote:
2013-08-10 11:19:41.772+0000: 1091: debug : qemuMonitorIOProcess:345 : QEMU_MONITOR_IO_PROCESS: mon=0x7f92f0007830 buf={"return": "could not open disk image /var/run/vdsm/3333017d-1278-4bfb-8129-62bded257399: Invalid argument\r\n", "id": "libvirt-67"}^M
Any suggestions from anyone on why "Invalid Argument" is being returned ?
QEMU's error reporting for disk configs is known to be worse than useless. You can't infer anything useful from "Invalid Argument" I'm afraid.
I'm going to go out on a limb here and say its an O_DIRECT error. Reason I'm guessing this is that O_DIRECT is not supported on tmpfs and when you attempt to open() a file with O_DIRECT and its not supported you'll get back -EINVAL from the kernel. Newer systems have /run as tmpfs and /var/run symlinked to /run. -- Doug Goldstein

On 08/17/2013 02:18 AM, Doug Goldstein wrote:
On Fri, Aug 16, 2013 at 8:30 AM, Daniel P. Berrange <berrange@redhat.com <mailto:berrange@redhat.com>> wrote:
On Fri, Aug 16, 2013 at 06:51:21PM +0530, Deepak C Shetty wrote: > On 08/10/2013 06:20 PM, Deepak C Shetty wrote: > >2013-08-10 11:19:41.772+0000: 1091: debug : > >qemuMonitorIOProcess:345 : QEMU_MONITOR_IO_PROCESS: > >mon=0x7f92f0007830 buf={"return": "could not open disk image > >/var/run/vdsm/3333017d-1278-4bfb-8129-62bded257399: Invalid > >argument\r\n", "id": "libvirt-67"}^M > > Any suggestions from anyone on why "Invalid Argument" is being returned ?
QEMU's error reporting for disk configs is known to be worse than useless. You can't infer anything useful from "Invalid Argument" I'm afraid.
I'm going to go out on a limb here and say its an O_DIRECT error. Reason I'm guessing this is that O_DIRECT is not supported on tmpfs and when you attempt to open() a file with O_DIRECT and its not supported you'll get back -EINVAL from the kernel. Newer systems have /run as tmpfs and /var/run symlinked to /run.
Bingo!!! Thanks Doug.. thats probably the right reason. Moving the file to a diff dir thats not on tmpfs works! I was abt to start debugging from qemu perspective, but now i think thats not needed. I wish i had thot abt this earlier... would have saved fews days for me! thanx, deepak
-- Doug Goldstein

On Fri, Aug 16, 2013 at 03:48:25PM -0500, Doug Goldstein wrote:
On Fri, Aug 16, 2013 at 8:30 AM, Daniel P. Berrange <berrange@redhat.com>wrote:
On Fri, Aug 16, 2013 at 06:51:21PM +0530, Deepak C Shetty wrote:
On 08/10/2013 06:20 PM, Deepak C Shetty wrote:
2013-08-10 11:19:41.772+0000: 1091: debug : qemuMonitorIOProcess:345 : QEMU_MONITOR_IO_PROCESS: mon=0x7f92f0007830 buf={"return": "could not open disk image /var/run/vdsm/3333017d-1278-4bfb-8129-62bded257399: Invalid argument\r\n", "id": "libvirt-67"}^M
Any suggestions from anyone on why "Invalid Argument" is being returned ?
QEMU's error reporting for disk configs is known to be worse than useless. You can't infer anything useful from "Invalid Argument" I'm afraid.
I'm going to go out on a limb here and say its an O_DIRECT error. Reason I'm guessing this is that O_DIRECT is not supported on tmpfs and when you attempt to open() a file with O_DIRECT and its not supported you'll get back -EINVAL from the kernel. Newer systems have /run as tmpfs and /var/run symlinked to /run.
Oh, yes, good one. I really wish QEMU would provide a better error message for this case, since people hit it all the time Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On 08/19/2013 03:13 PM, Daniel P. Berrange wrote:
On Fri, Aug 16, 2013 at 03:48:25PM -0500, Doug Goldstein wrote:
On Fri, Aug 16, 2013 at 8:30 AM, Daniel P. Berrange <berrange@redhat.com>wrote:
On Fri, Aug 16, 2013 at 06:51:21PM +0530, Deepak C Shetty wrote:
On 08/10/2013 06:20 PM, Deepak C Shetty wrote:
2013-08-10 11:19:41.772+0000: 1091: debug : qemuMonitorIOProcess:345 : QEMU_MONITOR_IO_PROCESS: mon=0x7f92f0007830 buf={"return": "could not open disk image /var/run/vdsm/3333017d-1278-4bfb-8129-62bded257399: Invalid argument\r\n", "id": "libvirt-67"}^M Any suggestions from anyone on why "Invalid Argument" is being returned ? QEMU's error reporting for disk configs is known to be worse than useless. You can't infer anything useful from "Invalid Argument" I'm afraid.
I'm going to go out on a limb here and say its an O_DIRECT error. Reason I'm guessing this is that O_DIRECT is not supported on tmpfs and when you attempt to open() a file with O_DIRECT and its not supported you'll get back -EINVAL from the kernel. Newer systems have /run as tmpfs and /var/run symlinked to /run. Oh, yes, good one.
I really wish QEMU would provide a better error message for this case, since people hit it all the time
And (thanks to my colleague bharata) removing "cache=none" attribute from the <driver> tag of <disk> xml made it work even on tmpfs , since qemu uses O_DIRECT only when cache=none
Daniel

On Sat, Aug 10, 2013 at 05:38:20PM +0530, Deepak C Shetty wrote:
Hi All, I am trying to do a hotplug of a disk from VDSM (which uses libvirt to get things done). I hit the below error "operation failed: open disk image file failed" comign from virDomainAttachDevice.
1) The qemu-img create cmd I use (inside vdsm) to create the file being hotplugged is
/usr/bin/qemu-img create -f qcow2 -F qcow2 -b /rhev/data-center/000065de-04b8-42e2-986c-2de664708be7/11112d24-4cda-4200-8f6d-a1d8362c70fd/images/22224c45-6504-4ea1-bd24-12340017dd32/3333017d-1278-4bfb-8129-62bded257399 /var/run/vdsm/3333017d-1278-4bfb-8129-62bded257399' (cwd /var/run/vdsm)
So here you're using paths under /rhev or /var/run/vdsm.
2013-08-10 11:19:41.770+0000: 1103: debug : virStorageFileGetMetadataRecurse:939 : path=/home/dpkshetty/libSM_disk/localstoragedomain/11112d24-4cda-4200-8f6d-a1d8362c70fd/images/22224c45-6504-4ea1-bd24-12340017dd32/3333017d-1278-4bfb-8129-62bded257399
This log suggests those paths are just symlinks into your home directory. What permissions are set on /home/dpkshetty ? By default $HOME permissions will not allow any other user to access files under it. So you would have to do 'chmod o+x /home/dpkshetty' to make this work Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On 08/16/2013 06:59 PM, Daniel P. Berrange wrote:
On Sat, Aug 10, 2013 at 05:38:20PM +0530, Deepak C Shetty wrote:
Hi All, I am trying to do a hotplug of a disk from VDSM (which uses libvirt to get things done). I hit the below error "operation failed: open disk image file failed" comign from virDomainAttachDevice. 1) The qemu-img create cmd I use (inside vdsm) to create the file being hotplugged is
/usr/bin/qemu-img create -f qcow2 -F qcow2 -b /rhev/data-center/000065de-04b8-42e2-986c-2de664708be7/11112d24-4cda-4200-8f6d-a1d8362c70fd/images/22224c45-6504-4ea1-bd24-12340017dd32/3333017d-1278-4bfb-8129-62bded257399 /var/run/vdsm/3333017d-1278-4bfb-8129-62bded257399' (cwd /var/run/vdsm) So here you're using paths under /rhev or /var/run/vdsm.
Sorry, didn't get your Q here
2013-08-10 11:19:41.770+0000: 1103: debug : virStorageFileGetMetadataRecurse:939 : path=/home/dpkshetty/libSM_disk/localstoragedomain/11112d24-4cda-4200-8f6d-a1d8362c70fd/images/22224c45-6504-4ea1-bd24-12340017dd32/3333017d-1278-4bfb-8129-62bded257399 This log suggests those paths are just symlinks into your home directory.
Yes, and these are setup by vdsm which sets the entire path with proper vdsm.kvm perms. id 'qemu' is also part of 'kvm' group.
What permissions are set on /home/dpkshetty ? By default $HOME permissions will not allow any other user to access files under it. So you would have to do 'chmod o+x /home/dpkshetty' to make this work
For instance... [root@vdsm_tsm_int_f19 vdsm]# ls -l /| grep home drwxr-xr-x. 3 root root 4096 Aug 8 19:53 home [root@vdsm_tsm_int_f19 vdsm]# ls -l /home | grep dpk drwx--x--x. 15 dpkshetty dpkshetty 4096 Aug 9 17:44 dpkshetty [root@vdsm_tsm_int_f19 vdsm]# ls -l /home/dpkshetty | grep libSM drwxr-xr-x. 16 dpkshetty dpkshetty 4096 Aug 9 18:36 libSM_disk If perms weren't rite, qemu says "permission denied"... but this is diff, it says "failed to open disk image" Atleast perms wise I feel i am fine here. [root@vdsm_tsm_int_f19 vdsm]# su - qemu -s /bin/bash -bash-4.2$ id uid=107(qemu) gid=107(qemu) groups=107(qemu),36(kvm) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 -bash-4.2$ qemu-img info /var/run/vdsm/3333017d-1278-4bfb-8129-62bded257399 image: /var/run/vdsm/3333017d-1278-4bfb-8129-62bded257399 file format: qcow2 virtual size: 3.8G (4096000000 bytes) disk size: 196K cluster_size: 65536 backing file: /rhev/data-center/000065de-04b8-42e2-986c-2de664708be7/11112d24-4cda-4200-8f6d-a1d8362c70fd/images/22224c45-6504-4ea1-bd24-12340017dd32/3333017d-1278-4bfb-8129-62bded257399 backing file format: qcow2 -bash-4.2$ getenforce Permissive -bash-4.2$ ls -l /rhev/data-center/000065de-04b8-42e2-986c-2de664708be7/11112d24-4cda-4200-8f6d-a1d8362c70fd/images/22224c45-6504-4ea1-bd24-12340017dd32/3333017d-1278-4bfb-8129-62bded257399 -r--r-----. 1 vdsm kvm 197120 Aug 16 12:42 /rhev/data-center/000065de-04b8-42e2-986c-2de664708be7/11112d24-4cda-4200-8f6d-a1d8362c70fd/images/22224c45-6504-4ea1-bd24-12340017dd32/3333017d-1278-4bfb-8129-62bded257399 -bash-4.2$ qemu-img info /rhev/data-center/000065de-04b8-42e2-986c-2de664708be7/11112d24-4cda-4200-8f6d-a1d8362c70fd/images/22224c45-6504-4ea1-bd24-12340017dd32/3333017d-1278-4bfb-8129-62bded257399 image: /rhev/data-center/000065de-04b8-42e2-986c-2de664708be7/11112d24-4cda-4200-8f6d-a1d8362c70fd/images/22224c45-6504-4ea1-bd24-12340017dd32/3333017d-1278-4bfb-8129-62bded257399 file format: qcow2 virtual size: 3.8G (4096000000 bytes) disk size: 136K cluster_size: 65536
Daniel

On Sat, Aug 10, 2013 at 05:38:20PM +0530, Deepak C Shetty wrote:
Hi All, I am trying to do a hotplug of a disk from VDSM (which uses libvirt to get things done). I hit the below error "operation failed: open disk image file failed" comign from virDomainAttachDevice.
Some background:
1) The qemu-img create cmd I use (inside vdsm) to create the file being hotplugged is
/usr/bin/qemu-img create -f qcow2 -F qcow2 -b /rhev/data-center/000065de-04b8-42e2-986c-2de664708be7/11112d24-4cda-4200-8f6d-a1d8362c70fd/images/22224c45-6504-4ea1-bd24-12340017dd32/3333017d-1278-4bfb-8129-62bded257399 /var/run/vdsm/3333017d-1278-4bfb-8129-62bded257399' (cwd /var/run/vdsm)
I even tried using the rel. backing path instead of abs. path as below..
/usr/bin/qemu-img create -f qcow2 -F qcow2 -b ../../../rhev/data-center/000065de-04b8-42e2-986c-2de664708be7/11112d24-4cda-4200-8f6d-a1d8362c70fd/images/22224c45-6504-4ea1-bd24-12340017dd32/3333017d-1278-4bfb-8129-62bded257399 /var/run/vdsm/3333017d-1278-4bfb-8129-62bded257399' (cwd /var/run/vdsm)
but hit the same error during hotplug operation
2) qemu-img info /var/run/vdsm/3333017d-1278-4bfb-8129-62bded257399 image: /var/run/vdsm/3333017d-1278-4bfb-8129-62bded257399 file format: qcow2 virtual size: 3.8G (4096000000 bytes) disk size: 196K cluster_size: 65536 backing file: /rhev/data-center/000065de-04b8-42e2-986c-2de664708be7/11112d24-4cda-4200-8f6d-a1d8362c70fd/images/22224c45-6504-4ea1-bd24-12340017dd32/3333017d-1278-4bfb-8129-62bded257399 backing file format: qcow2
What does this show qemu-img info /rhev/data-center/000065de-04b8-42e2-986c-2de664708be7/11112d24-4cda-4200-8f6d-a1d8362c70fd/images/22224c45-6504-4ea1-bd24-12340017dd32/3333017d-1278-4bfb-8129-62bded257399 ? Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On 08/16/2013 07:51 PM, Daniel P. Berrange wrote:
On Sat, Aug 10, 2013 at 05:38:20PM +0530, Deepak C Shetty wrote:
Hi All, I am trying to do a hotplug of a disk from VDSM (which uses libvirt to get things done). I hit the below error "operation failed: open disk image file failed" comign from virDomainAttachDevice.
Some background:
1) The qemu-img create cmd I use (inside vdsm) to create the file being hotplugged is
/usr/bin/qemu-img create -f qcow2 -F qcow2 -b /rhev/data-center/000065de-04b8-42e2-986c-2de664708be7/11112d24-4cda-4200-8f6d-a1d8362c70fd/images/22224c45-6504-4ea1-bd24-12340017dd32/3333017d-1278-4bfb-8129-62bded257399 /var/run/vdsm/3333017d-1278-4bfb-8129-62bded257399' (cwd /var/run/vdsm)
I even tried using the rel. backing path instead of abs. path as below..
/usr/bin/qemu-img create -f qcow2 -F qcow2 -b ../../../rhev/data-center/000065de-04b8-42e2-986c-2de664708be7/11112d24-4cda-4200-8f6d-a1d8362c70fd/images/22224c45-6504-4ea1-bd24-12340017dd32/3333017d-1278-4bfb-8129-62bded257399 /var/run/vdsm/3333017d-1278-4bfb-8129-62bded257399' (cwd /var/run/vdsm)
but hit the same error during hotplug operation
2) qemu-img info /var/run/vdsm/3333017d-1278-4bfb-8129-62bded257399 image: /var/run/vdsm/3333017d-1278-4bfb-8129-62bded257399 file format: qcow2 virtual size: 3.8G (4096000000 bytes) disk size: 196K cluster_size: 65536 backing file: /rhev/data-center/000065de-04b8-42e2-986c-2de664708be7/11112d24-4cda-4200-8f6d-a1d8362c70fd/images/22224c45-6504-4ea1-bd24-12340017dd32/3333017d-1278-4bfb-8129-62bded257399 backing file format: qcow2 What does this show
qemu-img info /rhev/data-center/000065de-04b8-42e2-986c-2de664708be7/11112d24-4cda-4200-8f6d-a1d8362c70fd/images/22224c45-6504-4ea1-bd24-12340017dd32/3333017d-1278-4bfb-8129-62bded257399
?
[root@vdsm_tsm_int_f19 vdsm]# qemu-img info /rhev/data-center/000065de-04b8-42e2-986c-2de664708be7/11112d24-4cda-4200-8f6d-a1d8362c70fd/images/22224c45-6504-4ea1-bd24-12340017dd32/3333017d-1278-4bfb-8129-62bded257399 image: /rhev/data-center/000065de-04b8-42e2-986c-2de664708be7/11112d24-4cda-4200-8f6d-a1d8362c70fd/images/22224c45-6504-4ea1-bd24-12340017dd32/3333017d-1278-4bfb-8129-62bded257399 file format: qcow2 virtual size: 3.8G (4096000000 bytes) disk size: 136K cluster_size: 65536 [root@vdsm_tsm_int_f19 vdsm]# ls -l /rhev/data-center/000065de-04b8-42e2-986c-2de664708be7/11112d24-4cda-4200-8f6d-a1d8362c70fd/images/22224c45-6504-4ea1-bd24-12340017dd32/3333017d-1278-4bfb-8129-62bded257399 -r--r-----. 1 vdsm kvm 197120 Aug 16 18:28 /rhev/data-center/000065de-04b8-42e2-986c-2de664708be7/11112d24-4cda-4200-8f6d-a1d8362c70fd/images/22224c45-6504-4ea1-bd24-12340017dd32/3333017d-1278-4bfb-8129-62bded257399 thanx, deepak
Daniel
participants (3)
-
Daniel P. Berrange
-
Deepak C Shetty
-
Doug Goldstein