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 1158702

Summary: Internal errors when attempting to use thin virt volume as cache origin volume
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 <mspqa-list>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: unspecified CC: agk, heinzm, jbrassow, msnitzer, prajnoha, zkabelac
Version: 7.1   
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: lvm2-2.02.113-1.el7 Doc Type: Bug Fix
Doc Text:
Improved validation of cache lvconvert command now properly disallows usage of internal pool's data and metadata volumes.
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-03-05 13:10: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:
Attachments:
Description Flags
-vvvv of the lvconvert none

Description Corey Marthaler 2014-10-29 22:00:56 UTC
Description of problem:
This is another check added onto what was already tried in bug 1131938.

[root@host-110 ~]# vgs
  VG            #PV #LV #SN Attr   VSize  VFree 
  cache_sanity    4   0   0 wz--n- 59.98g 59.98g
  rhel_host-110   1   2   0 wz--n-  7.51g 40.00m
[root@host-110 ~]# pvscan
  PV /dev/sda1   VG cache_sanity    lvm2 [15.00 GiB / 15.00 GiB free]
  PV /dev/sdb1   VG cache_sanity    lvm2 [15.00 GiB / 15.00 GiB free]
  PV /dev/sdd1   VG cache_sanity    lvm2 [15.00 GiB / 15.00 GiB free]
  PV /dev/sdc1   VG cache_sanity    lvm2 [15.00 GiB / 15.00 GiB free]
  PV /dev/vda2   VG rhel_host-110   lvm2 [7.51 GiB / 40.00 MiB free]
  Total: 5 [67.49 GiB] / in use: 5 [67.49 GiB] / in no VG: 0 [0   ]

[root@host-110 ~]# lvcreate --thinpool to_cache_origin -L 500M --poolmetadatasize 100M cache_sanity /dev/sdd1
  Logical volume "lvol0" created
  Logical volume "to_cache_origin" created

[root@host-110 ~]# lvcreate --virtualsize 100M -T cache_sanity/to_cache_origin -n to_cache_origin_virt
  Logical volume "to_cache_origin_virt" created

[root@host-110 ~]# lvcreate -n to_cache_pool -L 500M cache_sanity /dev/sda1
  Logical volume "to_cache_pool" created

[root@host-110 ~]# lvcreate -n to_cache_pool_meta -L 500M cache_sanity /dev/sda1
  Logical volume "to_cache_pool_meta" created

[root@host-110 ~]# lvconvert --yes --type cache-pool --poolmetadata cache_sanity/to_cache_pool_meta cache_sanity/to_cache_pool
  WARNING: Converting logical volume cache_sanity/to_cache_pool and cache_sanity/to_cache_pool_meta to pool's data and metadata volumes.
  THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.)
  Converted cache_sanity/to_cache_pool to cache pool.

[root@host-110 ~]# lvs -a -o +devices
  LV                      Attr       LSize   Pool            Origin Data% Meta% Devices                 
  [lvol0_pmspare]         ewi------- 500.00m                                    /dev/sdd1(0)
  [lvol0_pmspare]         ewi------- 500.00m                                    /dev/sdd1(175)
  to_cache_origin         twi-a-tz-- 500.00m                        0.00  0.04  to_cache_origin_tdata(0)
  [to_cache_origin_tdata] Twi-ao---- 500.00m                                    /dev/sdd1(25)
  [to_cache_origin_tmeta] ewi-ao---- 100.00m                                    /dev/sdd1(150)
  to_cache_origin_virt    Vwi-a-tz-- 100.00m to_cache_origin        0.00                                
  to_cache_pool           Cwi---C--- 500.00m                                    to_cache_pool_cdata(0)
  [to_cache_pool_cdata]   Cwi------- 500.00m                                    /dev/sda1(0)
  [to_cache_pool_cmeta]   ewi------- 500.00m                                    /dev/sda1(125)          

[root@host-110 ~]# lvconvert --yes --type cache --cachepool cache_sanity/to_cache_pool cache_sanity/to_cache_origin_virt
  LV to_cache_origin_virt is thin volume without first thin volume segment.
  Internal error: LV segments corrupted in to_cache_origin_virt.
  LV to_cache_origin_virt_corig is missing thin volume flag for segment 1
  Internal error: LV segments corrupted in to_cache_origin_virt_corig.


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

