Bug 1233954

Summary: unable to rename thin pool with data volume stacked on top of cache volume
Product: Red Hat Enterprise Linux 6 Reporter: Corey Marthaler <cmarthal>
Component: lvm2Assignee: Zdenek Kabelac <zkabelac>
lvm2 sub component: Thin Provisioning (RHEL6) QA Contact: cluster-qe <cluster-qe>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: medium CC: agk, heinzm, jbrassow, msnitzer, prajnoha, prockai, thornber, zkabelac
Version: 6.7   
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: lvm2-2.02.140-1.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1251283 (view as bug list) Environment:
Last Closed: 2016-05-11 01:17:25 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: 1251283, 1268411    
Attachments:
Description Flags
verbose lvrename attempt none

Description Corey Marthaler 2015-06-19 19:56:45 UTC
Created attachment 1041064 [details]
verbose lvrename attempt

Description of problem:

[root@host-119 ~]# lvcreate  --profile thin-performance --zero y -L 4G -n pool_A snapper_thinp /dev/sda1
  Logical volume "pool_A" created.
[root@host-119 ~]# lvcreate  -L 4G -n cpool snapper_thinp /dev/sdb1
  Logical volume "cpool" created.
[root@host-119 ~]# lvcreate  -L 12M -n cpool_meta snapper_thinp /dev/sdb1
  Logical volume "cpool_meta" created.
[root@host-119 ~]# lvconvert --yes --type cache-pool --poolmetadata snapper_thinp/cpool_meta snapper_thinp/cpool
  WARNING: Converting logical volume snapper_thinp/cpool and snapper_thinp/cpool_meta to pool's data and metadata volumes.
  THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.)
  Converted snapper_thinp/cpool to cache pool.
[root@host-119 ~]# lvconvert --yes --type cache --cachepool snapper_thinp/cpool snapper_thinp/pool_A
  Logical volume snapper_thinp/pool_A is now cached.


[root@host-119 ~]# lvcreate  --profile thin-performance --zero y -L 4M -n meta snapper_thinp /dev/sda1
  Logical volume "meta" created.
[root@host-119 ~]# lvconvert --thinpool snapper_thinp/pool_A --poolmetadata meta --yes
  WARNING: Converting logical volume snapper_thinp/pool_A and snapper_thinp/meta to pool's data and metadata volumes.
  THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.)
  Converted snapper_thinp/pool_A to thin pool.


[root@host-119 ~]# lvs -a -o +devices
  LV                   VG            Attr       LSize   Pool    Origin               Data%  Meta%  Move Log Cpy%Sync Convert Devices
  [cpool]              snapper_thinp Cwi---C---   4.00g                              0.01   6.58            0.00             cpool_cdata(0)       
  [cpool_cdata]        snapper_thinp Cwi-ao----   4.00g                                                                      /dev/sdb1(0)
  [cpool_cmeta]        snapper_thinp ewi-ao----  12.00m                                                                      /dev/sdb1(1024)
  [lvol0_pmspare]      snapper_thinp ewi-------  12.00m                                                                      /dev/sde1(0)
  pool_A               snapper_thinp twi-a-tz--   4.00g                              0.00   1.27                             pool_A_tdata(0)      
  [pool_A_tdata]       snapper_thinp Cwi-aoC---   4.00g [cpool] [pool_A_tdata_corig] 0.01   6.58            0.00             pool_A_tdata_corig(0)
  [pool_A_tdata_corig] snapper_thinp owi-aoC---   4.00g                                                                      /dev/sda1(0)
  [pool_A_tmeta]       snapper_thinp ewi-ao----   4.00m                                                                      /dev/sda1(1024)


[root@host-119 ~]# lvrename snapper_thinp/pool_A snapper_thinp/pool_B
  Cannot rename "pool_A": name format not recognized for internal LV "cpool"


Version-Release number of selected component (if applicable):
2.6.32-563.el6.x86_64

lvm2-2.02.118-3.el6    BUILT: Wed Jun 17 09:40:21 CDT 2015
lvm2-libs-2.02.118-3.el6    BUILT: Wed Jun 17 09:40:21 CDT 2015
lvm2-cluster-2.02.118-3.el6    BUILT: Wed Jun 17 09:40:21 CDT 2015
udev-147-2.62.el6    BUILT: Thu Apr 23 05:44:37 CDT 2015
device-mapper-1.02.95-3.el6    BUILT: Wed Jun 17 09:40:21 CDT 2015
device-mapper-libs-1.02.95-3.el6    BUILT: Wed Jun 17 09:40:21 CDT 2015
device-mapper-event-1.02.95-3.el6    BUILT: Wed Jun 17 09:40:21 CDT 2015
device-mapper-event-libs-1.02.95-3.el6    BUILT: Wed Jun 17 09:40:21 CDT 2015
device-mapper-persistent-data-0.3.2-1.el6    BUILT: Fri Apr  4 08:43:06 CDT 2014
cmirror-2.02.118-3.el6    BUILT: Wed Jun 17 09:40:21 CDT 2015

