Bug 773507

Summary: [RFE] LVM support for thinly provisioned LVs (non-clustered)
Product: Red Hat Enterprise Linux 6 Reporter: Tom Coughlan <coughlan>
Component: lvm2Assignee: Zdenek Kabelac <zkabelac>
Status: CLOSED ERRATA QA Contact: Cluster QE <mspqa-list>
Severity: high Docs Contact:
Priority: high    
Version: 6.1CC: abaron, acathrow, agk, cmarthal, djuran, dwysocha, fsimonce, heinzm, iheim, jbrassow, mbroz, msnitzer, nperic, prajnoha, prockai, sct, snagar, ssaha, thornber, xiaoli, zkabelac
Target Milestone: betaKeywords: FutureFeature, TechPreview
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: lvm2-2.02.95-1.el6 Doc Type: Technology Preview
Doc Text:
LVM support for (non-clustered) thinly-provisioned LVs Logical Volumes (LVs) can now be thinly provisioned to manage a storage pool of free space to be allocated to an arbitrary number of devices when needed by applications. This allows creation of devices that can be bound to a thinly provisioned pool for late allocation when an application actually writes to the LV. The thinly-provisioned pool can be expanded dynamically if and when needed for cost-effective allocation of storage space. In Red Hat Enterprise Linux 6.3, this feature is introduced as a Technology Preview. You must have the device-mapper-persistent-data package installed to try out this feature. For more information, refer to the lvcreate man page.
Story Points: ---
Clone Of: 636058 Environment:
Last Closed: 2012-06-20 15:00:54 UTC Type: ---
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: 723018, 821384    
Bug Blocks: 655920, 749672, 756082, 773650, 773651, 773677, 773696    

Comment 3 Alasdair Kergon 2012-01-12 12:44:25 UTC
The thin provisioning device-mapper target is being included in the kernel via bug 723018 .

This bugzilla covers extensions to LVM2 to make use of that target to create thinly-provisioned logical volumes.

Comment 4 Zdenek Kabelac 2012-01-12 13:36:26 UTC
Here is the list of supported commands:


-- Creating thinpool of size 100MB:

lvcreate -T vg/thinpool -L100M    (--alloc anywhere   if just 1 PV is given)