lvm2-2.02.111-1.el7    BUILT: Mon Sep 29 09:18:07 CDT 2014
lvm2-libs-2.02.111-1.el7    BUILT: Mon Sep 29 09:18:07 CDT 2014
lvm2-cluster-2.02.111-1.el7    BUILT: Mon Sep 29 09:18:07 CDT 2014
device-mapper-1.02.90-1.el7    BUILT: Mon Sep 29 09:18:07 CDT 2014
device-mapper-libs-1.02.90-1.el7    BUILT: Mon Sep 29 09:18:07 CDT 2014
device-mapper-event-1.02.90-1.el7    BUILT: Mon Sep 29 09:18:07 CDT 2014
device-mapper-event-libs-1.02.90-1.el7    BUILT: Mon Sep 29 09:18:07 CDT 2014
device-mapper-persistent-data-0.3.2-1.el7    BUILT: Thu Apr  3 09:58:51 CDT 2014
cmirror-2.02.111-1.el7    BUILT: Mon Sep 29 09:18:07 CDT 2014

Comment 1 Corey Marthaler 2014-10-29 22:02:19 UTC
Created attachment 951916 [details]
-vvvv of the lvconvert

Comment 3 Jonathan Earl Brassow 2014-11-11 15:06:56 UTC
We should disallow any cache sub-LVs from being anything other than linear, stripe, RAID.  In this case, the origin is a thinLV.

Comment 4 Corey Marthaler 2014-11-20 19:48:01 UTC
So same thing for attempting to cache a thin pool origin volume?

[root@host-113 ~]# lvs -a -o +devices
  LV                  Attr       LSize   Pool Origin Data%  Meta% Cpy%Sync Devices
  data_linear         Cwi---C--- 500.00m                                   data_linear_cdata(0)
  [data_linear_cdata] Cwi------- 500.00m                                   /dev/sdb1(0)
  [data_linear_cmeta] ewi------- 500.00m                                   /dev/sdd1(0)
  [lvol0_pmspare]     ewi------- 500.00m                                   /dev/sda1(300)
  origin_thin         twi-a-tz-- 500.00m             0.00   0.04           origin_thin_tdata(0)
  [origin_thin_tdata] Twi-ao---- 500.00m                                   /dev/sda1(150)
  [origin_thin_tmeta] ewi-ao---- 100.00m                                   /dev/sda1(275)

[root@host-113 ~]# lvconvert --yes --type cache --cachepool cache_sanity/data_linear cache_sanity/origin_thin
  Logical volume cache_sanity/origin_thin_tdata is now cached.

[root@host-113 ~]# lvs -a -o +devices
  LV                        Attr       LSize   Pool          Origin                    Data%  Meta% Cpy%Sync Devices
  [data_linear]             Cwi---C--- 500.00m                                         0.00   0.02  100.00   data_linear_cdata(0)
  [data_linear_cdata]       Cwi-ao---- 500.00m                                                               /dev/sdb1(0)
  [data_linear_cmeta]       ewi-ao---- 500.00m                                                               /dev/sdd1(0)
  [lvol0_pmspare]           ewi------- 500.00m                                                               /dev/sda1(300)
  origin_thin               twi-a-tz-- 500.00m                                         0.00   0.04           origin_thin_tdata(0)
  [origin_thin_tdata]       Cwi-aoC--- 500.00m [data_linear] [origin_thin_tdata_corig] 0.00   0.02  100.00   origin_thin_tdata_corig(0)
  [origin_thin_tdata_corig] owi-aoC--- 500.00m                                                               /dev/sda1(150)
  [origin_thin_tmeta]       ewi-ao---- 100.00m                                                               /dev/sda1(275)

