virtmgr icon indicating copy to clipboard operation
virtmgr copied to clipboard

libvir: error : invalid argument: virStorageVolLookupByPath

Open ezPappi opened this issue 12 years ago • 7 comments

Hi.

I have all my KVM guests installed to LVM disks. Webvirtmgr can see the pool, and list all the guests. But when I'm trying to access them from the menu on the left, I get error 500. Django says: libvir: error : invalid argument: virStorageVolLookupByPath

And the traceback:

Traceback (most recent call last):

File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py", line 111, in get_response response = callback(request, _callback_args, *_callback_kwargs)

File "/var/www/webvirtmgr/polls/views.py", line 1145, in vm hdd_image = get_dom_hdd(storages)

File "/var/www/webvirtmgr/polls/views.py", line 1095, in get_dom_hdd img = conn.storageVolLookupByPath(hdd)

File "/usr/lib/python2.7/dist-packages/libvirt.py", line 3150, in storageVolLookupByPath if ret is None:raise libvirtError('virStorageVolLookupByPath() failed', conn=self)

libvirtError: invalid argument: virStorageVolLookupByPath

This is an issue when a pool is not defined but in my case it is. The /dev/fridge is the volume group where my guests are installed, e.g: --- Logical volume --- LV Path /dev/fridge/mail01 LV Name mail01 VG Name fridge LV UUID ihBj5b-03zN-FcZd-I30o-lmYe-61BS-J0qzYM LV Write Access read/write LV Creation host, time , LV Status available

open 1

LV Size 10.00 GiB Current LE 2560 Segments 1 Allocation inherit Read ahead sectors auto

  • currently set to 6144 Block device 253:4

Virsh shows the pool as well. virsh # pool-info fridge Name: fridge UUID: a1823e4e-d3ce-4ed5-02d0-847f4a601e98 State: running Persistent: yes Autostart: yes Capacity: 5.46 TiB Allocation: 5.22 TiB Available: 239.04 GiB

I can also see the pool in the web interface.

Any idea why this doesn't work?

ezPappi avatar Jan 29 '13 09:01 ezPappi

You need your VG "fridge" add to storage pool.

retspen avatar Jan 29 '13 09:01 retspen

It's already in the pool. See the output of virsh pool-info Additionally:

cat /etc/libvirt/storage/fridge.xml shows: http://pastie.org/private/ntdb6lyuaxd3hexb23q

ezPappi avatar Jan 29 '13 10:01 ezPappi

VM create in WebVirtMgr or have already been created?

retspen avatar Jan 29 '13 10:01 retspen

They have already been there. I created one Logical volume with webvirtmgr but it put an .img in the name of the volume (something I don' want) so I did not use it for that.

ezPappi avatar Jan 29 '13 10:01 ezPappi

Looking at get_img_path function in views.py it seems to want to find .img for volumes.

ezPappi avatar Jan 29 '13 10:01 ezPappi

Yes this funciton find only .img. Fix this bug in new release.

retspen avatar Jan 29 '13 20:01 retspen

Any idea when this will be?

ezPappi avatar Jan 29 '13 22:01 ezPappi