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 1269679 - lvconvert --cachepolicy currently does nothing when attempting to change policy
Summary: lvconvert --cachepolicy currently does nothing when attempting to change policy
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: lvm2
Version: 7.2
Hardware: x86_64
OS: Linux
unspecified
low
Target Milestone: rc
: ---
Assignee: Zdenek Kabelac
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-10-07 23:09 UTC by Corey Marthaler
Modified: 2021-09-03 12:56 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-10-07 17:21:33 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Corey Marthaler 2015-10-07 23:09:26 UTC
Description of problem:

[root@host-116 ~]# lvs -a -o +devices,cache_policy
  LV                    VG            Attr       LSize   Pool   Origin                Data%  Meta%  Cpy%Sync Devices                Cache Policy
  display_cache         cache_sanity  Cwi-a-C---   4.00g [pool] [display_cache_corig] 0.00   12.92  100.00   display_cache_corig(0) mq
  [display_cache_corig] cache_sanity  owi-aoC---   4.00g                                                     /dev/sdd1(0)
  [lvol0_pmspare]       cache_sanity  ewi-------  12.00m                                                     /dev/sda1(0)
  [pool]                cache_sanity  Cwi---C---   4.00g                              0.00   12.92  100.00   pool_cdata(0)          mq
  [pool_cdata]          cache_sanity  Cwi-ao----   4.00g                                                     /dev/sde1(0)
  [pool_cmeta]          cache_sanity  ewi-ao----  12.00m                                                     /dev/sde1(1024)

[root@host-116 ~]# lvconvert --cachepolicy smp cache_sanity/pool
  Can't convert internal LV cache_sanity/pool.

# This should either fail or inform users to try running 'lvchange --cachepolicy'
[root@host-116 ~]# lvconvert --cachepolicy smp cache_sanity/display_cache
[root@host-116 ~]# echo $?
0

[root@host-116 ~]# lvs -a -o +devices,cache_policy
  LV                    VG            Attr       LSize   Pool   Origin                Data%  Meta%  Cpy%Sync Devices                Cache Policy
  display_cache         cache_sanity  Cwi-a-C---   4.00g [pool] [display_cache_corig] 0.00   12.92  100.00   display_cache_corig(0) mq
  [display_cache_corig] cache_sanity  owi-aoC---   4.00g                                                     /dev/sdd1(0)
  [lvol0_pmspare]       cache_sanity  ewi-------  12.00m                                                     /dev/sda1(0)
  [pool]                cache_sanity  Cwi---C---   4.00g                              0.00   12.92  100.00   pool_cdata(0)          mq
  [pool_cdata]          cache_sanity  Cwi-ao----   4.00g                                                     /dev/sde1(0)
  [pool_cmeta]          cache_sanity  ewi-ao----  12.00m                                                     /dev/sde1(1024)


Version-Release number of selected component (if applicable):
3.10.0-319.el7.x86_64

lvm2-2.02.130-2.el7    BUILT: Tue Sep 15 07:15:40 CDT 2015
lvm2-libs-2.02.130-2.el7    BUILT: Tue Sep 15 07:15:40 CDT 2015
lvm2-cluster-2.02.130-2.el7    BUILT: Tue Sep 15 07:15:40 CDT 2015
device-mapper-1.02.107-2.el7    BUILT: Tue Sep 15 07:15:40 CDT 2015
device-mapper-libs-1.02.107-2.el7    BUILT: Tue Sep 15 07:15:40 CDT 2015
device-mapper-event-1.02.107-2.el7    BUILT: Tue Sep 15 07:15:40 CDT 2015
device-mapper-event-libs-1.02.107-2.el7    BUILT: Tue Sep 15 07:15:40 CDT 2015
device-mapper-persistent-data-0.5.5-1.el7    BUILT: Thu Aug 13 09:58:10 CDT 2015
cmirror-2.02.130-2.el7    BUILT: Tue Sep 15 07:15:40 CDT 2015
sanlock-3.2.4-1.el7    BUILT: Fri Jun 19 12:48:49 CDT 2015
sanlock-lib-3.2.4-1.el7    BUILT: Fri Jun 19 12:48:49 CDT 2015
lvm2-lockd-2.02.130-2.el7    BUILT: Tue Sep 15 07:15:40 CDT 2015

