Bug 1166873

Summary: LVM Thin: Ability to resize thinsnaps to something other than their origin
Product: Red Hat Enterprise Linux 7 Reporter: Jonathan Earl Brassow <jbrassow>
Component: lvm2Assignee: Zdenek Kabelac <zkabelac>
lvm2 sub component: Thin Provisioning QA Contact: cluster-qe <cluster-qe>
Status: CLOSED ERRATA Docs Contact:
Severity: unspecified    
Priority: unspecified CC: agk, cmarthal, heinzm, jbrassow, msnitzer, naesten, prajnoha, prockai, thornber, zkabelac
Version: 7.1   
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: lvm2-2.02.125-1.el7 Doc Type: Enhancement
Doc Text:
lvm2 has extend support for thin snapshot of external origins. Thin volumes now can be resized to any size.
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-19 12:45:52 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:
Bug Depends On:    
Bug Blocks: 1119323    

Description Jonathan Earl Brassow 2014-11-21 20:06:13 UTC
Add the ability to resize thinSnaps to something other than their origin's size.  If grown, it should be possible to have the extension return zeros.

Comment 1 Zdenek Kabelac 2014-12-05 15:18:11 UTC
This BZ has unclear description.

Thin snapshots are instantly created as 'unique' thin volumes - so basically once user make a snapshot - thin volume could be then independently resized.

The read content of new size is basically based on 'thin-pool' zeroing feature state.

You always read zeros from 'unprovisioned' chunks.

And you read either zeros from zeroed thin pool of 'chunk-garbage' from unzeroed thin-pool - depending on amount of written size on chunk provisioning.

Unlike with old 'snapshots' there is no limitation what user could do with thin snapshot.

Comment 2 Samuel Bronson 2015-02-27 18:21:47 UTC
(In reply to Zdenek Kabelac from comment #1)
> This BZ has unclear description.
> 
> Thin snapshots are instantly created as 'unique' thin volumes - so basically
> once user make a snapshot - thin volume could be then independently resized.

I suspect this is about resizing thin volumes that have external origins.

> The read content of new size is basically based on 'thin-pool' zeroing
> feature state.
> 
> You always read zeros from 'unprovisioned' chunks.

My understanding is that this was not the case with external origins until https://github.com/torvalds/linux/commit/e5aea7b49f2b1fd01f35ca7abeb76f5c56128a55

To actually make use of this change, someone would have to update the entry for the "external_origin_suspend" feature in lvm2/lib/thin/thin.c; right now it has a bogusly-high placeholder version number "9, 11", which should presumably be replaced with the "1, 13" from the kernel commit above.

(And lets not forget the case of extending thin volumes that had been shrunk to below the size of their external origins; iirc there's a comment about that somewhere in the lvm2 code ...)

Comment 6 Zdenek Kabelac 2015-06-19 19:12:44 UTC
Started to improve usage of thin volumes with external origin that are unaligned with thin-pool chunk size with this upstream patch series:

https://www.redhat.com/archives/lvm-devel/2015-June/msg00055.html

With this patch set user can take thin-snapshot of external origin volume size unrelated to thin-pool chunk size.

Such thin volume could be resized to any size.

Comment 9 errata-xmlrpc 2015-11-19 12:45:52 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