Bug 1462712 - lvm2: can not set raid type to thin pool [NEEDINFO]
lvm2: can not set raid type to thin pool
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: lvm2 (Show other bugs)
7.4
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: Zdenek Kabelac
Bruno Goncalves
: Regression
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-06-19 07:45 EDT by Bruno Goncalves
Modified: 2017-08-01 17:54 EDT (History)
10 users (show)

See Also:
Fixed In Version: lvm2-2.02.171-6.el7
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-08-01 17:54:18 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
bgoncalv: needinfo? (zkabelac)


Attachments (Terms of Use)

  None (edit)
Description Bruno Goncalves 2017-06-19 07:45:00 EDT
Description of problem:
Can not set a thin pool to use RAID type.

lvconvert --type raid1 --mirrors 3 --yes testvg/pool_tdata
  testvg/pool_tdata must be active to perform this operation.
ERROR: lvconvert --type raid1 --mirrors 3 --yes testvg/pool_tdata


If 'testvg/pool_tdata' is deactivated it also does not work.

lvconvert --type raid1 --mirrors 3 --yes testvg/pool_tdata
  Can't add image to active thin pool LV testvg/pool_tdata yet. Deactivate first.


Version-Release number of selected component (if applicable):
kernel-3.10.0-681.el7
lvm2-2.02.171-5.el7

How reproducible:
100%

Steps to Reproduce:
1.Create a Thin pool
vgcreate --force testvg  /dev/loop2 /dev/loop1 /dev/loop0 /dev/loop3
lvcreate -L4M --thin testvg/pool

2. Deactivate the pool
lvchange -an testvg/pool

3. Try to set the pool to RAID
lvconvert --type raid1 --mirrors 3 --yes testvg/pool_tdata
  testvg/pool_tdata must be active to perform this operation.
ERROR: lvconvert --type raid1 --mirrors 3 --yes testvg/pool_tdata
Comment 1 Bruno Goncalves 2017-06-19 07:49:30 EDT
I do not know how serious this is, but this works on RHEL-7.3 and also with RHEL-7.4 Snapshot#3 (kernel-3.10.0-675.el7, lvm2-2.02.171-2.el7)

lvchange -an testvg/pool

lvconvert --type raid1 --mirrors 3 --yes testvg/pool_tdata
  Logical volume testvg/pool_tdata successfully converted.
Comment 4 Zdenek Kabelac 2017-06-19 14:37:51 EDT
Seems we are at  Catch 22  now  with Bug 1365286.

And the only way forward is to fix original bug which resulted into hotfix actually disabling raids for thin-pool.
Comment 6 Zdenek Kabelac 2017-06-19 17:41:12 EDT
Functionality restored with commit:

https://www.redhat.com/archives/lvm-devel/2017-June/msg00069.html

Now it should be again possible to change thin_pool _tdata & _tmeta to raid and back.
Comment 8 Corey Marthaler 2017-06-21 13:26:08 EDT
Fix verified in the latest rpms, thus *reversing* behavior verified in bug 1365286.

3.10.0-685.el7.x86_64
lvm2-2.02.171-6.el7    BUILT: Wed Jun 21 09:35:03 CDT 2017
lvm2-libs-2.02.171-6.el7    BUILT: Wed Jun 21 09:35:03 CDT 2017
lvm2-cluster-2.02.171-6.el7    BUILT: Wed Jun 21 09:35:03 CDT 2017
device-mapper-1.02.140-6.el7    BUILT: Wed Jun 21 09:35:03 CDT 2017
device-mapper-libs-1.02.140-6.el7    BUILT: Wed Jun 21 09:35:03 CDT 2017
device-mapper-event-1.02.140-6.el7    BUILT: Wed Jun 21 09:35:03 CDT 2017
device-mapper-event-libs-1.02.140-6.el7    BUILT: Wed Jun 21 09:35:03 CDT 2017
device-mapper-persistent-data-0.7.0-0.1.rc6.el7    BUILT: Mon Mar 27 10:15:46 CDT 2017


[root@host-094 ~]# lvcreate -L4M --thin testvg/pool
  Using default stripesize 64.00 KiB.
  Thin pool volume with chunk size 64.00 KiB can address at most 15.81 TiB of data.
  Logical volume "pool" created.

[root@host-094 ~]# lvchange -an testvg/pool
[root@host-094 ~]# lvconvert --type raid1 --mirrors 3 --yes testvg/pool_tdata
  testvg/pool_tdata must be active to perform this operation.

[root@host-094 ~]# lvchange -ay testvg/pool
[root@host-094 ~]# lvconvert --type raid1 --mirrors 3 --yes testvg/pool_tdata
  Logical volume testvg/pool_tdata successfully converted.

[root@host-094 ~]# lvs -a -o +devices
  LV                    VG       Attr       LSize Pool Origin Data%  Meta% Cpy%Sync Devices
  [lvol0_pmspare]       testvg   ewi------- 4.00m                                   /dev/sda1(0)
  pool                  testvg   twi-a-tz-- 4.00m             0.00   0.88           pool_tdata(0)
  [pool_tdata]          testvg   rwi-aor--- 4.00m                          100.00   pool_tdata_rimage_0(0),pool_tdata_rimage_1(0),pool_tdata_rimage_2(0),pool_tdata_rimage_3(0)
  [pool_tdata_rimage_0] testvg   iwi-aor--- 4.00m                                   /dev/sda1(1)
  [pool_tdata_rimage_1] testvg   iwi-aor--- 4.00m                                   /dev/sdb1(1)
  [pool_tdata_rimage_2] testvg   iwi-aor--- 4.00m                                   /dev/sdc1(1)
  [pool_tdata_rimage_3] testvg   iwi-aor--- 4.00m                                   /dev/sdd1(1)
  [pool_tdata_rmeta_0]  testvg   ewi-aor--- 4.00m                                   /dev/sda1(2)
  [pool_tdata_rmeta_1]  testvg   ewi-aor--- 4.00m                                   /dev/sdb1(0)
  [pool_tdata_rmeta_2]  testvg   ewi-aor--- 4.00m                                   /dev/sdc1(0)
  [pool_tdata_rmeta_3]  testvg   ewi-aor--- 4.00m                                   /dev/sdd1(0)
  [pool_tmeta]          testvg   ewi-ao---- 4.00m                                   /dev/sdh1(0)
Comment 9 Bruno Goncalves 2017-07-03 03:55:45 EDT
Now there is a change on behavior when it is possible to change RAID type.

On RHEL-7.3 the pool needed to be deactivate to perform lvconvert. Now the pool needs to be active. Is this correct?

 
Active pool:
# lvconvert --type raid1 --mirrors 3 --yes testvg/pool_tdata
  Logical volume testvg/pool_tdata successfully converted.


Deactivated pool:
# lvchange -an testvg/pool
# lvconvert --type raid1 --mirrors 3 --yes testvg/pool_tdata
  testvg/pool_tdata must be active to perform this operation.


Tested with lvm2-2.02.171-8.el7
Comment 10 Jonathan Earl Brassow 2017-07-05 11:14:21 EDT
couldn't hurt to have a release note about this, but this is a necessary change in behavior.  We cannot change the behavior back without introducing worse problems - at least not until we have more complex operations to perform an up-convert.
Comment 11 errata-xmlrpc 2017-08-01 17:54:18 EDT
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-2017:2222

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