[libvirt] LVM storage pool with existing mirrored volumes

Ben Roberts bar105 at zepler.net
Sun Jan 17 15:44:28 UTC 2010


I tried to setup a lvm-backed storage pool, reusing an existing volume
group which already contains a handful of mirrored logical volumes.

For reference, I am using lvm 2.02.56-r3, qemu-kvm and libvirt
0.7.5 on an up-to-date ~amd64 gentoo system.

The first issue I encountered is when trying to activate the storage
pool, the process fails with "internal error lvs command failed". This
appears to be because the output of lvs is slightly different when using
mirrored lvs, and is breaking the parser:

/sbin/lvs --separator , --noheadings --units b --unbuffered --nosuffix
--options lv_name,origin,uuid,devices,seg_size,vg_extent_size bigpool



The device column of output would normally contain something like
"/dev/sda(1234)", but here contains "vms_mimage_0(0),vms_mimage_1(0).

This is causing the parser to misinterpret the output, and it believes
the lv name to be suffixed with a trailing comma, eg "vms,". When trying
to access "/dev/bigpool/vms,", the command errors with File or Directory
not Found.

When adding the --all parameter to lvs, the hidden mirroring lvs are
visible, and these have the expected structure:


Presumably, without the --all parameter and listing the internal
mirroring volumes, libvirt will miscalculate sizes of LVs in the VG.

This bug appears to prevent the use of any volume group which contains
one or more mirrored logical volumes as a backend storage pool.

Ben Roberts
Computer Science MEng, Part IV
Electronics and Computer Science, University of Southampton

More information about the libvir-list mailing list