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 1513771 - LVM CLI regression: unable to up-convert to mirror with striped leg.
Summary: LVM CLI regression: unable to up-convert to mirror with striped leg.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: lvm2
Version: 7.3
Hardware: Unspecified
OS: Unspecified
urgent
unspecified
Target Milestone: rc
: ---
Assignee: David Teigland
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On: 1720705
Blocks: 1740522
TreeView+ depends on / blocked
 
Reported: 2017-11-15 22:53 UTC by Jonathan Earl Brassow
Modified: 2021-09-03 12:51 UTC (History)
14 users (show)

Fixed In Version: lvm2-2.02.186-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1740522 (view as bug list)
Environment:
Last Closed: 2020-03-31 20:04:48 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2020:1129 0 None None None 2020-03-31 20:05:27 UTC

Description Jonathan Earl Brassow 2017-11-15 22:53:35 UTC
Note how shorthand option work and longhand does not.

[root@bp-01 ~]# lvcreate -L 5G -n lv vg
  Logical volume "lv" created.
[root@bp-01 ~]# devices vg
  LV   Attr       Cpy%Sync Devices
  lv   -wi-a-----          /dev/sdb1(0)
[root@bp-01 ~]# lvconvert --mirrors 1 vg/lv --mirrorlog core --type mirror --stripes 2
  Command does not accept option: --stripes 2.
[root@bp-01 ~]# lvconvert --mirrors 1 vg/lv --mirrorlog core --type mirror -i 2
  Logical volume vg/lv being converted.
  vg/lv: Converted: 0.08%

