Bug 1091543

Summary: bogus error when attempting to split images from raid1 cache origin volume
Product: Red Hat Enterprise Linux 7 Reporter: Corey Marthaler <cmarthal>
Component: lvm2Assignee: Petr Rockai <prockai>
lvm2 sub component: Cache Logical Volumes QA Contact: Cluster QE <mspqa-list>
Status: CLOSED ERRATA Docs Contact:
Severity: low    
Priority: low CC: agk, heinzm, jbrassow, msnitzer, prajnoha, prockai, zkabelac
Version: 7.0Keywords: Triaged
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: lvm2-2.02.112-1.el7 Doc Type: Bug Fix
Doc Text:
Issuing a lvconvert --splitmirror command on a RAID volume with a persistent cache on top would have caused a confusing error message to be printed. The code has been changed to proceed by using the underlying RAID volume for this operation, since --splitmirror does not make sense for the cache LV directly.
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-03-05 13:08:24 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:
Bug Depends On:    
Bug Blocks: 1119326    

Description Corey Marthaler 2014-04-25 20:09:45 UTC
Description of problem:
When attempting to split images off a raid cache origin, I got this "--cachepool argument is required" error when really, i was supposed to use the new "split_origin_corig" subvol name for the raid instead of "split_origin".

[root@harding-03 ~]# pvscan
  PV /dev/sdb3   VG split_image lvm2 [31.05 GiB / 30.55 GiB free]
  PV /dev/sdb2   VG split_image lvm2 [31.04 GiB / 30.55 GiB free]
  PV /dev/sdb1   VG split_image lvm2 [31.05 GiB / 30.56 GiB free]
  PV /dev/sdc3   VG split_image lvm2 [31.05 GiB / 30.55 GiB free]
  PV /dev/sdc2   VG split_image lvm2 [31.04 GiB / 30.55 GiB free]
  PV /dev/sdc1   VG split_image lvm2 [31.05 GiB / 30.56 GiB free]

[root@harding-03 ~]# lvs -a -o +devices
  LV                      Attr       LSize   Pool  Origin               Cpy%Sync Devices
  cache                   Cwi-a-C--- 500.00m                                     cache_cdata(0)
  [cache_cdata]           Cwi-aoC--- 500.00m                                     /dev/sdc3(0)
  [cache_cmeta]           ewi-aoC---   8.00m                                     /dev/sdc3(125)
  [lvol0_pmspare]         ewi-------   8.00m                                     /dev/sdb3(126)
  split_origin            Cwi-a-C--- 500.00m cache [split_origin_corig]          split_origin_corig(0)
  [split_origin_corig]    rwi-aor--- 500.00m                              100.00 split_origin_rimage_0(0),split_origin_rimage_1(0),split_origin_rimage_2(0),split_origin_rimage_3(0),split_origin_rimage_4(0)
  [split_origin_rimage_0] iwi-aor--- 500.00m                                     /dev/sdc2(1)
  [split_origin_rimage_1] iwi-aor--- 500.00m                                     /dev/sdc1(1)
  [split_origin_rimage_2] iwi-aor--- 500.00m                                     /dev/sdb1(1)
  [split_origin_rimage_3] iwi-aor--- 500.00m                                     /dev/sdb3(1)
  [split_origin_rimage_4] iwi-aor--- 500.00m                                     /dev/sdb2(1)
  [split_origin_rmeta_0]  ewi-aor---   4.00m                                     /dev/sdc2(0)
  [split_origin_rmeta_1]  ewi-aor---   4.00m                                     /dev/sdc1(0)
  [split_origin_rmeta_2]  ewi-aor---   4.00m                                     /dev/sdb1(0)
  [split_origin_rmeta_3]  ewi-aor---   4.00m                                     /dev/sdb3(0)
  [split_origin_rmeta_4]  ewi-aor---   4.00m                                     /dev/sdb2(0)

[root@harding-03 ~]# lvconvert --splitmirrors 1 --name new0 split_image/split_origin /dev/sdb1
  --cachepool argument is required.

[root@harding-03 ~]# lvconvert --splitmirrors 1 --cachepool cache --name new0 split_image/split_origin /dev/sdb1
  --cachepool argument is only valid with  the "cache" segment type
  Run `lvconvert --help' for more information.

[root@harding-03 ~]# lvconvert --splitmirrors 1 --cachepool --name new0 split_image/split_origin /dev/sdb1
  --cachepool argument is only valid with  the "cache" segment type
  Run `lvconvert --help' for more information.

[root@harding-03 ~]# lvconvert --splitmirrors 1 --name new0 split_image/split_origin_corig /dev/sdb1

