Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1243982

Summary: attempting to convert to cache w/o a valid cache pool volume no longer works
Product: Red Hat Enterprise Linux 7 Reporter: Corey Marthaler <cmarthal>
Component: lvm2Assignee: Zdenek Kabelac <zkabelac>
lvm2 sub component: Cache Logical Volumes QA Contact: cluster-qe <cluster-qe>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: medium CC: agk, heinzm, jbrassow, msnitzer, prajnoha, tlavigne, zkabelac
Version: 7.2Keywords: Regression, Triaged
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: lvm2-2.02.129-1.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-19 12:47:00 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:
Attachments:
Description Flags
verbose lvconvert attempt none

Description Corey Marthaler 2015-07-16 18:41:09 UTC
Description of problem:
When given a "pool" volume to be used in cache conversion that isn't an actual cache pool yet, the lvconvert command used to convert it to pool and then continue to convert the given origin into a cache volume. However, this no longer works. The pool conversion still appears to work, but the origin conversion is not properly finished.


# RHEL6.7

[root@mckinley-01 ~]# lvcreate -L 4G -n corigin cache_sanity /dev/mapper/mpathbp1
  Logical volume "corigin" created.
[root@mckinley-01 ~]# lvcreate -L 100M -n pool cache_sanity /dev/mapper/mpathcp1
  Logical volume "pool" created.
[root@mckinley-01 ~]# lvconvert --yes --type cache --cachepool cache_sanity/pool cache_sanity/corigin
  WARNING: Converting logical volume cache_sanity/pool to pool's data volume.
  THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.)
  Converted cache_sanity/pool to cache pool.
  Logical volume cache_sanity/corigin is now cached.
[root@mckinley-01 ~]# lvs -a -o +devices
  LV              Attr       LSize   Pool   Origin          Data%  Meta%  Cpy%Sync Devices                   
  corigin         Cwi-a-C---   4.00g [pool] [corigin_corig] 0.31   0.49   0.00     corigin_corig(0)          
  [corigin_corig] owi-aoC---   4.00g                                               /dev/mapper/mpathbp1(0)   
  [lvol0_pmspare] ewi-------   8.00m                                               /dev/mapper/mpathbp1(1026)
  [pool]          Cwi---C--- 100.00m                        0.31   0.49   0.00     pool_cdata(0)             
  [pool_cdata]    Cwi-ao---- 100.00m                                               /dev/mapper/mpathcp1(0)   
  [pool_cmeta]    ewi-ao----   8.00m                                               /dev/mapper/mpathbp1(1024)


# RHEL7.2

[root@host-112 ~]# lvcreate -L 4G -n corigin cache_sanity /dev/sda1
  Logical volume "corigin" created.
[root@host-112 ~]# lvcreate -L 100M -n pool cache_sanity /dev/sdb1
  Logical volume "pool" created.
[root@host-112 ~]# lvconvert --yes --type cache --cachepool cache_sanity/pool cache_sanity/corigin
  WARNING: Converting logical volume cache_sanity/pool to pool's data volume.
  THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.)
  Converted cache_sanity/pool to cache pool.
  device-mapper: reload ioctl on (253:2) failed: Invalid argument
  Failed to lock logical volume cache_sanity/corigin.

[264306.427782] device-mapper: cache-policy: unknown policy type
[264306.428475] device-mapper: table: 253:2: cache: Error creating cache's policy
[264306.429305] device-mapper: ioctl: error adding target to table

[root@host-112 ~]# echo $?
5
[root@host-112 ~]# lvs -a -o +devices
  LV              Attr       LSize   Pool Origin Data%  Meta%  Cpy%Sync Devices        
  corigin         -wi-a-----   4.00g                                    /dev/sda1(0)   
  [lvol0_pmspare] ewi-------   8.00m                                    /dev/sda1(1026)
  pool            Cwi---C--- 100.00m                                    pool_cdata(0)  
  [pool_cdata]    Cwi-a----- 100.00m                                    /dev/sdb1(0)   
  [pool_cmeta]    ewi-a-----   8.00m                                    /dev/sda1(1024)



Version-Release number of selected component (if applicable):
3.10.0-290.el7.x86_64

lvm2-2.02.125-2.el7    BUILT: Fri Jul 10 03:42:29 CDT 2015
lvm2-libs-2.02.125-2.el7    BUILT: Fri Jul 10 03:42:29 CDT 2015
lvm2-cluster-2.02.125-2.el7    BUILT: Fri Jul 10 03:42:29 CDT 2015
device-mapper-1.02.102-2.el7    BUILT: Fri Jul 10 03:42:29 CDT 2015
device-mapper-libs-1.02.102-2.el7    BUILT: Fri Jul 10 03:42:29 CDT 2015
device-mapper-event-1.02.102-2.el7    BUILT: Fri Jul 10 03:42:29 CDT 2015
device-mapper-event-libs-1.02.102-2.el7    BUILT: Fri Jul 10 03:42:29 CDT 2015
device-mapper-persistent-data-0.5.3-1.el7    BUILT: Tue Jul  7 08:41:42 CDT 2015
cmirror-2.02.125-2.el7    BUILT: Fri Jul 10 03:42: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.125-2.el7    BUILT: Fri Jul 10 03:42:29 CDT 2015

