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 1248796

Summary: --select fails to grab cache origin volume when that cache origin volume is a thin pool
Product: Red Hat Enterprise Linux 7 Reporter: Corey Marthaler <cmarthal>
Component: lvm2Assignee: Peter Rajnoha <prajnoha>
lvm2 sub component: Displaying and Reporting QA Contact: cluster-qe <cluster-qe>
Status: CLOSED NOTABUG Docs Contact:
Severity: low    
Priority: low CC: agk, heinzm, jbrassow, msnitzer, prajnoha, prockai, zkabelac
Version: 7.2Keywords: Triaged
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-07-31 09:15:59 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:

Description Corey Marthaler 2015-07-30 20:52:05 UTC
Description of problem:
This is a pretty low priority issue, but I came across it when running through the matrix of volumes that can be cached.


[root@host-110 ~]# vgcreate vg /dev/sd[abcdefgh]1
  Volume group "vg" successfully created

[root@host-110 ~]# lvcreate -n pool -L 500M vg /dev/sdf1
  Logical volume "pool" created.
[root@host-110 ~]# lvcreate -n meta -L 50M vg /dev/sdg1
  Rounding up size to full physical extent 52.00 MiB
  Logical volume "meta" created.
[root@host-110 ~]# lvconvert --yes --type cache-pool --poolmetadata vg/meta vg/pool
  WARNING: Converting logical volume vg/pool and vg/meta to pool's data and metadata volumes.
  THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.)
  Converted vg/pool to cache pool.

[root@host-110 ~]# lvs -a -o +devices
  LV              VG  Attr       LSize   Pool Origin Data%  Meta% Cpy%Sync Devices
  [lvol0_pmspare] vg  ewi-------  52.00m                                   /dev/sda1(0)
  pool            vg  Cwi---C--- 500.00m                                   pool_cdata(0)
  [pool_cdata]    vg  Cwi------- 500.00m                                   /dev/sdf1(0)
  [pool_cmeta]    vg  ewi-------  52.00m                                   /dev/sdg1(0)

[root@host-110 ~]# lvcreate --thinpool corigin -L 500M --poolmetadatasize 50M vg /dev/sdh1
  Rounding up size to full physical extent 52.00 MiB
  Logical volume "corigin" created.

[root@host-110 ~]# lvconvert --yes --type cache --cachepool vg/pool vg/corigin
  Logical volume vg/corigin_tdata is now cached.
[root@host-110 ~]# lvs -a -o +devices
  LV                    VG  Attr       LSize   Pool   Origin                Data%  Meta% Cpy%Sync Devices
  corigin               vg  twi-a-tz-- 500.00m                              0.00   0.07           corigin_tdata(0)
  [corigin_tdata]       vg  Cwi-aoC--- 500.00m [pool] [corigin_tdata_corig] 0.00   0.17  100.00   corigin_tdata_corig(0)
  [corigin_tdata_corig] vg  owi-aoC--- 500.00m                                                    /dev/sdh1(0)
  [corigin_tmeta]       vg  ewi-ao----  52.00m                                                    /dev/sdh1(125)
  [lvol0_pmspare]       vg  ewi-------  52.00m                                                    /dev/sda1(0)
  [pool]                vg  Cwi---C--- 500.00m                              0.00   0.17  100.00   pool_cdata(0)
  [pool_cdata]          vg  Cwi-ao---- 500.00m                                                    /dev/sdf1(0)
  [pool_cmeta]          vg  ewi-ao----  52.00m                                                    /dev/sdg1(0)
[root@host-110 ~]# lvs -o lv_name --select 'pool_lv=pool'
[root@host-110 ~]# 



Version-Release number of selected component (if applicable):
3.10.0-296.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.4-1.el7    BUILT: Fri Jul 17 08:56:22 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 Peter Rajnoha 2015-07-31 06:17:08 UTC
That's because the pool lv is in this case marked as internal LV [pool] (with the brackets) - I've got a patch which is a part of another patchset on my devel branch that deals with this (though for string list types, not for string type alone, but I'll do that for string types too) and when doing the comparison, it ignores the [] decoration (or any other possible registered decoration).

Comment 2 Peter Rajnoha 2015-07-31 08:50:35 UTC
(In reply to Corey Marthaler from comment #0)
> [root@host-110 ~]# lvs -o lv_name --select 'pool_lv=pool'
> [root@host-110 ~]# 

I've checked this - actually we do report "[blabla]" on output, but still the raw value is "blabla" which makes it selectable just fine (as raw values are used for selection).

You just missed the "-a" for your lvs - the selection is done on the list that would be reported normally and without "-a" the [corigin_tdata] is hidden. 

# lvs -o lv_name -S 'pool_lv=pool'
(nothing)

#lvs -a -o lv_name -S 'pool_lv=pool'
  LV             
  [corigin_tdata]