Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1525711

Summary: [RFE] implement consistent --stripe warnings when attempting takeover + reshape in one cmd
Product: Red Hat Enterprise Linux 7 Reporter: Corey Marthaler <cmarthal>
Component: lvm2Assignee: Heinz Mauelshagen <heinzm>
lvm2 sub component: Mirroring and RAID QA Contact: cluster-qe <cluster-qe>
Status: CLOSED WONTFIX Docs Contact:
Severity: low    
Priority: unspecified CC: agk, heinzm, jbrassow, mcsontos, msnitzer, prajnoha, rhandlin, zkabelac
Version: 7.5Keywords: FutureFeature
Target Milestone: rc   
Target Release: 7.8   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: lvm2-2.02.184-1.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1834428 (view as bug list) Environment:
Last Closed: 2020-05-11 17:26:27 UTC Type: Bug
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:    
Bug Blocks: 1834428    

Description Corey Marthaler 2017-12-13 21:59:52 UTC
Description of problem:
This is one of the RFEs from the verification of bug 1511047.


[root@mckinley-03 ~]# lvcreate -L 1G -n lv vg                                                                                                                                                                            
  Logical volume "lv" created.                                                                                                                                                                                           
                                                                                                                                                                                                                 
[root@mckinley-03 ~]# lvconvert --type raid1 -m 1 vg/lv                                                                                                                                                          
Are you sure you want to convert linear LV vg/lv to raid1 with 2 images enhancing resilience? [y/n]: y                                                                                                         
  Logical volume vg/lv successfully converted.                                                                                                                                                             

                                                                                                                                                      
# I don't know of any stripe takeover + reshape in one command options, so here we see the expected behavior "--stripes not allowed for LV ... when converting..."

[root@mckinley-03 ~]# lvconvert --type raid5 --stripes 2 vg/lv
  Using default stripesize 64.00 KiB.
  --stripes not allowed for LV vg/lv when converting from raid1 to raid5.
  Converting vg/lv from raid1 is directly possible to the following layouts:
    mirror
    raid4
    raid5_n
    raid5_la
    raid5_ls
    raid5_ra
    raid5_rs

[root@mckinley-03 ~]# lvconvert --type raid5 vg/lv
  Using default stripesize 64.00 KiB.
Are you sure you want to convert raid1 LV vg/lv to raid5 type? [y/n]: y
 Logical volume vg/lv successfully converted.

[root@mckinley-03 ~]# lvs -o name,segtype,copypercent,data_stripes vg
  LV   Type  Cpy%Sync #DStr
  lv   raid5 100.00       1

# Here is the failing behavior, when ever converting volume types with a --stripes option other than the current stripe number, it should either be mentioned that it's being ignored, or a warning "--stripes not allowed for LV ... when converting..."
[root@mckinley-03 ~]# lvconvert --type raid5_n --stripes 2 vg/lv
  Using default stripesize 64.00 KiB.
  Invalid conversion request on vg/lv.

[root@mckinley-03 ~]# lvconvert --type raid5_n vg/lv
  Using default stripesize 64.00 KiB.
  Converting raid5 (same as raid5_ls) LV vg/lv to raid5_n.
Are you sure you want to convert raid5 LV vg/lv? [y/n]: y
  Logical volume vg/lv successfully converted.

[root@mckinley-03 ~]# lvs -o name,segtype,copypercent,data_stripes vg
  LV   Type    Cpy%Sync #DStr
  lv   raid5_n 100.00       1


# Here's another variation of that warning like expected, however here the user is informed that it's just being ignored. This should probably be consistent as well.
[root@mckinley-03 ~]#  lvconvert --type raid0 --stripes 2 vg/lv
  Using default stripesize 64.00 KiB.
  --stripes not allowed for LV vg/lv when converting from raid5_n to raid0.
  WARNING: ignoring --stripes option on takeover of vg/lv (reshape afterwards).
  Converting vg/lv from raid5_n is directly possible to the following layouts:
    raid0
    raid0_meta
    striped
    raid4
    raid6_n_6
    raid5_la
    raid5_ls
    raid5_ra
    raid5_rs
    raid1