Comment 1 Corey Marthaler 2015-07-16 18:44:19 UTC
Created attachment 1052820 [details]
verbose lvconvert attempt

Comment 2 Corey Marthaler 2015-07-16 19:32:00 UTC
Same thing happens when given no cache pool for conversion.

[root@host-112 ~]# lvcreate -L 4G -n corigin cache_sanity /dev/sdb1
  Logical volume "corigin" created.
[root@host-112 ~]# lvs -a -o +devices
  LV      Attr       LSize   Pool Origin Data%  Meta%  Cpy%Sync Devices
  corigin -wi-a-----   4.00g                                    /dev/sdb1(0)

[root@host-112 ~]# lvcreate --type cache -n existing_origin -L 2G cache_sanity/corigin /dev/sdf1
  device-mapper: reload ioctl on (253:2) failed: Invalid argument
  Failed to lock logical volume cache_sanity/corigin.
  Aborting. Manual intervention required.

[268663.610579] device-mapper: cache-policy: unknown policy type
[268663.611899] device-mapper: table: 253:2: cache: Error creating cache's policy
[268663.613503] device-mapper: ioctl: error adding target to table


[root@host-112 ~]# lvs -a -o +devices
  LV                      Attr       LSize Pool Origin Data%  Meta%  Cpy%Sync Devices
  corigin                 -wi-a----- 4.00g                                    /dev/sdb1(0)
  existing_origin         Cwi---C--- 2.00g                                    existing_origin_cdata(0)
  [existing_origin_cdata] Cwi-a----- 2.00g                                    /dev/sdf1(4)
  [existing_origin_cmeta] ewi-a----- 8.00m                                    /dev/sdf1(2)
  [lvol0_pmspare]         ewi------- 8.00m                                    /dev/sdf1(0)

Comment 3 Zdenek Kabelac 2015-08-26 11:11:47 UTC
Addressed by upstream patchset:

https://www.redhat.com/archives/lvm-devel/2015-August/msg00185.html

(lvcreate issue from comment 2 has been already addressed in some preceding commit)

Comment 5 Corey Marthaler 2015-09-01 23:29:32 UTC
The two cases mentioned in this bug now work with the latest rpms. Marking verified.


3.10.0-313.el7.x86_64
lvm2-2.02.129-1.el7    BUILT: Mon Aug 31 08:27:56 CDT 2015
lvm2-libs-2.02.129-1.el7    BUILT: Mon Aug 31 08:27:56 CDT 2015
lvm2-cluster-2.02.129-1.el7    BUILT: Mon Aug 31 08:27:56 CDT 2015
device-mapper-1.02.106-1.el7    BUILT: Mon Aug 31 08:27:56 CDT 2015
device-mapper-libs-1.02.106-1.el7    BUILT: Mon Aug 31 08:27:56 CDT 2015
device-mapper-event-1.02.106-1.el7    BUILT: Mon Aug 31 08:27:56 CDT 2015
device-mapper-event-libs-1.02.106-1.el7    BUILT: Mon Aug 31 08:27:56 CDT 2015
device-mapper-persistent-data-0.5.5-1.el7    BUILT: Thu Aug 13 09:58:10 CDT 2015
cmirror-2.02.129-1.el7    BUILT: Mon Aug 31 08:27:56 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.129-1.el7    BUILT: Mon Aug 31 08:27:56 CDT 2015



SCENARIO - [existing_origin]

*** Cache info for this scenario ***
*  origin (slow):  /dev/sdc1
*  pool (fast):    /dev/sdf1
************************************

Create an existing origin volume with out a cache pool, and then convert it to a cache volume in one command
Create origin (slow) volume
lvcreate -L 4G -n corigin cache_sanity /dev/sdc1

Create a cache volume from this existing origin volume with just one lvcreate command
lvcreate --type cache -n existing_origin -L 2G cache_sanity/corigin /dev/sdf1

Uncaching cache origin (lvconvert --uncache) cache_sanity/corigin from cache origin
Removing cache origin volume cache_sanity/corigin
lvremove -f /dev/cache_sanity/corigin


SCENARIO - [attempt_cache_w_non_cache_pool]

*** Cache info for this scenario ***
*  origin (slow):  /dev/sdf1
*  pool (fast):    /dev/sdd1
************************************

Attempt to create a cache volume using a non cache pool
Create origin (slow) volume
lvcreate -L 4G -n corigin cache_sanity /dev/sdf1

lvcreate -L 100M -n pool cache_sanity /dev/sdd1

Attempt to Create cached volume by combining the NON cache pool (fast) and origin (slow) volumes (w/ --no for auto conversion)
lvconvert --no --type cache --cachepool cache_sanity/pool cache_sanity/corigin
Attempt to Create cached volume by combining the NON cache pool (fast) and origin (slow) volumes (w/ --yes for auto conversion)
lvconvert --yes --type cache --cachepool cache_sanity/pool cache_sanity/corigin
  WARNING: Converting logical volume cache_sanity/pool to pool's data volume.
  THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.)

Separating cache pool (lvconvert --splitcache) cache_sanity/pool from cache origin
Removing cache pool cache_sanity/pool
Removing cache origin volume cache_sanity/corigin
lvremove -f /dev/cache_sanity/corigin

Comment 6 errata-xmlrpc 2015-11-19 12:47:00 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-2147.html