Bug 903600

Summary: creating libvirt storage pools fails for lvm volume groups with striped volumes
Product: Red Hat Enterprise Linux 5 Reporter: Jiri Pallich <jpallich>
Component: libvirtAssignee: Osier Yang <jyang>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: high Docs Contact:
Priority: urgent    
Version: 5.8CC: abienven, bgollahe, bsarathy, cww, dallan, dswegen, dyuan, gsun, jwest, jyang, lyarwood, mzhan, nzhang, pm-eus, rdassen, rsuresh, rwu, tvvcox, whuang, zpeng
Target Milestone: rcKeywords: Patch, ZStream
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-0.8.2-29.el5_9.1 Doc Type: Bug Fix
Doc Text:
If an LVM volume group contains a striped LVM volume, the output of the "device" field separates the multiple device paths using the comma separator. Previously, the libvirt library also used the lvs command with the comma separator, which caused regular expressions in the libvirt code to parse the output of lvs incorrectly when used on a striped LVM volume. Consequently, creation of a logical storage pool in libvirt failed if the used LVM volume group contained the striped LVM volume. Also, libvirt did not have the correct mechanism to generate multiple device XML elements for the multiple device paths of striped LVM volume. With this update, libvirt has been modified to use lvs with the "#" separator; also, the library can now parse the multiple device paths of striped LVM volumes and generate relevant XML code. Users can now create logical storage pools with striped LVM volumes and generate appropriate XML code as expected.
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-28 08:25:59 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 896052    
Bug Blocks:    

Description Jiri Pallich 2013-01-24 11:31:15 UTC
This bug has been copied from bug #896052 and has been proposed
to be backported to 5.9 z-stream (EUS).

Comment 7 zhe peng 2013-02-20 07:39:11 UTC
can reproduce with build libvirt-0.8.2-29.el5

verify with build: 
kernel-2.6.18-348.1.1.el5
libvirt-0.8.2-29.el5_9.1
lvm2-2.02.88-10.el5

step:
1: 
> pvcreate /dev/sda2
  Writing physical volume data to disk "/dev/sda2"
  Physical volume "/dev/sda2" successfully created
> pvcreate /dev/sda7
  Writing physical volume data to disk "/dev/sda7"
  Physical volume "/dev/sda7" successfully created
> vgcreate vg_ssd /dev/sda2 /dev/sda7
  Volume group "vg_ssd" successfully created
> lvcreate --size 40GB --name test_nostripes vg_ssd
  Logical volume "test_nostripes" created
> vgchange -a y vg_ssd
  1 logical volume(s) in volume group "vg_ssd" now active
> virsh pool-create-as vg_ssd logical --target /dev/vg_ssd
  Pool vg_ssd created
> virsh pool-info vg_ssd
  Name:           vg_ssd
  UUID:           3103226f-4fd6-2c47-bd66-5c5e612d2dcb
  State:          running
  Persistent:     no
  Autostart:      no
  Capacity:       68.35 GB
  Allocation:     40.00 GB
  Available:      28.35 GB
> virsh pool-destroy vg_ssd
Pool vg_ssd destroyed
> lvcreate --size 10GB --stripes 2 --stripesize 8kb --name test_stripes vg_ssd
  Logical volume "test_stripes" created
> vgchange -a y vg_ssd
  2 logical volume(s) in volume group "vg_ssd" now active
> stat /dev/vg_ssd/test_stripes
  File: `/dev/vg_ssd/test_stripes' -> `/dev/mapper/vg_ssd-test_stripes'
  Size: 31        	Blocks: 0          IO Block: 4096   symbolic link
  Device: 11h/17d	Inode: 19591       Links: 1
  Access: (0777/lrwxrwxrwx)  Uid: (    0/    root)   Gid: (    0/    root)
  Access: 2013-02-20 02:30:36.148812478 -0500
  Modify: 2013-02-20 02:29:44.951812478 -0500
  Change: 2013-02-20 02:29:44.951812478 -0500
> virsh -d 5 pool-create-as vg_ssd logical --target /dev/vg_ssd
command: "pool-create-as vg_ssd logical --target /dev/vg_ssd "
pool-create-as: name(DATA): vg_ssd
pool-create-as: type(DATA): logical
pool-create-as: target(DATA): /dev/vg_ssd
Pool vg_ssd created

# lvs --separator , --noheadings --units b --unbuffered --nosuffix --options lv_name,origin,uuid,devices,seg_size,vg_extent_size vg_ssd; echo $?
test_nostripes,,cNkdV4-gkze-A4ea-0nKM-OYJL-WiID-m7EmH3,/dev/sda7(0),42949672960,4194304
  test_stripes,,b35pBS-CJBI-9FK0-jPl0-fYyw-jH9P-ADPHGr,/dev/sda2(0),/dev/sda7(10240),10737418240,4194304
0


libvirt worked as expect , move to verified

Comment 9 errata-xmlrpc 2013-02-28 08:25:59 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-0575.html