Version-Release number of selected component (if applicable):
lvm2-2.02.176-5.el7    BUILT: Wed Dec  6 04:13:07 CST 2017
lvm2-libs-2.02.176-5.el7    BUILT: Wed Dec  6 04:13:07 CST 2017
lvm2-cluster-2.02.176-5.el7    BUILT: Wed Dec  6 04:13:07 CST 2017
lvm2-lockd-2.02.176-5.el7    BUILT: Wed Dec  6 04:13:07 CST 2017
lvm2-python-boom-0.8.1-5.el7    BUILT: Wed Dec  6 04:15:40 CST 2017
cmirror-2.02.176-5.el7    BUILT: Wed Dec  6 04:13:07 CST 2017
device-mapper-1.02.145-5.el7    BUILT: Wed Dec  6 04:13:07 CST 2017
device-mapper-libs-1.02.145-5.el7    BUILT: Wed Dec  6 04:13:07 CST 2017
device-mapper-event-1.02.145-5.el7    BUILT: Wed Dec  6 04:13:07 CST 2017
device-mapper-event-libs-1.02.145-5.el7    BUILT: Wed Dec  6 04:13:07 CST 2017
device-mapper-persistent-data-0.7.0-0.1.rc6.el7    BUILT: Mon Mar 27 10:15:46 CDT 2017

Comment 3 Heinz Mauelshagen 2018-08-31 14:03:47 UTC
Addressed in the context of
https://bugzilla.redhat.com/show_bug.cgi?id=1439925
and
https://bugzilla.redhat.com/show_bug.cgi?id=1447809

lvm2 upstream commit
e83c4f07ca4a84808178d5d22cba655e5e370cd8

Comment 4 Bob Handlin 2018-09-04 14:03:04 UTC
I acked this for 7.7.  Let me know if you need an exception for 7.6.

Comment 5 Corey Marthaler 2018-09-05 15:01:48 UTC
What is the "fix" here to be verified? The original behavior appears mostly unchanged, with three different behaviors remaining depending on the takeover + stripe cmd ling given. 

No consistency yet:

[root@hayes-01 ~]# lvcreate -L 1G -n lv vg
  Logical volume "lv" created.
[root@hayes-01 ~]# lvs -a -o +devices,segtype
  LV   VG Attr       LSize Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert Devices      Type  
  lv   vg -wi-a----- 1.00g                                                     /dev/sdc1(0) linear
[root@hayes-01 ~]# lvconvert --type raid1 -m 1 vg/lv
Are you sure you want to convert linear LV vg/lv to raid1 with 2 images enhancing resilience? [y/n]: y
  Logical volume vg/lv successfully converted.

# convert to raid5 (plus 2 stripes)
[root@hayes-01 ~]# lvconvert --type raid5 --stripes 2 vg/lv
  Using default stripesize 64.00 KiB.
  --stripes not allowed for LV vg/lv when converting from raid1 to raid5.
Are you sure you want to convert raid1 LV vg/lv to raid5 type? [y/n]: y
  Logical volume vg/lv successfully converted.
[root@hayes-01 ~]# lvs -a -o +devices,segtype
  LV            VG Attr       LSize Cpy%Sync Convert Devices                       Type  
  lv            vg rwi-a-r--- 1.00g 100.00           lv_rimage_0(0),lv_rimage_1(0) raid5 
  [lv_rimage_0] vg iwi-aor--- 1.00g                  /dev/sdc1(0)                  linear
  [lv_rimage_1] vg iwi-aor--- 1.00g                  /dev/sde1(1)                  linear
  [lv_rmeta_0]  vg ewi-aor--- 4.00m                  /dev/sdc1(256)                linear
  [lv_rmeta_1]  vg ewi-aor--- 4.00m                  /dev/sde1(0)                  linear

# convert to raid5 (plus 4 stripes)
[root@hayes-01 ~]# lvconvert --type raid5 --stripes 4 vg/lv
  Using default stripesize 64.00 KiB.
  --stripes not allowed for LV vg/lv when converting from raid1 to raid5.
Are you sure you want to convert raid1 LV vg/lv to raid5 type? [y/n]: y
  Logical volume vg/lv successfully converted.