Comment 2 Corey Marthaler 2015-11-24 15:25:55 UTC
Proposing this for 7.3. lvconvert should actually do the cachemode and cachepolicy changes that are requested.


[root@host-123 ~]# lvs -a -o +devices,cachemode,cachepolicy
  LV              Attr       LSize   Devices          Cachemode    Cache Policy
  corigin         Cwi-a-C---   4.00g corigin_corig(0) writethrough mq
  [corigin_corig] owi-aoC---   4.00g /dev/sde1(0)                
  [cpool]         Cwi---C--- 500.00m cpool_cdata(0)   writethrough mq

[root@host-123 ~]# dmsetup table
cache_sanity-corigin: 0 8388608 cache 253:3 253:2 253:4 128 1 writethrough mq 0


# LVCHANGE  (works)
[root@host-123 ~]# lvchange --cachepolicy cleaner cache_sanity/corigin
  Logical volume "corigin" changed.
[root@host-123 ~]# lvs -a -o +devices,cachemode,cachepolicy
  LV              Attr       LSize   Devices          Cachemode    Cache Policy
  corigin         Cwi-a-C---   4.00g corigin_corig(0) writethrough cleaner
  [corigin_corig] owi-aoC---   4.00g /dev/sde1(0)                 
  [cpool]         Cwi---C--- 500.00m cpool_cdata(0)   writethrough cleaner

[root@host-123 ~]# lvchange --cachepolicy smq cache_sanity/corigin
  Logical volume "corigin" changed.
[root@host-123 ~]# lvs -a -o +devices,cachemode,cachepolicy
  LV              Attr       LSize   Devices          Cachemode    Cache Policy
  corigin         Cwi-a-C---   4.00g corigin_corig(0) writethrough smq
  [corigin_corig] owi-aoC---   4.00g /dev/sde1(0)                  
  [cpool]         Cwi---C--- 500.00m cpool_cdata(0)   writethrough smq

[root@host-123 ~]# lvchange --cachepolicy mq cache_sanity/corigin
  Logical volume "corigin" changed.
[root@host-123 ~]# lvs -a -o +devices,cachemode,cachepolicy
  LV              Attr       LSize   Devices          Cachemode    Cache Policy
  corigin         Cwi-a-C---   4.00g corigin_corig(0) writethrough mq
  [corigin_corig] owi-aoC---   4.00g /dev/sde1(0)                  
  [cpool]         Cwi---C--- 500.00m cpool_cdata(0)   writethrough mq


# LVCONVERT  (does nothing)
[root@host-123 ~]# lvconvert --cachepolicy smq cache_sanity/corigin
[root@host-123 ~]# lvs -a -o +devices,cachemode,cachepolicy
  LV              Attr       LSize   Devices          Cachemode    Cache Policy
  corigin         Cwi-a-C---   4.00g corigin_corig(0) writethrough mq
  [corigin_corig] owi-aoC---   4.00g /dev/sde1(0)                 
  [cpool]         Cwi---C--- 500.00m cpool_cdata(0)   writethrough mq

[root@host-123 ~]# lvconvert --cachepolicy cleaner cache_sanity/corigin
[root@host-123 ~]# lvs -a -o +devices,cachemode,cachepolicy
  LV              Attr       LSize   Devices          Cachemode    Cache Policy
  corigin         Cwi-a-C---   4.00g corigin_corig(0) writethrough mq
  [corigin_corig] owi-aoC---   4.00g /dev/sde1(0)                  
  [cpool]         Cwi---C--- 500.00m cpool_cdata(0)   writethrough mq

[root@host-123 ~]# lvconvert --cachemode writeback cache_sanity/corigin
[root@host-123 ~]# lvs -a -o +devices,cachemode,cachepolicy
  LV              Attr       LSize   Devices          Cachemode    Cache Policy
  corigin         Cwi-a-C---   4.00g corigin_corig(0) writethrough mq
  [corigin_corig] owi-aoC---   4.00g /dev/sde1(0)                   
  [cpool]         Cwi---C--- 500.00m cpool_cdata(0)   writethrough mq