Comment 1 Zdenek Kabelac 2015-12-11 15:10:25 UTC
Fixed upstream:

https://www.redhat.com/archives/lvm-devel/2015-December/msg00040.html

Also supporting rename for in-use cache-pool:

https://www.redhat.com/archives/lvm-devel/2015-December/msg00041.html

Comment 3 Corey Marthaler 2016-02-17 21:14:05 UTC
Fix verified in the latest rpms.

2.6.32-615.el6.x86_64
lvm2-2.02.141-2.el6    BUILT: Wed Feb 10 07:49:03 CST 2016
lvm2-libs-2.02.141-2.el6    BUILT: Wed Feb 10 07:49:03 CST 2016
lvm2-cluster-2.02.141-2.el6    BUILT: Wed Feb 10 07:49:03 CST 2016
udev-147-2.71.el6    BUILT: Wed Feb 10 07:07:17 CST 2016
device-mapper-1.02.115-2.el6    BUILT: Wed Feb 10 07:49:03 CST 2016
device-mapper-libs-1.02.115-2.el6    BUILT: Wed Feb 10 07:49:03 CST 2016
device-mapper-event-1.02.115-2.el6    BUILT: Wed Feb 10 07:49:03 CST 2016
device-mapper-event-libs-1.02.115-2.el6    BUILT: Wed Feb 10 07:49:03 CST 2016
device-mapper-persistent-data-0.6.2-0.1.rc1.el6    BUILT: Wed Feb 10 09:52:15 CST 2016
cmirror-2.02.141-2.el6    BUILT: Wed Feb 10 07:49:03 CST 2016

[root@host-137 ~]# lvcreate  --profile thin-performance --zero y -L 4G -n pool_A snapper_thinp /dev/sda1
  Logical volume "pool_A" created.
[root@host-137 ~]# lvcreate  -L 4G -n cpool snapper_thinp /dev/sdb1
  Logical volume "cpool" created.
[root@host-137 ~]# lvcreate  -L 12M -n cpool_meta snapper_thinp /dev/sdb1
  Logical volume "cpool_meta" created.
[root@host-137 ~]# lvconvert --yes --type cache-pool --poolmetadata snapper_thinp/cpool_meta snapper_thinp/cpool
  WARNING: Converting logical volume snapper_thinp/cpool and snapper_thinp/cpool_meta to pool's data and metadata volumes.
  THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.)
  Converted snapper_thinp/cpool to cache pool.
[root@host-137 ~]# lvconvert --yes --type cache --cachepool snapper_thinp/cpool snapper_thinp/pool_A
  Logical volume snapper_thinp/pool_A is now cached.
[root@host-137 ~]# lvcreate  --profile thin-performance --zero y -L 4M -n meta snapper_thinp /dev/sda1
  Logical volume "meta" created.
[root@host-137 ~]# lvconvert --thinpool snapper_thinp/pool_A --poolmetadata meta --yes
  WARNING: Converting logical volume snapper_thinp/pool_A and snapper_thinp/meta to pool's data and metadata volumes.
  THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.)
  Converted snapper_thinp/pool_A to thin pool.
[root@host-137 ~]# lvs -a -o +devices
  LV                   VG            Attr       LSize   Pool    Origin Data%  Meta%  Move Log Cpy%Sync Convert Devices              
  [cpool]              snapper_thinp Cwi---C---   4.00g                0.00   6.58            100.00           cpool_cdata(0)       
  [cpool_cdata]        snapper_thinp Cwi-ao----   4.00g                                                        /dev/sdb1(0)         
  [cpool_cmeta]        snapper_thinp ewi-ao----  12.00m                                                        /dev/sdb1(1024)      
  [lvol0_pmspare]      snapper_thinp ewi-------  12.00m                                                        /dev/sda1(1024)      
  pool_A               snapper_thinp twi-a-tz--   4.00g                0.00   1.27                             pool_A_tdata(0)      
  [pool_A_tdata]       snapper_thinp Cwi-aoC---   4.00g [cpool]        0.00   6.58            100.00           pool_A_tdata_corig(0)
  [pool_A_tdata_corig] snapper_thinp owi-aoC---   4.00g                                                        /dev/sda1(0)         
  [pool_A_tmeta]       snapper_thinp ewi-ao----   4.00m                                                        /dev/sda1(1027)      
[root@host-137 ~]# lvrename snapper_thinp/pool_A snapper_thinp/pool_B
  Renamed "pool_A" to "pool_B" in volume group "snapper_thinp"

Comment 5 errata-xmlrpc 2016-05-11 01:17:25 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-2016-0964.html