[root@hayes-01 ~]# lvs -a -o +devices,segtype
  LV            VG Attr       LSize Cpy%Sync Convert Devices                       Type  
  lv            vg rwi-a-r--- 1.00g 100.00           lv_rimage_0(0),lv_rimage_1(0) raid5 
  [lv_rimage_0] vg iwi-aor--- 1.00g                  /dev/sdc1(0)                  linear
  [lv_rimage_1] vg iwi-aor--- 1.00g                  /dev/sde1(1)                  linear
  [lv_rmeta_0]  vg ewi-aor--- 4.00m                  /dev/sdc1(256)                linear
  [lv_rmeta_1]  vg ewi-aor--- 4.00m                  /dev/sde1(0)                  linear

# If this was now consistent, then it should do the same as above, convert to raid5_n, print warning that the "--stripes not allowed", but it continues to do something different.
[root@hayes-01 ~]# lvconvert --type raid5_n --stripes 2 vg/lv
  Using default stripesize 64.00 KiB.
  Invalid conversion request on vg/lv.

[root@hayes-01 ~]# lvconvert --type raid5_n vg/lv
  Using default stripesize 64.00 KiB.
  Converting raid5 (same as raid5_ls) LV vg/lv to raid5_n.
Are you sure you want to convert raid5 LV vg/lv? [y/n]: y
  Logical volume vg/lv successfully converted.

# Here, the convert *AND* stripe addition is allowed! I would have expected the "--stripes not allowed for LV vg/lv when converting from raid5_ls to raid0)
[root@hayes-01 ~]# lvconvert --type raid0 --stripes 2 vg/lv
  Using default stripesize 64.00 KiB.
  Converting raid5_n LV vg/lv to 3 stripes first.
  Replaced LV type raid0 with possible type raid5_n.
  Repeat this command to convert to raid0 after an interim conversion has finished.
  WARNING: Adding stripes to active logical volume vg/lv will grow it from 256 to 512 extents!
  Run "lvresize -l256 vg/lv" to shrink it or use the additional capacity.
Are you sure you want to add 1 images to raid5_n LV vg/lv? [y/n]: y
  Logical volume vg/lv successfully converted.
[root@hayes-01 ~]# lvs -a -o +devices
  LV            VG Attr       LSize Cpy%Sync Devices
  lv            vg rwi-a-r--- 2.00g 100.00   lv_rimage_0(0),lv_rimage_1(0),lv_rimage_2(0)
  [lv_rimage_0] vg iwi-aor--- 1.00g          /dev/sdc1(257)
  [lv_rimage_0] vg iwi-aor--- 1.00g          /dev/sdc1(0)
  [lv_rimage_1] vg iwi-aor--- 1.00g          /dev/sde1(257)
  [lv_rimage_1] vg iwi-aor--- 1.00g          /dev/sde1(1)
  [lv_rimage_2] vg iwi-aor--- 1.00g          /dev/sdf1(257)
  [lv_rimage_2] vg iwi-aor--- 1.00g          /dev/sdf1(1)
  [lv_rmeta_0]  vg ewi-aor--- 4.00m          /dev/sdc1(256)
  [lv_rmeta_1]  vg ewi-aor--- 4.00m          /dev/sde1(0)
  [lv_rmeta_2]  vg ewi-aor--- 4.00m          /dev/sdf1(0)

# Here as well, the convert *AND* stripe addition is allowed!
[root@hayes-01 ~]# lvconvert --type raid0_meta --stripes 4 vg/lv
  Using default stripesize 64.00 KiB.
  Converting raid5_n LV vg/lv to 5 stripes first.
  Replaced LV type raid0_meta with possible type raid5_n.
  Repeat this command to convert to raid0_meta after an interim conversion has finished.
  WARNING: Adding stripes to active logical volume vg/lv will grow it from 512 to 1024 extents!
  Run "lvresize -l512 vg/lv" to shrink it or use the additional capacity.
Are you sure you want to add 2 images to raid5_n LV vg/lv? [y/n]: y
  Logical volume vg/lv successfully converted.