[root@harding-03 ~]# lvs -a -o +devices
  LV                      Attr       LSize   Pool  Origin               Cpy%Sync Devices
  cache                   Cwi-a-C--- 500.00m                                     cache_cdata(0)
  [cache_cdata]           Cwi-aoC--- 500.00m                                     /dev/sdc3(0)
  [cache_cmeta]           ewi-aoC---   8.00m                                     /dev/sdc3(125)
  [lvol0_pmspare]         ewi-------   8.00m                                     /dev/sdb3(126)
  new0                    -wi-a----- 500.00m                                     /dev/sdb1(1)
  split_origin            Cwi-a-C--- 500.00m cache [split_origin_corig]          split_origin_corig(0)
  [split_origin_corig]    rwi-aor--- 500.00m                              100.00 split_origin_rimage_0(0),split_origin_rimage_1(0),split_origin_rimage_2(0),split_origin_rimage_3(0)
  [split_origin_rimage_0] iwi-aor--- 500.00m                                     /dev/sdc2(1)
  [split_origin_rimage_1] iwi-aor--- 500.00m                                     /dev/sdc1(1)
  [split_origin_rimage_2] iwi-aor--- 500.00m                                     /dev/sdb3(1)
  [split_origin_rimage_3] iwi-aor--- 500.00m                                     /dev/sdb2(1)
  [split_origin_rmeta_0]  ewi-aor---   4.00m                                     /dev/sdc2(0)
  [split_origin_rmeta_1]  ewi-aor---   4.00m                                     /dev/sdc1(0)
  [split_origin_rmeta_2]  ewi-aor---   4.00m                                     /dev/sdb3(0)
  [split_origin_rmeta_3]  ewi-aor---   4.00m                                     /dev/sdb2(0)


Version-Release number of selected component (if applicable):
3.10.0-110.el7.x86_64
lvm2-2.02.105-14.el7    BUILT: Wed Mar 26 08:29:41 CDT 2014
lvm2-libs-2.02.105-14.el7    BUILT: Wed Mar 26 08:29:41 CDT 2014
lvm2-cluster-2.02.105-14.el7    BUILT: Wed Mar 26 08:29:41 CDT 2014
device-mapper-1.02.84-14.el7    BUILT: Wed Mar 26 08:29:41 CDT 2014
device-mapper-libs-1.02.84-14.el7    BUILT: Wed Mar 26 08:29:41 CDT 2014
device-mapper-event-1.02.84-14.el7    BUILT: Wed Mar 26 08:29:41 CDT 2014
device-mapper-event-libs-1.02.84-14.el7    BUILT: Wed Mar 26 08:29:41 CDT 2014
device-mapper-persistent-data-0.2.8-4.el7    BUILT: Fri Jan 24 14:28:55 CST 2014
cmirror-2.02.105-14.el7    BUILT: Wed Mar 26 08:29:41 CDT 2014


How reproducible:
Everytime

Comment 1 Jonathan Earl Brassow 2014-09-30 15:01:34 UTC
Upstream code still yields strange message:

[root@bp-01 ~]# lvconvert --splitmirrors 1 --name new0 vg/lv
  Mirrors are not yet supported on cache LVs vg/lv.

Comment 2 Petr Rockai 2014-10-06 06:15:55 UTC
The problem was that the code picked an old-style-mirror based path because of splitmirror and the LV not being a RAID LV, giving the confusing error. I have changed lvconvert (in d2f901f04f76cca110475395272e70c83bea816d) to warn the user about using --splitmirrors over a cache LV and to proceed using the origin for the operation.

Comment 4 Corey Marthaler 2014-12-04 23:35:47 UTC
Verification of this is blocked behind bug 1164347.

Comment 5 Corey Marthaler 2015-01-28 21:02:15 UTC
Fix verified in the latest rpms. The cmd now just "does the right thing".


[root@host-116 ~]# lvconvert --splitmirrors 1 --name new3 split_image/split_origin
  WARNING: Selected operation does not work with cache-type LVs.
  Proceeding using the cache origin LV split_origin_corig instead



3.10.0-225.el7.x86_64
lvm2-2.02.115-3.el7    BUILT: Wed Jan 28 09:59:01 CST 2015
lvm2-libs-2.02.115-3.el7    BUILT: Wed Jan 28 09:59:01 CST 2015
lvm2-cluster-2.02.115-3.el7    BUILT: Wed Jan 28 09:59:01 CST 2015
device-mapper-1.02.93-3.el7    BUILT: Wed Jan 28 09:59:01 CST 2015
device-mapper-libs-1.02.93-3.el7    BUILT: Wed Jan 28 09:59:01 CST 2015
device-mapper-event-1.02.93-3.el7    BUILT: Wed Jan 28 09:59:01 CST 2015
device-mapper-event-libs-1.02.93-3.el7    BUILT: Wed Jan 28 09:59:01 CST 2015
device-mapper-persistent-data-0.4.1-2.el7    BUILT: Wed Nov 12 12:39:46 CST 2014
cmirror-2.02.115-3.el7    BUILT: Wed Jan 28 09:59:01 CST 2015

Comment 7 errata-xmlrpc 2015-03-05 13:08:24 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://rhn.redhat.com/errata/RHBA-2015-0513.html