(striping with -i/-I is supported for pool creation)
(see the lvcreate man page there for multiple ways how to express thinpool parameters i.e.
lvcreate --thinpool  thinpool  vg -L100M

Also note - tool currenly support creation of thinpool and thinvolume
using given thinpool by just one single commnand line.
(Specifying both  -L -V options at the same time).


-- Creating thin volume of size 1GB

lvcreate -V1G -T vg/thinpool -n thinvol


-- Creating snapshot of thinvol:

lvcreate -s vg/thinvol

-- Resizing thinpool:  (could be only extended)

lvextend  -LsizeM vg/thinpool
(lvextend --use-policies  vg/thinpool  - resize according to lvm.conf policy)
(lvreduce is not supported)

-- Resizing thin/snapshot:  (just like any other volume)

lvresize  -L+/-sizeM vg/thinvol 
(lvextend, lvreduce)

-- Renanimg thinpool:

lvrename vg/thinpool vg/newthin


-- Removing thinpool

lvremove vg/newthin    (gives queries - could be avoided with -ff)


-- Getting information about thin pool 

lvdisplay/lvs    (still in progress a bit)

-- De/Activating  thin volume

lvchange -an/-ay|-aey vg/thinvol     (activation is always exclusive!)


-- Dmeventd support

Thinpool volume with monitoring should automaticaly resize according
to its lvm.conf policy settings.


-- CLVMD support

Thinpool volumes are always activated in exclusive mode (running on 1 node only), and before they are transferred to another node, they need to be deactivated on the running node.


Unsupported - lvconvert

Comment 6 Zdenek Kabelac 2012-03-01 12:23:03 UTC
Supported commands from version 2.02.90 and later.

Comment 8 Nenad Peric 2012-03-20 13:22:56 UTC
lvm2-2.02.96-0.80.el6
kernel-2.6.32-251.el6
device-mapper-1.02.75-0.80.el6

The command for creating snapshots is not allowing a thinp snapshot to be created:

(08:11:32) [root@node01:/mnt]$ lvs
  LV      VG       Attr     LSize   Pool Origin Data%  Move Log Copy%  Convert
  lv_root VolGroup -wi-ao--   7.54g                                           
  lv_swap VolGroup -wi-ao--   1.97g                                           
  fatpool thin_vg  twi-aotz 152.00m               0.00                        


(08:09:31) [root@node01:/mnt]$ lvcreate -s thin_vg/fatpool
  Please specify either size or extents with snapshots.

As far as I have understood the man pages, the command above should work?
Or I misunderstood it. It is written in man pages for lvcreate:
     
     " Thin snapshot is created when the origin is a thin volume and the  size  is  not  specified. "

but if it is not specified lvcreate complains.. 

Another question is data_percent field. 
What does it actually show?

It says 0.0 even though LVM of 150MB is 97 MB full ... 

/dev/mapper/thin_vg-fatpool on /mnt type ext3 (rw)
(08:17:20) [root@node01:/mnt]$ df -h .
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/thin_vg-fatpool
                      148M   97M   44M  70% /mnt

Comment 9 Nenad Peric 2012-03-20 13:39:14 UTC
Ok by playing around the options I managed to create what should be a thin logical volume and its snapshot, but then man pages definitely need clarification. 

 fatpool  thin_vg  twi-a-tz 152.00m                   0.00                        
  lvol0    thin_vg  Vwi-aotz   1.00g new_thin         19.60                        
  lvol1    thin_vg  Vwi-a-tz   1.00g new_thin lvol0    0.00                        
  new_thin thin_vg  twi-a-tz 500.00m                  40.14    



Most of the options are stated as optional even though it is rather EITHER one OR the other or both.

Comment 10 Alasdair Kergon 2012-03-20 14:00:53 UTC
(In reply to comment #8)

> (08:09:31) [root@node01:/mnt]$ lvcreate -s thin_vg/fatpool

>      " Thin snapshot is created when the origin is a thin volume and the  size 
> is  not  specified. "

fatpool is not itself a thin volume - it's the pool of space out of which thin volumes are created.

> Another question is data_percent field. 
> What does it actually show?
> It says 0.0 even though LVM of 150MB is 97 MB full ... 
> /dev/mapper/thin_vg-fatpool on /mnt type ext3 (rw)
> (08:17:20) [root@node01:/mnt]$ df -h .
> Filesystem            Size  Used Avail Use% Mounted on
> /dev/mapper/thin_vg-fatpool
>                       148M   97M   44M  70% /mnt

Errr - you're not supposed to mount that!

(I'm not sure how we could stop you corrupting your system like that though.)

Comment 11 Zdenek Kabelac 2012-03-20 14:10:29 UTC
Hmm maybe just an idea - but how about wasting 1st data size block with something 'unmountable' for filesystems ?

i.e. 1st data block would have always give 'zero' and would not allocate space ?

Comment 12 Alasdair Kergon 2012-03-20 14:11:59 UTC
What documentation were you relying upon?  Just the lvcreate man page?

If so, I think it needs:
  more extensive examples - including showing mkfs on the thin vol
  a proper description of the thin provisioning/pool concepts

Comment 13 Alasdair Kergon 2012-03-20 14:14:36 UTC
Writing a signature to the pool is something we might need to consider.

Comment 15 Nenad Peric 2012-03-20 16:05:27 UTC
(In reply to comment #12)
> What documentation were you relying upon?  Just the lvcreate man page?
> 
> If so, I think it needs:
>   more extensive examples - including showing mkfs on the thin vol
>   a proper description of the thin provisioning/pool concepts

Yes, just the lvcreate man page. 

I will work a bit on the wording of the manual pages to try to come up with something which is unequivocal regarding the main creating option (-T), since that is what I sort of misunderstood, although now that I know what it says I get it. But as a first time read which could be the case for someone it can cause confusion. I'll attach here a patch when I think of something.

Comment 17 Nenad Peric 2012-03-21 13:54:22 UTC
I've discussed some variations of man page part for thinp with Nate and we came up with a suggestion on how to make things much clearer in MAN of lvcreate:
It will make the whole thinp idea more coherent and will avoid "chicken and the egg" confusion some people who dive right in might experience. 


-T, --thin, --thinpool ThinPoolLogicalVolume{Name|Path}
    Creates  thin  pool or thin logical volume or both. See THIN PROVISIONING.
 
 
 
 
...

THIN PROVISIONING
 
Thin provisioning allows for the creation of logical volumes larger than available extents.  First create a pool then create a volume in the pool.
 
To create a thin pool ...
    Options, examples, interaction with other LVM options
 
To create a logical volume in the thin pool...
    Options, examples, interaction with other LVM options 

To create a thin logical volume and pool at the same time... 
    Options, examples, interaction with other LVM options

Comment 18 Tom Coughlan 2012-03-28 21:21:35 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Please add this a Tech. Preview in 6.3.

Logical Volumes (LVs) can now be thinly provisioned to manage a storage pool of free space to be allocated to an arbitrary number of devices when needed by applications. This allows creation of devices that can be bound to a thinly provisioned pool for late allocation when an application actually writes. The thinly provisioned pool can be grown dynamically if and when needed for cost-effective allocation of storage space.

This feature is for use on a single-system. It is not available for multi-system access in cluster environments.

Refer to "man lvcreate" for instructions.

Comment 20 Martin Prpič 2012-04-03 13:15:43 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1,7 +1,7 @@
-Please add this a Tech. Preview in 6.3.
+Title: LVM support for (non-clustered) thinp snapshots
 
-Logical Volumes (LVs) can now be thinly provisioned to manage a storage pool of free space to be allocated to an arbitrary number of devices when needed by applications. This allows creation of devices that can be bound to a thinly provisioned pool for late allocation when an application actually writes. The thinly provisioned pool can be grown dynamically if and when needed for cost-effective allocation of storage space.
+A new implementation of LVM copy-on-write (cow) snapshots is available in Red Hat Enterprise Linux 6.3 as a Technology Preview. The main advantage of this implementation, compared to the previous implementation of snapshots, is that it allows many virtual devices to be stored on the same data volume. This implementation also provides support for arbitrary depth of recursive snapshots (snapshots of snapshots of snapshots …).
 
 This feature is for use on a single-system. It is not available for multi-system access in cluster environments.
 
-Refer to "man lvcreate" for instructions.+For more information, refer to documentation of the -s, --snapshot option in the lvcreate man page.

Comment 22 Alasdair Kergon 2012-05-14 13:11:26 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1,7 +1 @@
-Title: LVM support for (non-clustered) thinp snapshots
+[TEXT ACCIDENTALLY LOST?]-
-A new implementation of LVM copy-on-write (cow) snapshots is available in Red Hat Enterprise Linux 6.3 as a Technology Preview. The main advantage of this implementation, compared to the previous implementation of snapshots, is that it allows many virtual devices to be stored on the same data volume. This implementation also provides support for arbitrary depth of recursive snapshots (snapshots of snapshots of snapshots …).
-
-This feature is for use on a single-system. It is not available for multi-system access in cluster environments.
-
-For more information, refer to documentation of the -s, --snapshot option in the lvcreate man page.

Comment 23 Alasdair Kergon 2012-05-14 13:24:33 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1 +1,13 @@
-[TEXT ACCIDENTALLY LOST?]+[OLD TEXT REINSTATED, NEEDS EDITING]
+
+Please add this a Tech. Preview in 6.3.
+
+Logical Volumes (LVs) can now be thinly provisioned to manage a storage pool
+of free space to be allocated to an arbitrary number of devices when needed by
+applications. This allows creation of devices that can be bound to a thinly
+provisioned pool for late allocation when an application actually writes. The
+thinly provisioned pool can be grown dynamically if and when needed for
+cost-effective allocation of storage space.
+
+Refer to "man lvcreate" for instructions.+For more information, refer to
+documentation of the -s, --snapshot option in the lvcreate man page.

Comment 24 Alasdair Kergon 2012-05-14 13:25:41 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -9,5 +9,4 @@
 thinly provisioned pool can be grown dynamically if and when needed for
 cost-effective allocation of storage space.
 
-Refer to "man lvcreate" for instructions.+For more information, refer to
+Refer to "man lvcreate" for instructions.-documentation of the -s, --snapshot option in the lvcreate man page.

Comment 26 Martin Prpič 2012-05-15 08:30:04 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1,12 +1,3 @@
-[OLD TEXT REINSTATED, NEEDS EDITING]
+LVM support for (non-clustered) thinly-provisioned LVs
 
-Please add this a Tech. Preview in 6.3.
+Logical Volumes (LVs) can now be thinly provisioned to manage a storage pool of free space to be allocated to an arbitrary number of devices when needed by applications. This allows creation of devices that can be bound to a thinly provisioned pool for late allocation when an application actually writes to the pool. The thinly-provisioned pool can be expanded dynamically if and when needed for cost-effective allocation of storage space. For more information, refer to the lvcreate man page.-
-Logical Volumes (LVs) can now be thinly provisioned to manage a storage pool
-of free space to be allocated to an arbitrary number of devices when needed by
-applications. This allows creation of devices that can be bound to a thinly
-provisioned pool for late allocation when an application actually writes. The
-thinly provisioned pool can be grown dynamically if and when needed for
-cost-effective allocation of storage space.
-
-Refer to "man lvcreate" for instructions.

Comment 27 Martin Prpič 2012-05-15 08:32:06 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1,3 +1,3 @@
 LVM support for (non-clustered) thinly-provisioned LVs
 
-Logical Volumes (LVs) can now be thinly provisioned to manage a storage pool of free space to be allocated to an arbitrary number of devices when needed by applications. This allows creation of devices that can be bound to a thinly provisioned pool for late allocation when an application actually writes to the pool. The thinly-provisioned pool can be expanded dynamically if and when needed for cost-effective allocation of storage space. For more information, refer to the lvcreate man page.+Logical Volumes (LVs) can now be thinly provisioned to manage a storage pool of free space to be allocated to an arbitrary number of devices when needed by applications. This allows creation of devices that can be bound to a thinly provisioned pool for late allocation when an application actually writes to the pool. The thinly-provisioned pool can be expanded dynamically if and when needed for cost-effective allocation of storage space. In Red Hat Enterprise Linux 6.3, this feature is introduced as a Technology Preview. For more information, refer to the lvcreate man page.

Comment 28 Peter Rajnoha 2012-05-15 12:38:20 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1,3 +1,3 @@
 LVM support for (non-clustered) thinly-provisioned LVs
 
-Logical Volumes (LVs) can now be thinly provisioned to manage a storage pool of free space to be allocated to an arbitrary number of devices when needed by applications. This allows creation of devices that can be bound to a thinly provisioned pool for late allocation when an application actually writes to the pool. The thinly-provisioned pool can be expanded dynamically if and when needed for cost-effective allocation of storage space. In Red Hat Enterprise Linux 6.3, this feature is introduced as a Technology Preview. For more information, refer to the lvcreate man page.+Logical Volumes (LVs) can now be thinly provisioned to manage a storage pool of free space to be allocated to an arbitrary number of devices when needed by applications. This allows creation of devices that can be bound to a thinly provisioned pool for late allocation when an application actually writes to the LV. The thinly-provisioned pool can be expanded dynamically if and when needed for cost-effective allocation of storage space. In Red Hat Enterprise Linux 6.3, this feature is introduced as a Technology Preview. For more information, refer to the lvcreate man page.

Comment 29 Nenad Peric 2012-05-15 14:41:13 UTC
Would it be please possible to add a line to TECH PREVIEW message for people who create a thin LV that a device-mapper-persistent-data package is needed?

Something like:

WARNING: Thin types are considered Tech Preview.
  Make sure you have device-mapper-persistent-data installed. 
  For more information on Tech Preview features, visit:
  https://access.redhat.com/support/offerings/techpreview/


Or in the man pages of lvcreate in the section for the thin provisioned LVs, as well. 

This package is needed for the thinp to work properly, so if someone does decide to test out the Tech Preview, they should be aware of it and not think they found a bug just because they are missing a package.

Comment 30 Martin Prpič 2012-05-21 13:40:02 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1,3 +1,3 @@
 LVM support for (non-clustered) thinly-provisioned LVs
 
-Logical Volumes (LVs) can now be thinly provisioned to manage a storage pool of free space to be allocated to an arbitrary number of devices when needed by applications. This allows creation of devices that can be bound to a thinly provisioned pool for late allocation when an application actually writes to the LV. The thinly-provisioned pool can be expanded dynamically if and when needed for cost-effective allocation of storage space. In Red Hat Enterprise Linux 6.3, this feature is introduced as a Technology Preview. For more information, refer to the lvcreate man page.+Logical Volumes (LVs) can now be thinly provisioned to manage a storage pool of free space to be allocated to an arbitrary number of devices when needed by applications. This allows creation of devices that can be bound to a thinly provisioned pool for late allocation when an application actually writes to the LV. The thinly-provisioned pool can be expanded dynamically if and when needed for cost-effective allocation of storage space. In Red Hat Enterprise Linux 6.3, this feature is introduced as a Technology Preview. You must have the device-mapper-persistent-data package installed to try out this feature. For more information, refer to the lvcreate man page.

Comment 35 errata-xmlrpc 2012-06-20 15:00: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, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2012-0962.html