[root@hayes-01 ~]# lvs -a -o +devices
  LV            VG Attr       LSize Cpy%Sync Devices
  lv            vg rwi-a-r-s- 4.00g 12.02    lv_rimage_0(0),lv_rimage_1(0),lv_rimage_2(0),lv_rimage_3(0),lv_rimage_4(0)
  [lv_rimage_0] vg Iwi-aor--- 1.00g          /dev/sdc1(255)
  [lv_rimage_0] vg Iwi-aor--- 1.00g          /dev/sdc1(257)
  [lv_rimage_0] vg Iwi-aor--- 1.00g          /dev/sdc1(0)
  [lv_rimage_1] vg Iwi-aor--- 1.00g          /dev/sde1(256)
  [lv_rimage_1] vg Iwi-aor--- 1.00g          /dev/sde1(1)
  [lv_rimage_2] vg Iwi-aor--- 1.00g          /dev/sdf1(256)
  [lv_rimage_2] vg Iwi-aor--- 1.00g          /dev/sdf1(1)
  [lv_rimage_3] vg Iwi-aor--- 1.00g          /dev/sdg1(257)
  [lv_rimage_3] vg Iwi-aor--- 1.00g          /dev/sdg1(1)
  [lv_rimage_4] vg Iwi-aor--- 1.00g          /dev/sdh1(257)
  [lv_rimage_4] vg Iwi-aor--- 1.00g          /dev/sdh1(1)
  [lv_rmeta_0]  vg ewi-aor--- 4.00m          /dev/sdc1(256)
  [lv_rmeta_1]  vg ewi-aor--- 4.00m          /dev/sde1(0)
  [lv_rmeta_2]  vg ewi-aor--- 4.00m          /dev/sdf1(0)
  [lv_rmeta_3]  vg ewi-aor--- 4.00m          /dev/sdg1(0)
  [lv_rmeta_4]  vg ewi-aor--- 4.00m          /dev/sdh1(0)



3.10.0-943.el7_bz1514539+1586123.x86_64

lvm2-2.02.180-6.el7    BUILT: Fri Aug 24 08:52:19 CDT 2018
lvm2-libs-2.02.180-6.el7    BUILT: Fri Aug 24 08:52:19 CDT 2018
lvm2-cluster-2.02.180-6.el7    BUILT: Fri Aug 24 08:52:19 CDT 2018
lvm2-lockd-2.02.180-6.el7    BUILT: Fri Aug 24 08:52:19 CDT 2018
lvm2-python-boom-0.9-9.el7    BUILT: Fri Aug 24 08:52:54 CDT 2018
cmirror-2.02.180-6.el7    BUILT: Fri Aug 24 08:52:19 CDT 2018
device-mapper-1.02.149-6.el7    BUILT: Fri Aug 24 08:52:19 CDT 2018
device-mapper-libs-1.02.149-6.el7    BUILT: Fri Aug 24 08:52:19 CDT 2018
device-mapper-event-1.02.149-6.el7    BUILT: Fri Aug 24 08:52:19 CDT 2018
device-mapper-event-libs-1.02.149-6.el7    BUILT: Fri Aug 24 08:52:19 CDT 2018
device-mapper-persistent-data-0.7.3-3.el7    BUILT: Tue Nov 14 05:07:18 CST 2017

Comment 6 Corey Marthaler 2018-09-05 15:56:27 UTC
In some scenarios, you'll see the stripe warning when not even providing the --stripe flag on the cmdline due to what's happening internally, which can also be confusing.


[root@hayes-01 ~]# lvconvert --type raid5_n vg/lv
  Using default stripesize 64.00 KiB.
  --stripes not allowed for LV vg/lv when converting from raid1 to raid5_n.
Are you sure you want to convert raid1 LV vg/lv to raid5_n type? [y/n]: y
  Logical volume vg/lv successfully converted.

Comment 8 Marian Csontos 2019-03-05 14:25:36 UTC
Stable branch commit: d910f75d89e02e46cd16f9ddbc8e8358c3c2efd3

Comment 13 Heinz Mauelshagen 2019-04-04 13:02:37 UTC
comment#5 is correct in telling that a raid5(_ls) has to result in an error when you request to convert to raid5_n with 2 stripes, because you can opnly reshape for stripes but not for RAID algorithm (i.e. reaid5_n as you requested) in one step.  I'll put down to drop the algorithm with a warning in that case for convenience.

Corey, please retest #c6 based is fixed in lvm version 2.02.183:

[root@o ~]# lvcreate -L 32m -nr o
  Logical volume "r" created.
[root@o ~]# lvconvert -y --ty raid5_n  o/r
  Using default stripesize 64.00 KiB.
  Replaced LV type raid5_n with possible type raid1.
  Repeat this command to convert to raid5_n after an interim conversion has finished.
  Logical volume o/r successfully converted.

Comment 15 Corey Marthaler 2019-06-06 18:38:05 UTC
This bug was about implementing consistent warnings or actions when convert+reshapes are tried in one command line. Below are the current (different) behaviors using the examples in the original comment (and back in bug 1511047). I believe a user will find that most (if not all) convert+reshape in one cmdline examples will fall into one of these three behaviors. It's possible that this may be an insurmountable request given the amount of complexity and variability in reshaping and converting volumes in one command line and if so this RFE should probably just be closed WONTFIX.


Current Results (Inconsistency): 

[root@hayes-02 ~]# lvconvert --type raid5 --stripes 2 vg/lv
  Using default stripesize 64.00 KiB.
  --stripes not allowed for LV vg/lv when converting from raid1 to raid5.

[root@hayes-02 ~]#  lvconvert --type raid5_n --stripes 4 vg/lv
  using default stripesize 64.00 kib.
  invalid conversion request on vg/lv.

[root@hayes-02 ~]# lvconvert --type raid10 --stripes 3 vg/lv
  Using default stripesize 64.00 KiB.
  Converting raid5_n LV vg/lv to 4 stripes first.
  Replaced LV type raid10 (same as raid10_near) with possible type raid5_n.
  Repeat this command to convert to raid10 after an interim conversion has finished.
  WARNING: Adding stripes to active logical volume vg/lv will grow it from 256 to 384 extents!
  Run "lvresize -l256 vg/lv" to shrink it or use the additional capacity.
Are you sure you want to add 1 images to raid5_n LV vg/lv? [y/n]: y
  Logical volume vg/lv successfully converted.

Expected Results (Consistency):

[root@hayes-02 ~]# lvconvert --type raid5 --stripes 2 vg/lv
  Using default stripesize 64.00 KiB.
  --stripes not allowed for LV vg/lv when converting from raid1 to raid5.
[root@hayes-02 ~]# lvconvert --type raid5_n --stripes 4 vg/lv
  using default stripesize 64.00 kib.
  --stripes not allowed for LV vg/lv when converting from raid5 to raid5_n.
[root@hayes-02 ~]# lvconvert --type raid10 --stripes 3 vg/lv
  Using default stripesize 64.00 KiB.
  --stripes not allowed for LV vg/lv when converting from raid5_n to raid10.

*OR* 

[root@hayes-02 ~]# lvconvert --type raid5 --stripes 2 vg/lv
  Using default stripesize 64.00 KiB.
  invalid conversion request on vg/lv.
[root@hayes-02 ~]# lvconvert --type raid5_n --stripes 4 vg/lv
  using default stripesize 64.00 kib.
  invalid conversion request on vg/lv.
[root@hayes-02 ~]# lvconvert --type raid10 --stripes 3 vg/lv
  using default stripesize 64.00 kib.
  invalid conversion request on vg/lv.

*OR* 

[root@hayes-02 ~]# lvconvert --type raid5 --stripes 2 vg/lv
  Using default stripesize 64.00 KiB.
  Converting raid1 LV vg/lv to 2 stripes first.
  [...]
[root@hayes-02 ~]#  lvconvert --type raid5_n --stripes 4 vg/lv
  using default stripesize 64.00 kib.
  Converting raid5 LV vg/lv to 4 stripes first.
  [...]
[root@hayes-02 ~]# lvconvert --type raid10 --stripes 3 vg/lv
  Using default stripesize 64.00 KiB.
  Converting raid5_n LV vg/lv to 4 stripes first.
  [...]


Here are the full scenarios in more detail:

# Scenario 1 
#
# From raid1 (-m1) to raid5 (--stripes 2)
#
# User sees "--stripes not allowed for LV vg/lv", lvm ignores it and does the convert by throwing the stripe arg on the floor.

[root@hayes-02 ~]# lvcreate -L 1G -n lv vg           
  Logical volume "lv" created.