Comment 1 Jonathan Earl Brassow 2017-11-15 23:13:53 UTC
(In reply to Jonathan Earl Brassow from comment #0)
> Note how shorthand option work and longhand does not.
> 
> [root@bp-01 ~]# lvcreate -L 5G -n lv vg
>   Logical volume "lv" created.
> [root@bp-01 ~]# devices vg
>   LV   Attr       Cpy%Sync Devices
>   lv   -wi-a-----          /dev/sdb1(0)
> [root@bp-01 ~]# lvconvert --mirrors 1 vg/lv --mirrorlog core --type mirror
> --stripes 2
>   Command does not accept option: --stripes 2.
> [root@bp-01 ~]# lvconvert --mirrors 1 vg/lv --mirrorlog core --type mirror
> -i 2
>   Logical volume vg/lv being converted.
>   vg/lv: Converted: 0.08%

Please scratch the above and note on RHEL6.9 (and probably 7.3):
[root@bp-02 ~]# lvcreate -L 5G -n lv vg
  Logical volume "lv" created.
[root@bp-02 ~]# lvconvert --mirrors 1 vg/lv --mirrorlog core --type mirror --stripes 2
  Using default stripesize 64.00 KiB.
  vg/lv: Converted: 0.2%
^C
[root@bp-02 ~]# devices  vg
  LV            Attr       Cpy%Sync Devices
  lv            mwi-a-m--- 32.19    lv_mimage_0(0),lv_mimage_1(0)
  [lv_mimage_0] Iwi-aom---          /dev/sdb1(0)
  [lv_mimage_1] Iwi-aom---          /dev/sdd1(0),/dev/sde1(0)

but on 7.5:
[root@bp-01 ~]# lvconvert --mirrors 1 vg/lv --mirrorlog core --type mirror --stripes 2
  Command does not accept option: --stripes 2.

Comment 4 Jonathan Earl Brassow 2017-11-16 22:23:40 UTC
Unfortunately, after looking into the feasibility of this, it is not possible to support this behavior predictably.  We will have to steer users to the available methods and methods coming in the future:

> We do have prototype code that will allow conversion from one type to any other type (linear <-> RAIDx) through an online mirroring action.  It is not an in-place reshape (technically, a “take-over”) and would require extra disks.  This solution is not currently scheduled to land, but I can see it in the early timeframe of the next major release.

> We also have the ability to use ‘lvconvert’ to change one LV type to another (e.g. RAID1 to RAID5).  The process of going from linear to striped is not a direct one, but it can be done.  We could probably improve our “coaching” for users in this area.  This solution uses an “in-place” conversion and does not require a full set of extra devices.

Comment 7 David Teigland 2019-06-17 14:28:13 UTC
Also see bug 1494135 and bug 1483530.

As far as I know this command is still supposed to be disallowed.  It has been discussed at length, but I have not followed the reasons why.  If something has changed, and the code can handle this correctly, then please let me know and I will update the command definitions to permit it.

Comment 8 Jonathan Earl Brassow 2019-07-08 22:49:11 UTC
Is this bug related to the recent fix for https://bugzilla.redhat.com/show_bug.cgi?id=1720705 ?

Comment 9 Heinz Mauelshagen 2019-07-09 11:48:19 UTC
(In reply to Jonathan Earl Brassow from comment #8)
> Is this bug related to the recent fix for
> https://bugzilla.redhat.com/show_bug.cgi?id=1720705 ?

Yes, the fix as of bz#1720705 also fixes this one.

Comment 10 Marian Csontos 2019-07-09 12:10:19 UTC
(In reply to David Teigland from comment #7)
> Also see bug 1494135 and bug 1483530.

I disagree, both referenced bugs are about RAID1 volumes. For RAID1 volumes there exists a conversion path to RAID0.

Mirrors apparently worked fine in this scenario in RHEL-6 and RHEL-7 up to RHEL-7.4.
And it is this functionality removed in RHEL-7.5 the customer wants to use.

> As far as I know this command is still supposed to be disallowed.  It has
> been discussed at length, but I have not followed the reasons why.  If
> something has changed, and the code can handle this correctly, then please
> let me know and I will update the command definitions to permit it.

The discussion was rather philosophical, Not single technical argument why it should not be allowed.

The only issue raised were:

- we (will) have raids
- this creates asymmetrical mirror with one leg linear and other one stripe, which is useless, it is inferior raid01 instead of much better raid10.
- what is requires should be called "duplication/replication" not mirror/raid1.

The RAIDs may be superior, but as Nikhil pointed out linear to stripe conversion through raids takes several steps, requires more space, and writes 3 to 4 times the amount of data the "duplication" uses.

1. convert to raid1 (copying 100% of data):

[root@r-el77conv2raid0 ~]# lvconvert --type raid1 -m 1 vgtest/lv1
Are you sure you want to convert linear LV vgtest/lv1 to raid1 with 2 images enhancing resilience? [y/n]: y
  Logical volume vgtest/lv1 successfully converted.

2. conversion to raid5_n with 2 legs - one for data and one for parity IIUC, writing 100% of data again:
Perhaps the conversion to raid1 first is ... superficial?

[root@r-el77conv2raid0 ~]# lvconvert --type raid0 -i 2 vgtest/lv1
  Using default stripesize 64.00 KiB.
  Replaced LV type raid0 with possible type raid5_n.
  Repeat this command to convert to raid0 after an interim conversion has finished.
  --stripes not allowed for LV vgtest/lv1 when converting from raid1 to raid5_n.
Are you sure you want to convert raid1 LV vgtest/lv1 to raid5_n type? [y/n]: y
  Logical volume vgtest/lv1 successfully converted.
[root@r-el77conv2raid0 ~]# lvs -a
  LV             VG              Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  root           vg_stacker_ihD9 -wi-ao----   6.00g                                                    
  lv1            vgtest          rwi-a-r--- 100.00m                                    100.00          
  [lv1_rimage_0] vgtest          iwi-aor--- 100.00m                                                    
  [lv1_rimage_1] vgtest          iwi-aor--- 100.00m                                                    
  [lv1_rmeta_0]  vgtest          ewi-aor---   4.00m                                                    
  [lv1_rmeta_1]  vgtest          ewi-aor---   4.00m                                                    

3. upconverting the raid5_n to 3 stripes, writing another 100 or 200% of data:

[root@r-el77conv2raid0 ~]# lvconvert --type raid0 -i 2 vgtest/lv1
  Using default stripesize 64.00 KiB.
  Converting raid5_n LV vgtest/lv1 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 vgtest/lv1 will grow it from 25 to 50 extents!
  Run "lvresize -l25 vgtest/lv1" to shrink it or use the additional capacity.
Are you sure you want to add 1 images to raid5_n LV vgtest/lv1? [y/n]: y
  Logical volume vgtest/lv1 successfully converted.

Here comes the problem:
>  WARNING: Adding stripes to active logical volume vgtest/lv1 will grow it from 25 to 50 extents!
>  Run "lvresize -l25 vgtest/lv1" to shrink it or use the additional capacity.

So the conversion requires three times the space.
Q: Is user supposed to shrink it first of after the conversion?
A: After. The size before would not change. It changes during upconversion.

4. finally converting to raid0....

I do not think the customer requires in-place conversions. And certainly not in-place conversion which requires 3 times the space than mere "duplication" which would requires only twice. Not in-place conversion which requires 4 steps instead of one (well two...). And copies 3-4 times the amount of data written by duplication.

Even if in-place conversion would be a better solution, that will still not work e.g. as active/active volume in cluster.

Comment 13 Heinz Mauelshagen 2019-07-15 15:42:21 UTC
(In reply to Marian Csontos from comment #10)
> (In reply to David Teigland from comment #7)
> > Also see bug 1494135 and bug 1483530.
> 
> I disagree, both referenced bugs are about RAID1 volumes. For RAID1 volumes
> there exists a conversion path to RAID0.
> 
> Mirrors apparently worked fine in this scenario in RHEL-6 and RHEL-7 up to
> RHEL-7.4.
> And it is this functionality removed in RHEL-7.5 the customer wants to use.

Now that the regression removing 'mirror' with 'striped' legs is fixed,
we got it back for the customer.

> 
> > As far as I know this command is still supposed to be disallowed.  It has
> > been discussed at length, but I have not followed the reasons why.  If
> > something has changed, and the code can handle this correctly, then please
> > let me know and I will update the command definitions to permit it.
> 
> The discussion was rather philosophical, Not single technical argument why
> it should not be allowed.
> 
> The only issue raised were:
> 
> - we (will) have raids
> - this creates asymmetrical mirror with one leg linear and other one stripe,
> which is useless, it is inferior raid01 instead of much better raid10.
> - what is requires should be called "duplication/replication" not
> mirror/raid1.
> 
> The RAIDs may be superior, but as Nikhil pointed out linear to stripe
> conversion through raids takes several steps, requires more space, and
> writes 3 to 4 times the amount of data the "duplication" uses.
> 
> 1. convert to raid1 (copying 100% of data):
> 
> [root@r-el77conv2raid0 ~]# lvconvert --type raid1 -m 1 vgtest/lv1
> Are you sure you want to convert linear LV vgtest/lv1 to raid1 with 2 images
> enhancing resilience? [y/n]: y
>   Logical volume vgtest/lv1 successfully converted.
> 
> 2. conversion to raid5_n with 2 legs - one for data and one for parity IIUC,
> writing 100% of data again:
> Perhaps the conversion to raid1 first is ... superficial?

May be hidden in case we eventually support multi-step conversions via lvmpolld
but for the time being, that's how things work technically
(linear -> 2-legged raid1 upconvert -> raid5_n -> more stripes -> raid0).

> 
> [root@r-el77conv2raid0 ~]# lvconvert --type raid0 -i 2 vgtest/lv1
>   Using default stripesize 64.00 KiB.
>   Replaced LV type raid0 with possible type raid5_n.
>   Repeat this command to convert to raid0 after an interim conversion has
> finished.
>   --stripes not allowed for LV vgtest/lv1 when converting from raid1 to
> raid5_n.
> Are you sure you want to convert raid1 LV vgtest/lv1 to raid5_n type? [y/n]:
> y
>   Logical volume vgtest/lv1 successfully converted.
> [root@r-el77conv2raid0 ~]# lvs -a
>   LV             VG              Attr       LSize   Pool Origin Data%  Meta%
> Move Log Cpy%Sync Convert
>   root           vg_stacker_ihD9 -wi-ao----   6.00g                         
> 
>   lv1            vgtest          rwi-a-r--- 100.00m                         
> 100.00          
>   [lv1_rimage_0] vgtest          iwi-aor--- 100.00m                         
> 
>   [lv1_rimage_1] vgtest          iwi-aor--- 100.00m                         
> 
>   [lv1_rmeta_0]  vgtest          ewi-aor---   4.00m                         
> 
>   [lv1_rmeta_1]  vgtest          ewi-aor---   4.00m                         
> 
> 
> 3. upconverting the raid5_n to 3 stripes, writing another 100 or 200% of
> data:

Upconverting and reshaping to 3 stripes total with raid requires an interim 300%
and a final 200% space for the striped/raid0 of the initial linear LV.

OTOH, the reintroduced 'mirror' functionality only requires an interim 200%
whilst keeping the same size of the initial linear LV for the final 'striped' one.

> 
> [root@r-el77conv2raid0 ~]# lvconvert --type raid0 -i 2 vgtest/lv1
>   Using default stripesize 64.00 KiB.
>   Converting raid5_n LV vgtest/lv1 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 vgtest/lv1 will grow it
> from 25 to 50 extents!
>   Run "lvresize -l25 vgtest/lv1" to shrink it or use the additional capacity.
> Are you sure you want to add 1 images to raid5_n LV vgtest/lv1? [y/n]: y
>   Logical volume vgtest/lv1 successfully converted.
> 
> Here comes the problem:
> >  WARNING: Adding stripes to active logical volume vgtest/lv1 will grow it from 25 to 50 extents!
> >  Run "lvresize -l25 vgtest/lv1" to shrink it or use the additional capacity.
> 
> So the conversion requires three times the space.
> Q: Is user supposed to shrink it first of after the conversion?
> A: After. The size before would not change. It changes during upconversion.

Well, user could shrink before in case the content may shrink (e.g. resizefs if at all possible).

> 
> 4. finally converting to raid0....
> 
> I do not think the customer requires in-place conversions. And certainly not
> in-place conversion which requires 3 times the space than mere "duplication"
> which would requires only twice. Not in-place conversion which requires 4
> steps instead of one (well two...). And copies 3-4 times the amount of data
> written by duplication.

This particular customer does not because he asks for getting functionality
back he's already used to.

My shelved dup/undup raid support for lvm is about avoiding the additional space
requirements involved with reshaping by allowing e.g. arbitrary raid* legs underneath
an N-legged top-level raid1 and being able to drop any fo them keeping the final intended layout.

> 
> Even if in-place conversion would be a better solution, that will still not
> work e.g. as active/active volume in cluster.

Indeed.

Comment 14 Heinz Mauelshagen 2019-07-31 14:29:27 UTC
lvm2 commit IDs:
master 1b63a219f4f9d7f2f6c5086375b96c3bd892a1a0
stable-2.02 e3c8cebd87f9bd7591529f3d65783cc6f1fd3f92

Comment 17 Corey Marthaler 2019-11-19 22:03:17 UTC
Marking verified in the latest rpms. 

lvm2-2.02.185-2.el7.x86_64

[root@hayes-01 ~]# lvs -a -o +devices
  LV   VG Attr       LSize Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert Devices     
  lv   vg -wi-a----- 5.00g                                                     /dev/sdb1(0)
[root@hayes-01 ~]# lvconvert --mirrors 1 vg/lv --mirrorlog core --type mirror --stripes 2
  Command does not accept option: --stripes 2.


lvm2-2.02.186-3.el7.x86_64

[root@hayes-01 ~]# lvconvert --mirrors 1 vg/lv --mirrorlog core --type mirror --stripes 2
  Using default stripesize 64.00 KiB.
  Logical volume vg/lv being converted.
  vg/lv: Converted: 0.16%
  vg/lv: Converted: 27.50%
  vg/lv: Converted: 55.08%
  vg/lv: Converted: 82.66%
  vg/lv: Converted: 100.00%
[root@hayes-01 ~]# lvs -a -o +devices
  LV            VG Attr       LSize Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert Devices                      
  lv            vg mwi-a-m--- 5.00g                                    100.00           lv_mimage_0(0),lv_mimage_1(0)
  [lv_mimage_0] vg iwi-aom--- 5.00g                                                     /dev/sdb1(0)                 
  [lv_mimage_1] vg iwi-aom--- 5.00g                                                     /dev/sdc1(0),/dev/sdd1(0)

Comment 18 Corey Marthaler 2019-11-21 18:18:37 UTC
FYI - up conversion will only work if the extent total is divisible by 2. If it's an odd number, it will not work.

TAKEOVER: lvconvert --force --yes -R 512.00k -m 2 --stripes 2 --type mirror centipede2/takeover
  Number of extents requested (725) needs to be divisible by 2.
  Unable to allocate extents for mirror(s).

Comment 20 errata-xmlrpc 2020-03-31 20:04:48 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.

https://access.redhat.com/errata/RHBA-2020:1129


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