Bug 1284107 - "volume already exists" message needed when attempting to create a cache pool using same name of existing thin pool
"volume already exists" message needed when attempting to create a cache pool...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: lvm2 (Show other bugs)
7.2
x86_64 Linux
low Severity low
: rc
: ---
Assigned To: Zdenek Kabelac
cluster-qe@redhat.com
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-11-20 16:26 EST by Corey Marthaler
Modified: 2017-08-01 17:47 EDT (History)
7 users (show)

See Also:
Fixed In Version: lvm2-2.02.171-5.el7
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-08-01 17:47:18 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-20 16:26:50 EST
Description of problem:

# Create thin pool
[root@host-122 ~]# lvcreate --thin-pool thinpool -L 100M vg
  Logical volume "thinpool" created.

# Attempt to create cache pool using same name
[root@host-122 ~]# lvcreate --cache-pool thinpool -L 100M vg
  Internal error: Unsupported creation of cache and cache pool volume.



# Reversed, Create cache pool
[root@host-122 ~]# lvcreate --type cache-pool -n cpool -L 100M vg
  Logical volume "cpool" created.

# Attempt to create thin pool using same name
[root@host-122 ~]# lvcreate --thin-pool cpool -L 100M vg
  Logical volume cpool already exists in Volume group vg.




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 Corey Marthaler 2016-09-21 15:50:36 EDT
Still in the latest 7.3, proposing for 7.4 now...


3.10.0-501.el7.x86_64
lvm2-2.02.165-3.el7    BUILT: Wed Sep 21 08:26:18 CDT 2016
lvm2-libs-2.02.165-3.el7    BUILT: Wed Sep 21 08:26:18 CDT 2016
lvm2-cluster-2.02.165-3.el7    BUILT: Wed Sep 21 08:26:18 CDT 2016
device-mapper-1.02.134-3.el7    BUILT: Wed Sep 21 08:26:18 CDT 2016
device-mapper-libs-1.02.134-3.el7    BUILT: Wed Sep 21 08:26:18 CDT 2016
device-mapper-event-1.02.134-3.el7    BUILT: Wed Sep 21 08:26:18 CDT 2016
device-mapper-event-libs-1.02.134-3.el7    BUILT: Wed Sep 21 08:26:18 CDT 2016
device-mapper-persistent-data-0.6.3-1.el7    BUILT: Fri Jul 22 05:29:13 CDT 2016



SCENARIO - [already_exists]
Create a both a cache pool and thin pool and then attempt to create the other type using existing names

*** Cache info for this scenario ***
*  origin (slow):  /dev/sda1
*  pool (fast):    /dev/sde1
************************************

Adding "slow" and "fast" tags to corresponding pvs
Create a both a cache pool and thin pool and then attempt to create the other type using existing names
lvcreate  --thin-pool Tpool -L 100M cache_sanity
lvcreate  --type cache-pool -n Cpool -L 100M cache_sanity @fast

lvcreate  --cache-pool Tpool -L 100M cache_sanity
Errors found, possibly bug 1284107
  Using default stripesize 64.00 KiB.
  Internal error: Unsupported creation of cache and cache pool volume.
lvcreate  --thin-pool Cpool -L 100M cache_sanity
Comment 2 Zdenek Kabelac 2017-01-22 15:57:11 EST
Should be already fixed in upstream so ready for 7.4.
Comment 4 Corey Marthaler 2017-05-18 15:40:24 EDT
Still in the latest 7.4 rpms.


[root@host-076 ~]# lvcreate  --thin-pool Tpool -L 100M VG
  Using default stripesize 64.00 KiB.
  Logical volume "Tpool" created.

[root@host-076 ~]# lvcreate  --type cache-pool -n Cpool -L 100M VG
  Using default stripesize 64.00 KiB.
  Logical volume "Cpool" created.