[root@hayes-02 ~]# lvconvert --type raid1 -m 1 vg/lv 
Are you sure you want to convert linear LV vg/lv to raid1 with 2 images enhancing resilience? [y/n]: y
  Logical volume vg/lv successfully converted.
[root@hayes-02 ~]# lvs
  LV   VG Attr       LSize Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  lv   vg rwi-a-r--- 1.00g                                    100.00          
[root@hayes-02 ~]# lvconvert --type raid5 --stripes 2 vg/lv
  Using default stripesize 64.00 KiB.
  --stripes not allowed for LV vg/lv when converting from raid1 to raid5.
Are you sure you want to convert raid1 LV vg/lv to raid5 type? [y/n]: y
  Logical volume vg/lv successfully converted.
[root@hayes-02 ~]# lvs -a -o +devices,segtype
  LV            VG Attr       LSize  Log Cpy%Sync Devices                       Type  
  lv            vg rwi-a-r--- 1.00g      100.00   lv_rimage_0(0),lv_rimage_1(0) raid5 
  [lv_rimage_0] vg iwi-aor--- 1.00g               /dev/sdb1(0)                  linear
  [lv_rimage_1] vg iwi-aor--- 1.00g               /dev/sdc1(1)                  linear
  [lv_rmeta_0]  vg ewi-aor--- 4.00m               /dev/sdb1(256)                linear
  [lv_rmeta_1]  vg ewi-aor--- 4.00m               /dev/sdc1(0)                  linear


# Scenario 2 
#
# From raid5 (--stripes 2) to raid5_n (--stripes 3)
#
# User sees "Invalid conversion request", lvm basically tell the user to fix their cmdline args and try again

[root@hayes-02 ~]# lvcreate --type raid5 -n lv -L 1G --stripes 2 vg
  Using default stripesize 64.00 KiB.
  Logical volume "lv" created.
[root@hayes-02 ~]# lvs -a -o +devices
  LV            VG Attr       LSize    Log Cpy%Sync Devices
  lv            vg rwi-a-r---   1.00g      100.00   lv_rimage_0(0),lv_rimage_1(0),lv_rimage_2(0)
  [lv_rimage_0] vg iwi-aor--- 512.00m               /dev/sdb1(1)
  [lv_rimage_1] vg iwi-aor--- 512.00m               /dev/sdc1(1)
  [lv_rimage_2] vg iwi-aor--- 512.00m               /dev/sdd1(1)
  [lv_rmeta_0]  vg ewi-aor---   4.00m               /dev/sdb1(0)
  [lv_rmeta_1]  vg ewi-aor---   4.00m               /dev/sdc1(0)
  [lv_rmeta_2]  vg ewi-aor---   4.00m               /dev/sdd1(0)

[root@hayes-02 ~]#  lvconvert --type raid5_n --stripes 3 vg/lv
  Using default stripesize 64.00 KiB.
  Invalid conversion request on vg/lv.
[root@hayes-02 ~]#  lvconvert --type raid5_n --stripes 4 vg/lv
  Using default stripesize 64.00 KiB.
  Invalid conversion request on vg/lv.

[root@hayes-02 ~]# lvconvert --type raid5_n vg/lv
  Using default stripesize 64.00 KiB.
  Converting raid5 (same as raid5_ls) LV vg/lv to raid5_n.
Are you sure you want to convert raid5 LV vg/lv? [y/n]: y
  Logical volume vg/lv successfully converted.
[root@hayes-02 ~]# lvs -a -o +devices,segtype
  LV            VG Attr       LSize  Log Cpy%Sync Devices                       Type
  lv            vg rwi-a-r--- 1.00g      100.00   lv_rimage_0(0),lv_rimage_1(0) raid5_n
  [lv_rimage_0] vg iwi-aor--- 1.00g               /dev/sdb1(0)                  linear
  [lv_rimage_1] vg iwi-aor--- 1.00g               /dev/sdc1(1)                  linear
  [lv_rmeta_0]  vg ewi-aor--- 4.00m               /dev/sdb1(256)                linear
  [lv_rmeta_1]  vg ewi-aor--- 4.00m               /dev/sdc1(0)                  linear


