Bug 1777000

Summary: lvconvert or lvchange command needs to load dm-writecache module if not already loaded
Product: Red Hat Enterprise Linux 8 Reporter: Corey Marthaler <cmarthal>
Component: lvm2Assignee: LVM and device-mapper development team <lvm-team>
lvm2 sub component: Command-line tools QA Contact: cluster-qe <cluster-qe>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: unspecified CC: agk, heinzm, jbrassow, mcsontos, msnitzer, pasik, prajnoha, rhandlin, teigland, thornber, zkabelac
Version: 8.2   
Target Milestone: rc   
Target Release: 8.0   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: lvm2-2.03.07-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-04-28 16:58:59 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:

Description Corey Marthaler 2019-11-26 17:10:14 UTC
Description of problem:

[root@hayes-02 ~]# lvcreate -L 1G -n origin seven /dev/sdi1
  Logical volume "origin" created.
[root@hayes-02 ~]# lvcreate -L 200M -n wpool seven /dev/sdk1
  Logical volume "wpool" created.


### Currently the dm-wc conversion requires the two above LVs to be inactive. Should the following conversion command do the modprobe (and auto activate) or should the lvchange do it?
[root@hayes-02 ~]# lvchange -an seven

[root@hayes-02 ~]# lvconvert --yes --type writecache --cachevol seven/wpool seven/origin
  Logical volume seven/origin now has write cache.
[root@hayes-02 ~]# lvs -a -o +devices
  LV              VG    Attr       LSize   Pool         Origin          Data%  Meta%  Move Log Cpy%Sync Convert Devices         
  origin          seven Cwi---C---   1.00g [wpool_cvol] [origin_wcorig]                                         origin_wcorig(0)
  [origin_wcorig] seven owi---C---   1.00g                                                                      /dev/sdi1(0)    
  [wpool_cvol]    seven Cwi---C--- 200.00m                                                                      /dev/sdk1(0)    

[root@hayes-02 ~]# lvchange -ay seven/origin
  Can't process LV seven/origin: writecache target support missing from kernel?

[root@hayes-02 ~]# modprobe dm-writecache
[root@hayes-02 ~]# lvchange -ay seven/origin
[root@hayes-02 ~]# lvs -a -o +devices
  LV              VG    Attr       LSize   Pool         Origin          Data%  Meta%  Move Log Cpy%Sync Convert Devices         
  origin          seven Cwi-a-C---   1.00g [wpool_cvol] [origin_wcorig]                                         origin_wcorig(0)
  [origin_wcorig] seven owi-aoC---   1.00g                                                                      /dev/sdi1(0)    
  [wpool_cvol]    seven Cwi-aoC--- 200.00m                                                                      /dev/sdk1(0)    


Version-Release number of selected component (if applicable):
kernel-4.18.0-151.el8    BUILT: Fri Nov 15 13:14:53 CST 2019
lvm2-2.03.06-0.2.el8    BUILT: Mon Nov 18 06:39:12 CST 2019
lvm2-libs-2.03.06-0.2.el8    BUILT: Mon Nov 18 06:39:12 CST 2019
lvm2-dbusd-2.03.06-0.2.el8    BUILT: Mon Nov 18 06:39:12 CST 2019
device-mapper-1.02.165-0.2.el8    BUILT: Mon Nov 18 06:39:12 CST 2019
device-mapper-libs-1.02.165-0.2.el8    BUILT: Mon Nov 18 06:39:12 CST 2019
device-mapper-event-1.02.165-0.2.el8    BUILT: Mon Nov 18 06:39:12 CST 2019
device-mapper-event-libs-1.02.165-0.2.el8    BUILT: Mon Nov 18 06:39:12 CST 2019
device-mapper-persistent-data-0.8.5-2.el8    BUILT: Wed Jun  5 10:28:04 CDT 2019


How reproducible:
Everytime

Comment 5 Corey Marthaler 2020-01-06 16:28:40 UTC
Fix verified in the latest rpms.

kernel-4.18.0-167.el8    BUILT: Sat Dec 14 19:43:52 CST 2019
lvm2-2.03.07-1.el8    BUILT: Mon Dec  2 00:09:32 CST 2019
lvm2-libs-2.03.07-1.el8    BUILT: Mon Dec  2 00:09:32 CST 2019
device-mapper-1.02.167-1.el8    BUILT: Mon Dec  2 00:09:32 CST 2019
device-mapper-libs-1.02.167-1.el8    BUILT: Mon Dec  2 00:09:32 CST 2019
device-mapper-event-1.02.167-1.el8    BUILT: Mon Dec  2 00:09:32 CST 2019
device-mapper-event-libs-1.02.167-1.el8    BUILT: Mon Dec  2 00:09:32 CST 2019


[root@hayes-02 ~]# lsmod | grep write

[root@hayes-02 ~]# vgcreate seven /dev/sd[ik]1
  Physical volume "/dev/sdi1" successfully created.
  Physical volume "/dev/sdk1" successfully created.
  Volume group "seven" successfully created
[root@hayes-02 ~]# lvcreate -L 1G -n origin seven /dev/sdi1
  Logical volume "origin" created.
[root@hayes-02 ~]# lvcreate -L 200M -n wpool seven /dev/sdk1
  Logical volume "wpool" created.
[root@hayes-02 ~]# lvchange -an seven
[root@hayes-02 ~]# lvconvert --yes --type writecache --cachevol seven/wpool seven/origin
  Logical volume seven/origin now has write cache.
[root@hayes-02 ~]# lvs -a -o +devices
  LV              VG    Attr       LSize   Pool         Origin          Data%  Meta% Devices         
  origin          seven Cwi---C---   1.00g [wpool_cvol] [origin_wcorig]              origin_wcorig(0)
  [origin_wcorig] seven owi---C---   1.00g                                           /dev/sdi1(0)    
  [wpool_cvol]    seven Cwi---C--- 200.00m                                           /dev/sdk1(0)    


[root@hayes-02 ~]# lvchange -ay seven/origin

Jan  6 10:23:47 hayes-02 kernel: TECH PREVIEW: DM writecache may not be fully supported.#012Please review provided documentation for limitations.

[root@hayes-02 ~]# lvs -a -o +devices
  LV              VG    Attr       LSize   Pool         Origin          Data%  Meta% Devices         
  origin          seven Cwi-a-C---   1.00g [wpool_cvol] [origin_wcorig]              origin_wcorig(0)
  [origin_wcorig] seven owi-aoC---   1.00g                                           /dev/sdi1(0)    
  [wpool_cvol]    seven Cwi-aoC--- 200.00m                                           /dev/sdk1(0)    

[root@hayes-02 ~]# lsmod | grep write
dm_writecache          36864  1
dm_mod                151552  11 dm_multipath,dm_writecache

Comment 7 errata-xmlrpc 2020-04-28 16:58: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.

https://access.redhat.com/errata/RHEA-2020:1881