[root@host-076 ~]# lvs -a -o +devices
  LV              VG  Attr       LSize   Pool Origin Data%  Meta% Devices
  Cpool           VG  Cwi---C--- 100.00m                          Cpool_cdata(0)
  [Cpool_cdata]   VG  Cwi------- 100.00m                          /dev/sdb1(29)
  [Cpool_cmeta]   VG  ewi-------   8.00m                          /dev/sdb1(27)
  Tpool           VG  twi-a-tz-- 100.00m             0.00   0.88  Tpool_tdata(0)
  [Tpool_tdata]   VG  Twi-ao---- 100.00m                          /dev/sdb1(1)
  [Tpool_tmeta]   VG  ewi-ao----   4.00m                          /dev/sda1(0)
  [lvol0_pmspare] VG  ewi-------   8.00m                          /dev/sdb1(0)
  [lvol0_pmspare] VG  ewi-------   8.00m                          /dev/sdb1(26)

[root@host-076 ~]# lvcreate  --cache-pool Tpool -L 100M VG
  Using default stripesize 64.00 KiB.
  Internal error: Unsupported creation of cache and cache pool volume.

[root@host-076 ~]# lvcreate  --thin-pool Cpool -L 100M VG
  Using default stripesize 64.00 KiB.
  Logical volume Cpool already exists in Volume group VG.


3.10.0-666.el7.x86_64
lvm2-2.02.171-1.el7    BUILT: Wed May  3 07:05:13 CDT 2017
lvm2-libs-2.02.171-1.el7    BUILT: Wed May  3 07:05:13 CDT 2017
lvm2-cluster-2.02.171-1.el7    BUILT: Wed May  3 07:05:13 CDT 2017
device-mapper-1.02.140-1.el7    BUILT: Wed May  3 07:05:13 CDT 2017
device-mapper-libs-1.02.140-1.el7    BUILT: Wed May  3 07:05:13 CDT 2017
device-mapper-event-1.02.140-1.el7    BUILT: Wed May  3 07:05:13 CDT 2017
device-mapper-event-libs-1.02.140-1.el7    BUILT: Wed May  3 07:05:13 CDT 2017
device-mapper-persistent-data-0.7.0-0.1.rc6.el7    BUILT: Mon Mar 27 10:15:46 CDT 2017
Comment 5 Zdenek Kabelac 2017-06-09 14:46:41 EDT
Hmm got somehow lost in code and in my test it's likely been reject for other reason. 

Anyway - looked through it again - and found missing validation inside lvcreate part of code and upstreamed proper fix patch:

https://www.redhat.com/archives/lvm-devel/2017-June/msg00022.html
Comment 6 Corey Marthaler 2017-06-15 15:24:11 EDT
Fix verified in the latest rpms.

lvm2-2.02.171-5.el7    BUILT: Wed Jun 14 10:33:32 CDT 2017
lvm2-libs-2.02.171-5.el7    BUILT: Wed Jun 14 10:33:32 CDT 2017
lvm2-cluster-2.02.171-5.el7    BUILT: Wed Jun 14 10:33:32 CDT 2017
device-mapper-1.02.140-5.el7    BUILT: Wed Jun 14 10:33:32 CDT 2017
device-mapper-libs-1.02.140-5.el7    BUILT: Wed Jun 14 10:33:32 CDT 2017
device-mapper-event-1.02.140-5.el7    BUILT: Wed Jun 14 10:33:32 CDT 2017
device-mapper-event-libs-1.02.140-5.el7    BUILT: Wed Jun 14 10:33:32 CDT 2017
device-mapper-persistent-data-0.7.0-0.1.rc6.el7    BUILT: Mon Mar 27 10:15:46 CDT 2017


[root@harding-03 ~]# lvcreate  --cache-pool Tpool -L 100M cache_sanity
  Using default stripesize 64.00 KiB.
  Logical volume cache_sanity/Tpool is not a cache pool.

[root@harding-03 ~]# lvcreate  --thin-pool Cpool -L 100M cache_sanity
  Using default stripesize 64.00 KiB.
  Logical volume Cpool already exists in Volume group cache_sanity.
Comment 7 errata-xmlrpc 2017-08-01 17:47:18 EDT
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://access.redhat.com/errata/RHBA-2017:2222

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