# Scenario 3 
#
# From raid5_n (--stripes 2) to raid10 (--stripes 3)
#
# User sees "Adding stripes...", lvm starts the stripe addition process, but throws the convert type on the floor now and then tells the to run it again to get the originally requested layout

[root@hayes-02 ~]# lvcreate --type raid5_n -n lv -L 1G --stripes 2 vg
  Using default stripesize 64.00 KiB.
  Logical volume "lv" created.
[root@hayes-02 ~]# lvs -a -o +devices
  LV            VG Attr       LSize    Log Cpy%Sync Devices
  lv            vg rwi-a-r---   1.00g      100.00   lv_rimage_0(0),lv_rimage_1(0),lv_rimage_2(0)
  [lv_rimage_0] vg iwi-aor--- 512.00m               /dev/sdb1(1)
  [lv_rimage_1] vg iwi-aor--- 512.00m               /dev/sdc1(1)
  [lv_rimage_2] vg iwi-aor--- 512.00m               /dev/sdd1(1)
  [lv_rmeta_0]  vg ewi-aor---   4.00m               /dev/sdb1(0)
  [lv_rmeta_1]  vg ewi-aor---   4.00m               /dev/sdc1(0)
  [lv_rmeta_2]  vg ewi-aor---   4.00m               /dev/sdd1(0)
[root@hayes-02 ~]# lvconvert --type raid10 --stripes 3 vg/lv
  Using default stripesize 64.00 KiB.
  Converting raid5_n LV vg/lv to 4 stripes first.
  Replaced LV type raid10 (same as raid10_near) with possible type raid5_n.
  Repeat this command to convert to raid10 after an interim conversion has finished.
  WARNING: Adding stripes to active logical volume vg/lv will grow it from 256 to 384 extents!
  Run "lvresize -l256 vg/lv" to shrink it or use the additional capacity.
Are you sure you want to add 1 images to raid5_n LV vg/lv? [y/n]: y
  Logical volume vg/lv successfully converted.
[root@hayes-02 ~]# lvs -a -o +devices,segtype
  LV            VG Attr       LSize    Log Cpy%Sync Devices                                                     Type
  lv            vg rwi-a-r-s-   1.50g      16.04    lv_rimage_0(0),lv_rimage_1(0),lv_rimage_2(0),lv_rimage_3(0) raid5_n
  [lv_rimage_0] vg Iwi-aor--- 516.00m               /dev/sdb1(129)                                              linear
  [lv_rimage_0] vg Iwi-aor--- 516.00m               /dev/sdb1(1)                                                linear
  [lv_rimage_1] vg Iwi-aor--- 516.00m               /dev/sdc1(129)                                              linear
  [lv_rimage_1] vg Iwi-aor--- 516.00m               /dev/sdc1(1)                                                linear
  [lv_rimage_2] vg Iwi-aor--- 516.00m               /dev/sdd1(129)                                              linear
  [lv_rimage_2] vg Iwi-aor--- 516.00m               /dev/sdd1(1)                                                linear
  [lv_rimage_3] vg Iwi-aor--- 516.00m               /dev/sde1(129)                                              linear
  [lv_rimage_3] vg Iwi-aor--- 516.00m               /dev/sde1(1)                                                linear
  [lv_rmeta_0]  vg ewi-aor---   4.00m               /dev/sdb1(0)                                                linear
  [lv_rmeta_1]  vg ewi-aor---   4.00m               /dev/sdc1(0)                                                linear
  [lv_rmeta_2]  vg ewi-aor---   4.00m               /dev/sdd1(0)                                                linear
  [lv_rmeta_3]  vg ewi-aor---   4.00m               /dev/sde1(0)                                                linear

Comment 16 Heinz Mauelshagen 2019-06-19 20:54:15 UTC
Thinking about closing this WONTFIX but want to discuss requierements with QE before doing that.
Moving to 7.8.

Comment 18 Corey Marthaler 2020-05-11 17:26:27 UTC
Closing this bug WONTFIX in lieu of rhel8 bug 1834428. It's too late in the rhel7 game to fix this. Feel free to close bug 1834428 as well if this is deemed not worth the risk due to the complexity and variability in reshaping and converting volumes in one command line.