This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 1284999 - lvconvert --cachemode currently does nothing when attempting to change mode
lvconvert --cachemode currently does nothing when attempting to change mode
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: 1182739 1182747
Blocks:
  Show dependency treegraph
 
Reported: 2015-11-24 11:00 EST by Corey Marthaler
Modified: 2016-10-07 13:34 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:34: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-11-24 11:00:21 EST
Description of problem:
Similar to bug 1269679, however I believe this functionality was turned off due to bug 1269677. This will need to be turned on again in the future.

[root@host-123 ~]# lvcreate --yes --type cache-pool --cachepolicy mq --cachemode writethrough -L 500M cache_sanity/cpool1
  Logical volume "cpool1" created.
[root@host-123 ~]# lvcreate --yes --type cache-pool --cachepolicy mq --cachemode writeback -L 500M cache_sanity/cpool2
  Logical volume "cpool2" created.

[root@host-123 ~]# lvconvert --yes --type cache --cachepool cache_sanity/cpool1 cache_sanity/corigin1
  Logical volume cache_sanity/corigin1 is now cached.
[root@host-123 ~]# lvconvert --yes --type cache --cachepool cache_sanity/cpool2 cache_sanity/corigin2
  Logical volume cache_sanity/corigin2 is now cached.

[root@host-123 ~]# lvs -a -o +devices,cachemode,cachepolicy
  LV               Attr       LSize   Pool     Origin           Devices           Cachemode    Cache Policy
  corigin1         Cwi-a-C---   4.00g [cpool1] [corigin1_corig] corigin1_corig(0) writethrough mq
  corigin2         Cwi-a-C---   4.00g [cpool2] [corigin2_corig] corigin2_corig(0) writeback    mq
  [cpool1]         Cwi---C--- 500.00m                           cpool1_cdata(0)   writethrough mq
  [cpool2]         Cwi---C--- 500.00m                           cpool2_cdata(0)   writeback    mq

[root@host-123 ~]# lvconvert --cachemode writethrough cache_sanity/corigin2
[root@host-123 ~]# lvs -a -o +devices,cachemode,cachepolicy
  LV               Attr       LSize   Pool     Origin           Devices           Cachemode    Cache Policy
  corigin1         Cwi-a-C---   4.00g [cpool1] [corigin1_corig] corigin1_corig(0) writethrough mq
  corigin2         Cwi-a-C---   4.00g [cpool2] [corigin2_corig] corigin2_corig(0) writeback    mq
  [cpool1]         Cwi---C--- 500.00m                           cpool1_cdata(0)   writethrough mq
  [cpool2]         Cwi---C--- 500.00m                           cpool2_cdata(0)   writeback    mq

[root@host-123 ~]# lvconvert --cachemode writeback cache_sanity/corigin1
[root@host-123 ~]# lvs -a -o +devices,cachemode,cachepolicy
  LV               Attr       LSize   Pool     Origin           Devices           Cachemode    Cache Policy
  corigin1         Cwi-a-C---   4.00g [cpool1] [corigin1_corig] corigin1_corig(0) writethrough mq
  corigin2         Cwi-a-C---   4.00g [cpool2] [corigin2_corig] corigin2_corig(0) writeback    mq
  [cpool1]         Cwi---C--- 500.00m                           cpool1_cdata(0)   writethrough mq
  [cpool2]         Cwi---C--- 500.00m                           cpool2_cdata(0)   writeback    mq

[root@host-123 ~]# dmsetup table
cache_sanity-corigin2: 0 8388608 cache 253:8 253:7 253:9 128 1 writeback mq 0
cache_sanity-corigin1: 0 8388608 cache 253:5 253:4 253:6 128 1 writethrough mq 0



Version-Release number of selected component (if applicable):
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 1 David Teigland 2016-07-08 15:27:27 EDT
This should work using lvchange, not lvconvert.  lvconvert will use a specified cachemode when creating a new cache LV, but won't change the cachemode on an existing cache LV.
Comment 2 Corey Marthaler 2016-10-07 13:34:33 EDT
This scenario appears to have the proper warnings in the latest rpms now.

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
  LV                    Attr       LSize   Pool   Origin                Data% Meta% Cpy%Sync Devices
  display_cache         Cwi-a-C---   4.00g [pool] [display_cache_corig] 0.00  8.66  0.00     display_cache_corig(0)
  [display_cache_corig] owi-aoC---   4.00g                                                   /dev/sde1(0)
  [lvol0_pmspare]       ewi-------  12.00m                                                   /dev/sda1(1027)
  [pool]                Cwi---C---   4.00g                              0.00  8.66  0.00     pool_cdata(0)
  [pool_cdata]          Cwi-ao----   4.00g                                                   /dev/sda1(0)
  [pool_cmeta]          ewi-ao----  12.00m                                                   /dev/sda1(1024)

[root@host-126 ~]# dmsetup table
cache_sanity-display_cache: 0 8388608 cache 253:4 253:3 253:5 64 1 writethrough cleaner 0
cache_sanity-display_cache_corig: 0 8388608 linear 8:65 2048
cache_sanity-pool_cdata: 0 8388608 linear 8:1 2048
cache_sanity-pool_cmeta: 0 24576 linear 8:1 8390656

[root@host-126 ~]# lvconvert --cachemode writeback 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 --cachemode writeback 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 --cachemode writeback 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 --cachemode writeback 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.