Bug 1269679 - lvconvert --cachepolicy currently does nothing when attempting to change policy
lvconvert --cachepolicy currently does nothing when attempting to change policy
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: lvm2 (Show other bugs)
7.2
x86_64 Linux
unspecified Severity low
: rc
: ---
Assigned To: Zdenek Kabelac
cluster-qe@redhat.com
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-10-07 19:09 EDT by Corey Marthaler
Modified: 2016-10-07 13:21 EDT (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-10-07 13:21:33 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Corey Marthaler 2015-10-07 19:09:26 EDT
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 10:25:55 EST
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 15:28:05 EDT
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 12:46:48 EDT
Does it still exit silently?
Comment 5 Corey Marthaler 2016-10-07 13:21:33 EDT
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.