Comment 5 Zdenek Kabelac 2014-11-26 18:10:35 UTC
We target to support  thin-pool  data volume to be cached.
(So far it's the only exception where cached volume is not a top-level LV).

So it's correct the thin_tdata get cache - this is expected however it's not yet adviced to be used.  We do not yet support 'resize' of such volume - it needs to be uncached before resize  (See Bug: #1153362)

All other variants should fail with >=2.02.112.

i.e.:


# lvs -a
  LV                  VG   Attr       LSize  Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  data_linear         vg   Cwi---C--- 10,00m                                                    
  [data_linear_cdata] vg   Cwi------- 10,00m                                                    
  [data_linear_cmeta] vg   ewi-------  4,03m                                                    
  [lvol0_pmspare]     vg   ewi-------  4,03m                                                    
  origin_thin         vg   twi-a-tz-- 20,00m             0,00   1,76                            
  [origin_thin_tdata] vg   Twi-ao---- 20,00m                                                    
  [origin_thin_tmeta] vg   ewi-ao----  2,00m                              


# lvconvert -y --type cache --cachepool vg/data_linear_cmeta vg/origin_thin
  Names including "_cmeta" are reserved. Please choose a different LV name.
  Run `lvconvert --help' for more information.

# lvconvert -y --type cache --cachepool vg/origin_thin_tdata vg/origin_thin
  Names including "_tdata" are reserved. Please choose a different LV name.
  Run `lvconvert --help' for more information.

# lvconvert -y --type cache --cachepool vg/data_linear vg/origin_thin_tmeta
  Can't convert internal LV vg/origin_thin_tmeta.

# lvconvert -y --type cache --cachepool vg/data_linear vg/data_linear_cdata
  Names including "_cdata" are reserved. Please choose a different LV name.
  Run `lvconvert --help' for more information.

# lvconvert -y --type cache --cachepool vg/data_linear vg/data_linear_cmeta
  Names including "_cmeta" are reserved. Please choose a different LV name.
  Run `lvconvert --help' for more information.

Comment 7 Corey Marthaler 2014-12-02 20:36:39 UTC
Marking verified in the latest rpms.

3.10.0-206.el7.x86_64
lvm2-2.02.114-2.el7    BUILT: Mon Dec  1 10:57:14 CST 2014
lvm2-libs-2.02.114-2.el7    BUILT: Mon Dec  1 10:57:14 CST 2014
lvm2-cluster-2.02.114-2.el7    BUILT: Mon Dec  1 10:57:14 CST 2014
device-mapper-1.02.92-2.el7    BUILT: Mon Dec  1 10:57:14 CST 2014
device-mapper-libs-1.02.92-2.el7    BUILT: Mon Dec  1 10:57:14 CST 2014
device-mapper-event-1.02.92-2.el7    BUILT: Mon Dec  1 10:57:14 CST 2014
device-mapper-event-libs-1.02.92-2.el7    BUILT: Mon Dec  1 10:57:14 CST 2014
device-mapper-persistent-data-0.4.1-2.el7    BUILT: Wed Nov 12 12:39:46 CST 2014
cmirror-2.02.114-2.el7    BUILT: Mon Dec  1 10:57:14 CST 2014



SCENARIO - [thin_virts_to_cache_conversion]
Create thin virtual volumes and attempt to build different cache volumes with them
lvcreate --thinpool to_cache -L 500M --poolmetadatasize 100M cache_sanity
        lvcreate -L 100M  -n originl cache_sanity
        lvcreate --virtualsize 100M -T cache_sanity/to_cache -n originv
        lvcreate -L 100M  -n pooll cache_sanity
        lvcreate --virtualsize 100M -T cache_sanity/to_cache -n poolv
        lvcreate -L 100M  -n metal cache_sanity
        lvcreate --virtualsize 100M -T cache_sanity/to_cache -n metav

Check 1: Attempt to create cache pool volume by combining poolv (data) and metav (meta) volume
lvconvert --yes --type cache-pool --poolmetadata cache_sanity/metav cache_sanity/poolv
  Pool data LV cache_sanity/poolv is of an unsupported type.

Check 2: Attempt to create cache pool volume by combining poolv (data) and metal (meta) volume
lvconvert --yes --type cache-pool --poolmetadata cache_sanity/metal cache_sanity/poolv
  Pool data LV cache_sanity/poolv is of an unsupported type.

Check 3: Attempt to create cache pool volume by combining pooll (data) and metav (meta) volume
lvconvert --yes --type cache-pool --poolmetadata cache_sanity/metav cache_sanity/pooll
  Pool metadata LV cache_sanity/metav is of an unsupported type.

Check 4: Attempt to create cache pool volume by combining pooll (data) and metal (meta) volume
lvconvert --yes --type cache-pool --poolmetadata cache_sanity/metal cache_sanity/pooll
  WARNING: Converting logical volume cache_sanity/pooll and cache_sanity/metal to pool's data and metadata volumes.
  THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.)

Attempt to create cached volume by combining the cache pool and thin virt origin volumes
lvconvert --yes --type cache --cachepool cache_sanity/pooll cache_sanity/originv
  Cache is not supported with thin segment type of the original logical volume cache_sanity/originv.

Comment 9 errata-xmlrpc 2015-03-05 13:10: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