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 1967744

Summary: Unable to activate snapshots of external origin thin volumes
Product: Red Hat Enterprise Linux 8 Reporter: Chris Mackowski <cmackows>
Component: lvm2Assignee: Zdenek Kabelac <zkabelac>
lvm2 sub component: Snapshots QA Contact: cluster-qe <cluster-qe>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: unspecified CC: agk, cmarthal, heinzm, jbrassow, mcsontos, msnitzer, prajnoha, zkabelac
Version: 8.5Flags: pm-rhel: mirror+
Target Milestone: beta   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: lvm2-2.03.12-6.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-11-09 19:45:54 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 Chris Mackowski 2021-06-03 18:52:59 UTC
While attempting to create snapshot from thin vol, lvcreate fails when --setactivationskip set to no.

# snapshot attempt with activation skip set to no
	[root@hayes-01 ~]# lvcreate --yes -k n -s /dev/snapper_thinp/origin -n manipulation2
	 WARNING: Sum of all thin volume sizes (2.00 GiB) exceeds the size of thin pool snapper_thinp/POOL (1.00 GiB).
	 WARNING: You have not turned on protection against thin pools running out of space.
	 WARNING: Set activation/thin_pool_autoextend_threshold below 100 to trigger automatic extension of thin pools before they get full.
	 Activation of logical volume snapper_thinp/manipulation2 is prohibited while logical volume snapper_thinp/CPOOL_cpool_cmeta is active.
	 Failed to activate thin manipulation2.

# snapshot attempt with activation skip set to yes
	[root@hayes-01 ~]# lvcreate --yes -k y -s /dev/snapper_thinp/origin -n manipulation2
	 WARNING: Sum of all thin volume sizes (2.00 GiB) exceeds the size of thin pool snapper_thinp/POOL (1.00 GiB).
	 WARNING: You have not turned on protection against thin pools running out of space.
	 WARNING: Set activation/thin_pool_autoextend_threshold below 100 to trigger automatic extension of thin pools before they get full.
	 Logical volume "manipulation2" created.

Comment 2 Zdenek Kabelac 2021-06-16 17:18:41 UTC
(In reply to Chris Mackowski from comment #0)
> While attempting to create snapshot from thin vol, lvcreate fails when
> --setactivationskip set to no.
> 
> # snapshot attempt with activation skip set to no
> 	[root@hayes-01 ~]# lvcreate --yes -k n -s /dev/snapper_thinp/origin -n
> manipulation2
> 	 WARNING: Sum of all thin volume sizes (2.00 GiB) exceeds the size of thin
> pool snapper_thinp/POOL (1.00 GiB).
> 	 WARNING: You have not turned on protection against thin pools running out
> of space.
> 	 WARNING: Set activation/thin_pool_autoextend_threshold below 100 to
> trigger automatic extension of thin pools before they get full.
> 	 Activation of logical volume snapper_thinp/manipulation2 is prohibited
> while logical volume snapper_thinp/CPOOL_cpool_cmeta is active.


Normally you should have thin-pool either active or inactive - but in this
case lvm2 notices there is active _cmeta device - so it looks like left-over from
some failing activation?

Normally the setskipactivation should work - unless I'm missing some detail.

So please provide full -vvvv trace of your failure.

Also the check your 'dmsetup table' if there aren't some dangling devices from some failure.
Eventually remove these devices with  'dmsetup remove_all'  (before - it removes ALL devices that are not open!)
and retry your lvm2 command.

Comment 9 Zdenek Kabelac 2021-07-14 10:58:24 UTC
Fixed upstream with this fix for active external origin component:

https://listman.redhat.com/archives/lvm-devel/2021-July/msg00005.html

Comment 10 Zdenek Kabelac 2021-07-16 12:40:39 UTC
Seems I've got wrong buffer into mouse cut&paste:


https://listman.redhat.com/archives/lvm-devel/2021-July/msg00017.html


Also provides testing example.

Comment 18 Corey Marthaler 2021-08-30 17:45:14 UTC
kernel-4.18.0-339.el8    BUILT: Fri Aug 27 09:59:28 CDT 2021
lvm2-2.03.12-8.el8    BUILT: Thu Aug 26 15:49:15 CDT 2021
lvm2-libs-2.03.12-8.el8    BUILT: Thu Aug 26 15:49:15 CDT 2021


[root@hayes-01 ~]# lvs -a -o +devices,segtype
  LV                  VG            Attr       LSize Pool          Origin            Data%  Meta%  Move Log Cpy%Sync Convert Devices              Type      
  [CPOOL_cpool]       snapper_thinp Cwi---C--- 1.00g                                 0.00   2.93            0.00             CPOOL_cpool_cdata(0) cache-pool
  [CPOOL_cpool_cdata] snapper_thinp Cwi-ao---- 1.00g                                                                         /dev/sdc1(0)         linear    
  [CPOOL_cpool_cmeta] snapper_thinp ewi-ao---- 8.00m                                                                         /dev/sdd1(0)         linear    
  POOL                snapper_thinp twi-aot--- 1.00g                                 0.00   11.04                            POOL_tdata(0)        thin-pool 
  [POOL_tdata]        snapper_thinp Twi-ao---- 1.00g                                                                         /dev/sdb1(1)         linear    
  [POOL_tmeta]        snapper_thinp ewi-ao---- 4.00m                                                                         /dev/sdk1(0)         linear    
  extorigin           snapper_thinp ori---C--- 1.00g [CPOOL_cpool] [extorigin_corig] 0.00   2.93            0.00             extorigin_corig(0)   cache     
  [extorigin_corig]   snapper_thinp owi-aoC--- 1.00g                                                                         /dev/sdb1(258)       linear    
  [lvol0_pmspare]     snapper_thinp ewi------- 8.00m                                                                         /dev/sdb1(0)         linear    
  [lvol0_pmspare]     snapper_thinp ewi------- 8.00m                                                                         /dev/sdb1(257)       linear    
  origin              snapper_thinp Vwi-a-t--- 1.00g POOL          extorigin         0.00                                                         thin      

[root@hayes-01 ~]# lvcreate --yes -k n -s /dev/snapper_thinp/origin -n manipulation2
  WARNING: Sum of all thin volume sizes (2.00 GiB) exceeds the size of thin pool snapper_thinp/POOL (1.00 GiB).
  WARNING: You have not turned on protection against thin pools running out of space.
  WARNING: Set activation/thin_pool_autoextend_threshold below 100 to trigger automatic extension of thin pools before they get full.
  Logical volume "manipulation2" created.
[root@hayes-01 ~]# lvcreate --yes -k y -s /dev/snapper_thinp/origin -n manipulation3
  WARNING: Sum of all thin volume sizes (3.00 GiB) exceeds the size of thin pool snapper_thinp/POOL (1.00 GiB).
  WARNING: You have not turned on protection against thin pools running out of space.
  WARNING: Set activation/thin_pool_autoextend_threshold below 100 to trigger automatic extension of thin pools before they get full.
  Logical volume "manipulation3" created.
[root@hayes-01 ~]# lvchange -ay -kn snapper_thinp/manipulation2
  Logical volume snapper_thinp/manipulation2 changed.
  WARNING: Combining activation change with other commands is not advised.
[root@hayes-01 ~]# lvchange -ay -kn snapper_thinp/manipulation3
  Logical volume snapper_thinp/manipulation3 changed.
  WARNING: Combining activation change with other commands is not advised.

Comment 21 errata-xmlrpc 2021-11-09 19:45:54 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 (lvm2 bug fix and enhancement update), 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-2021:4431