Description of problem: When trying to create a LV using virsh, libvirt calls lvcreate with the wrong parameters causing the creation of the LV to fail. Version-Release number of selected component (if applicable): lvm: 2.02.84-3 libvirt: 0.9.2-1 OS: Debian/Squeeze How reproducible: Fully reproducible. Steps to Reproduce: 1. Create a LVM-based storage pool 2. Create a LVM-based volume on this storage pool Actual results: (Note that I'm using a nested VG for this example) $ virsh pool-define-as virtpool logical /dev/storage/virtpool Pool virtpool defined $ virsh pool-autostart virtpool Pool virtpool marked as autostarted $ virsh pool-start virtpool Pool virtpool started $ virsh vol-create-as virtpool machine1 3G error: Failed to create vol machine1 error: internal error '/sbin/lvcreate --name machine1 -L 3145728K /dev/storage/virtpool' exited unexpectedly: exit status 3 $ sudo lvcreate --name machine1 -L 3145728K /dev/storage/virtpool Volume group name expected (no slash) Run `lvcreate --help' for more information. $ sudo lvcreate --name machine1 -L 3145728K virtpool Logical volume "machine1" created Expected results: Creation of the LVM-based volume. Additional info: Looking up this error within the LVM source code, I find the following snippet: ... if (strrchr(vg_name, '/')) { log_error("Volume group name expected " "(no slash)"); return 0; } ... (http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/tools/lvcreate.c?rev=1.231&content-type=text/x-cvsweb-markup&cvsroot=lvm2) When I lookup the hook within the the libvirt source code, I find the following snippet: ... const char *cmdargvnew[] = { LVCREATE, "--name", vol->name, "-L", size, pool->def->target.path, NULL }; ... (http://libvirt.org/git/?p=libvirt.git;a=blob_plain;f=src/storage/storage_backend_logical.c;hb=HEAD) Judging by the code, 'pool->def->target.path' should be changed to 'pool->def->source.name', however, my knowledge of C is very limited.
For having limited C knowledge that was a great analysis! I think you are right, but I'd like to test this. Problem is I have no idea how you created a nested volume group (fedora 16 doesn't seem to want to put a volume group routed anywhere except /dev, which does work in the lvcreate command because lvm strips it off). Can you provide instructions?
Lex, any thoughts on comment #1, particularly instructions on how to reproduce this issue?
I managed to reproduce using a symlink, upstream is now patched: http://libvirt.org/git/?p=libvirt.git;a=commit;h=cab1a9dee83142dcc795e58d42325a726c100463