Bug 561077 - Can't use striped LVs for LVM storage pool
Summary: Can't use striped LVs for LVM storage pool
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 640807
TreeView+ depends on / blocked
 
Reported: 2010-02-02 16:23 UTC by Guido Günther
Modified: 2012-10-04 08:35 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-10-04 08:35:39 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Debian BTS 567966 0 None None None Never

Description Guido Günther 2010-02-02 16:23:54 UTC
Description of problem (from http://bugs.debian.org/567966):

When I tried to use an already existing volume group as a storage pool for
libvirt, it failed with "internal error lvs command failed".

After tracking this down a bit, I find that there is a problem in how libvirt
is parsing the output from the 'lvs' command. It fails if a logical volume is
striped over more than one physical volume. The function
virStorageBackendLogicalFindLVs() as defined in
src/storage/storage_backend_logical.c to be more precise.

Since it assumes there is only one physical volume listed in the lvs output,
it fails with this error later on:
error : virStorageBackendUpdateVolTargetInfo:784 : cannot open volume '/dev/vgcrypt/autobahn-root,,VpmDC9-f9zt-13JG-ftRE-1VeE-PILT-pMAaLC': No such file or directory


The output from my lvs, that is fed to libvirt, is:

# lvs --separator , --noheadings --units b --unbuffered --nosuffix --options lv_name,origin,uuid,devices,seg_size,vg_extent_size
  autobahn-root,,VpmDC9-f9zt-13JG-ftRE-1VeE-PILT-pMAaLC,/dev/block/254:4(0),/dev/block/254:5(0),/dev/block/254:3(0),6442450944,4194304

The regex does not allow for more than one device, so it thinks that the
whole UUID belongs to the LV name as well.

Version-Release number of selected component (if applicable):
0.7.5-5

Comment 1 Daniel Berrangé 2010-02-02 16:34:03 UTC
Also raised on mailing list

http://www.redhat.com/archives/libvir-list/2010-January/msg00501.html

Comment 2 Richard Harman 2012-10-04 04:09:57 UTC
Looks like I just found a new situation where this comma parsing problem rears its ugly head.

I've got three LVM physical volumes in one volume group, that has logical volumes striped across those three physical volumes.

Compare:

# lvs --separator , --noheadings --units b --unbuffered --nosuffix --options lv_name,origin,uuid,devices,seg_size,vg_extent_size
  somename,,w5cyWP-0jY3-QAce-JUMH-GGz0-fEjG-Whfdgg,/dev/md127(67094),/dev/md125(33762),/dev/md126(19415),1696579190784,33554432

to:

# lvs --separator \# --noheadings --units b --unbuffered --nosuffix --options lv_name,origin,uuid,devices,seg_size,vg_extent_size
  somename##w5cyWP-0jY3-QAce-JUMH-GGz0-fEjG-Whfdgg#/dev/md127(67094),/dev/md125(33762),/dev/md126(19415)#1696579190784#33554432


It looks like libvirt is choking on the commas inside the devices field.  Any chance the libvirt separater character can be changed to something lvs doesn't internally use?

Comment 3 Richard Harman 2012-10-04 04:11:48 UTC
Oops, didn't realise I found a bug for the exact problem; I thought I was reading bug 640807.

Comment 4 Daniel Berrangé 2012-10-04 08:35:39 UTC
This bug was fixeda long time back

commit 82c1740ab92682d69ec8f02adb36b13e1902acd1
Author: Osier Yang <jyang>
Date:   Mon Oct 10 20:34:59 2011 +0800

    storage: Do not use comma as seperator for lvs output


Note You need to log in before you can comment on or make changes to this bug.