Bug 814737 - Extend lvcreate to take thin snapshots of existing non-thinly-provisioned LVs
Summary: Extend lvcreate to take thin snapshots of existing non-thinly-provisioned LVs
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: lvm2
Version: 6.4
Hardware: Unspecified
OS: Linux
Target Milestone: rc
: 6.4
Assignee: Zdenek Kabelac
QA Contact: Cluster QE
Depends On:
TreeView+ depends on / blocked
Reported: 2012-04-20 15:00 UTC by Alasdair Kergon
Modified: 2013-11-21 23:16 UTC (History)
13 users (show)

Fixed In Version: lvm2-2.02.100-1.el6
Doc Type: Enhancement
Doc Text:
Feature: Lvm2 has been extended with support for creation of thin snapshot of some existing non-thinly-provisioned LV. Reason: Thin-pool can be now used for snapshots of non-thin volumes with all the performance gains from thin pool target compared with traditional snapshot target. Result (if any): Original read-only inactive non-thinly-provisioned volume is converted into external origin for thin snapshot volume and stays unmodified and could be even used for multiple snapshots. Thin volume could be than used for any further modification of device instead. Note: current lvm2 version doesn't support merge feature, so unlike with older lvm2 snapshots, updated device cannot be merged back into its origin device.
Clone Of:
Last Closed: 2013-11-21 23:16:14 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:1704 0 normal SHIPPED_LIVE lvm2 bug fix and enhancement update 2013-11-20 21:52:01 UTC

Description Alasdair Kergon 2012-04-20 15:00:54 UTC
Given an existing LV, extend lvcreate to "wrap" the LV with a snapshot in a (new or existing) thin pool.

Using this method, the data remains in situ.

Consider the options:  read-only vs. read-write; data remains in separate 'external' LV vs. old LV becomes part of pool.

Comment 1 Alasdair Kergon 2012-06-19 14:51:57 UTC
See also part of this thread:

Comment 2 RHEL Program Management 2012-07-10 06:07:47 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 3 RHEL Program Management 2012-07-10 23:57:03 UTC
This request was erroneously removed from consideration in Red Hat Enterprise Linux 6.4, which is currently under development.  This request will be evaluated for inclusion in Red Hat Enterprise Linux 6.4.

Comment 4 Corey Marthaler 2012-07-26 19:26:33 UTC
Adding QA ack for 6.4.

Devel will need to provide unit testing results however before this bug can be
ultimately verified by QA.

Comment 5 Zdenek Kabelac 2012-10-11 09:53:00 UTC
This feature is not yet ready, postponing for next release.

Comment 7 Zdenek Kabelac 2013-10-14 14:18:24 UTC
Feature is implemented, however there are some 'noticable' limitation.

2 ways to achieve the goal:


lvcreate -L10 -n lv1  vg

1st. way:
make 'lv1' inactive:
  lvchange -an vg/lv1
make 'lv1' read-only:
  lvchange -pr vg/lv1 

now lvcreate may take a snapshot into some existing pool
  lvcreate -s vg/lv1  --thinpool  vg/existingpool

2nd. way:
Live conversion of 'lv1' into a thin  volume and using 'origlv' name for the origin which will be read-only volume:
  lvconvert --thin vg/lv1  --thinpool vg/existingpool  --originname origlv

Both ways are possible - user has to select which version better fits.

Comment 11 Nenad Peric 2013-10-21 13:33:07 UTC
[root@virt-008 ~]# lvcreate -T --size 1G non_cluster/pool_lv
  Logical volume "lvol0" created
  Logical volume "pool_lv" created
[root@virt-008 ~]# lvcreate  -s non_cluster/lv1 --thinpool non_cluster/pool_lv
  Cannot use writable LV as the external origin.
[root@virt-008 ~]# lvchange -pr non_cluster/lv1
  Logical volume "lv1" changed.
[root@virt-008 ~]# lvcreate  -s non_cluster/lv1 --thinpool non_cluster/pool_lv
  Logical volume "lvol1" created

[root@virt-008 ~]# lvcreate -L10 -n lv1 non_cluster
  Rounding up size to full physical extent 12.00 MiB
  Logical volume "lv1" created
[root@virt-008 ~]# lvcreate -T --size 1G non_cluster/pool_lv
  Logical volume "lvol0" created
  Logical volume "pool_lv" created
[root@virt-008 ~]# lvconvert --thin non_cluster/lv1 --thinpool non_cluster/pool_lv --originname source_origin
  Logical volume "source_origin" created
  Converted non_cluster/source_origin to thin external origin.

Removal of origin draws the removal of thin LV as well with it. 
It is not really clear which LV is dependent in the message though (lvs -a helps)

[root@virt-008 ~]# lvremove non_cluster/source_origin
Removing external origin "source_origin" will remove 1 dependent volume(s). Proceed? [y/n]: y
Do you really want to remove active clustered logical volume lv1? [y/n]: y
  Logical volume "lv1" successfully removed
  Logical volume "source_origin" successfully removed

Tested on (VERIFIED):


Comment 12 errata-xmlrpc 2013-11-21 23:16:14 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.


Note You need to log in before you can comment on or make changes to this bug.