3.10.0-327.el7.x86_64
lvm2-2.02.130-5.el7    BUILT: Wed Oct 14 08:27:29 CDT 2015
lvm2-libs-2.02.130-5.el7    BUILT: Wed Oct 14 08:27:29 CDT 2015
lvm2-cluster-2.02.130-5.el7    BUILT: Wed Oct 14 08:27:29 CDT 2015
device-mapper-1.02.107-5.el7    BUILT: Wed Oct 14 08:27:29 CDT 2015
device-mapper-libs-1.02.107-5.el7    BUILT: Wed Oct 14 08:27:29 CDT 2015
device-mapper-event-1.02.107-5.el7    BUILT: Wed Oct 14 08:27:29 CDT 2015
device-mapper-event-libs-1.02.107-5.el7    BUILT: Wed Oct 14 08:27:29 CDT 2015
device-mapper-persistent-data-0.5.5-1.el7    BUILT: Thu Aug 13 09:58:10 CDT 2015
cmirror-2.02.130-5.el7    BUILT: Wed Oct 14 08:27:29 CDT 2015
sanlock-3.2.4-1.el7    BUILT: Fri Jun 19 12:48:49 CDT 2015
sanlock-lib-3.2.4-1.el7    BUILT: Fri Jun 19 12:48:49 CDT 2015
lvm2-lockd-2.02.130-5.el7    BUILT: Wed Oct 14 08:27:29 CDT 2015

Comment 3 David Teigland 2016-07-08 19:28:05 UTC
This should work using lvchange, not lvconvert.  lvconvert will use a specified cachepolicy when creating a new cache LV, but won't change the cachepolicy on an existing cache LV.

Comment 4 Alasdair Kergon 2016-10-07 16:46:48 UTC
Does it still exit silently?

Comment 5 Corey Marthaler 2016-10-07 17:21:33 UTC
It appears these are all taken care of now in the latest rpms...  Closing bug.

lvm2-2.02.166-1.el7    BUILT: Wed Sep 28 02:26:52 CDT 2016
lvm2-libs-2.02.166-1.el7    BUILT: Wed Sep 28 02:26:52 CDT 2016
lvm2-cluster-2.02.166-1.el7    BUILT: Wed Sep 28 02:26:52 CDT 2016
device-mapper-1.02.135-1.el7    BUILT: Wed Sep 28 02:26:52 CDT 2016


[root@host-126 ~]# lvs -a -o +devices,cache_policy
  LV                    VG            Attr       LSize   Pool   Origin                Data%  Meta% Cpy%Sync Devices                CachePolicy
  display_cache         cache_sanity  Cwi-a-C---   4.00g [pool] [display_cache_corig] 0.00   4.39  0.00     display_cache_corig(0) mq
  [display_cache_corig] cache_sanity  owi-aoC---   4.00g                                                    /dev/sdf1(0)
  [lvol0_pmspare]       cache_sanity  ewi-------  12.00m                                                    /dev/sda1(0)
  [pool]                cache_sanity  Cwi---C---   4.00g                              0.00   4.39  0.00     pool_cdata(0)          mq
  [pool_cdata]          cache_sanity  Cwi-ao----   4.00g                                                    /dev/sde1(0)
  [pool_cmeta]          cache_sanity  ewi-ao----  12.00m                                                    /dev/sde1(1024)

[root@host-126 ~]#  lvconvert --cachepolicy smp cache_sanity/display_cache
  Operation not permitted on cache LV cache_sanity/display_cache.
  Operations permitted on a cache LV are:
  --splitcache
  --uncache
  --splitmirrors (operates on mirror or raid sub LV)
  --type thin-pool

[root@host-126 ~]#  lvconvert --cachepolicy smp cache_sanity/pool
  Operation not permitted on cache pool LV cache_sanity/pool.
  Operations permitted on a cache pool LV are:
  --splitcache    (operates on cache LV)

[root@host-126 ~]#  lvconvert --cachepolicy smp cache_sanity/pool_cdata
  Operation not permitted on striped or linear LV cache_sanity/pool_cdata.
  Operations permitted on a striped or linear LV are:
  --merge
  --type snapshot
  --type thin
  --type cache
  --type thin-pool
  --type cache-pool
  --type mirror
  --type raid*

[root@host-126 ~]#  lvconvert --cachepolicy smp cache_sanity/display_cache_corig
  Names including "_corig" are reserved. Please choose a different LV name.
  Run `lvconvert --help' for more information.


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