Bug 204128

Summary: lvconvert from linear to mirror fails if original LV spans to PVs
Product: Red Hat Enterprise Linux 4 Reporter: Jun'ichi Nomura (Red Hat) <jnomura>
Component: lvm2Assignee: Alasdair Kergon <agk>
Status: CLOSED ERRATA QA Contact:
Severity: high Docs Contact:
Priority: medium    
Version: 4.4CC: coughlan, dwysocha, jbrassow, kueda, mbroz
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: RHBA-2007-0287 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-05-08 00:06:04 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:
Attachments:
Description Flags
Reproducer test script none

Description Jun'ichi Nomura (Red Hat) 2006-08-25 18:39:29 UTC
Created attachment 134950 [details]
Reproducer test script

Comment 1 Jun'ichi Nomura (Red Hat) 2006-08-25 18:39:29 UTC
Description of problem:
lvconvert fails to convert linear LV to mirrored LV
if the linear LV contains more than 1 PV

Version-Release number of selected component:
lvm2-2.02.06-6.0.RHEL4

How reproducible:
Always

Steps to Reproduce:
 1. Create a VG with 5 or more PVs
      # vgcreate testvg /dev/sdb[1-5]
 2. Create a linear LV which spans multiple PVs
      # lvcreate -L<appropriate size> -nlv0 testvg
    For example, if we have 5 100MB PVs, we should create 120MB LV here.
 3. Check if the LV contains multiple PVs
      # lvs -o+devices
 4. Convert it to mirror
      # lvconvert -m1 testvg/lv0

Actual results:
lvconvert fails with a message like this:
  Insufficient suitable allocatable extents for logical volume : 4294967290 more
required

Expected results:
lvconvert succeeds

Additional info:

Attached script does the above steps and show what happens.

# sh lvconvert-multiseg.sh
INFO: Creating a file for loop setup. file=tmpfile
204800+0 records in
204800+0 records out
INFO: Setting up loop device. dev=/dev/loop0 file=tmpfile
INFO: Creating PV. nr_pv=5
  Physical volume "/dev/mapper/pv0" successfully created
  Physical volume "/dev/mapper/pv1" successfully created
  Physical volume "/dev/mapper/pv2" successfully created
  Physical volume "/dev/mapper/pv3" successfully created
  Physical volume "/dev/mapper/pv4" successfully created
INFO: Creating VG. nr_vg=1. each pv in a vg: 5
INFO: vgname=testvg0
  Volume group "testvg0" successfully created
INFO: PE count of PV is     4 .
  Failed to read physical volume "testvg0"
INFO: Create linear LV spanning multiple PVs.
  Logical volume "lv0" created
  LV   Devices
  lv0  /dev/dm-0(0)
  lv0  /dev/dm-1(0)
INFO: Convert the LV to mirrored.
  Insufficient suitable allocatable extents for logical volume : 4294967290 more
required
  LV   Devices
  lv0  /dev/dm-0(0)
  lv0  /dev/dm-1(0)
INFO: Failed
INFO: Cleaning up.

Comment 2 Jun'ichi NOMURA 2006-09-12 21:02:36 UTC
Patch is posted to linux-lvm:
https://www.redhat.com/archives/linux-lvm/2006-August/msg00117.html

Comment 3 Corey Marthaler 2006-10-11 15:46:39 UTC
Moving to modified state since a patch was submitted, and bumping the priority
since this bug is blocking QA tests. We'll need an lvm build with this fix in it
to continue testing lvconverts.

Comment 4 Corey Marthaler 2006-10-11 18:05:24 UTC
Since the patch has only been posted, this really shouldn't be in the MODIFIED
state yet.

Comment 6 Corey Marthaler 2006-10-31 22:25:57 UTC
fix verified in lvm2-2.02.13-1.

Comment 10 Red Hat Bugzilla 2007-05-08 00:06:04 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2007-0287.html