Bug 814737 - Extend lvcreate to take thin snapshots of existing non-thinly-provisioned LVs
Extend lvcreate to take thin snapshots of existing non-thinly-provisioned LVs
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: lvm2 (Show other bugs)
6.4
Unspecified Linux
medium Severity medium
: rc
: 6.4
Assigned To: Zdenek Kabelac
Cluster QE
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-04-20 11:00 EDT by Alasdair Kergon
Modified: 2013-11-21 18:16 EST (History)
13 users (show)

See Also:
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.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-11-21 18:16:14 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Alasdair Kergon 2012-04-20 11:00:54 EDT
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 10:51:57 EDT
See also part of this thread:
  https://www.redhat.com/archives/dm-devel/2012-June/msg00107.html
Comment 2 RHEL Product and Program Management 2012-07-10 02:07:47 EDT
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 Product and Program Management 2012-07-10 19:57:03 EDT
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 15:26:33 EDT
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 05:53:00 EDT
This feature is not yet ready, postponing for next release.
Comment 7 Zdenek Kabelac 2013-10-14 10:18:24 EDT
Feature is implemented, however there are some 'noticable' limitation.

2 ways to achieve the goal:

examples:

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 09:33:07 EDT
[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):

lvm2-2.02.100-6.el6.x86_64
lvm2-cluster-2.02.100-6.el6.x86_64
device-mapper-1.02.79-6.el6.x86_64
kernel-2.6.32-424.el6.x86_64
Comment 12 errata-xmlrpc 2013-11-21 18:16:14 EST
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-2013-1704.html

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