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 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
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: lvm2
Version: 6.4
Hardware: Unspecified
OS: Linux
medium
medium
Target Milestone: rc
: 6.4
Assignee: Zdenek Kabelac
QA Contact: Cluster QE
URL:
Whiteboard:
Depends On:
Blocks:
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:
Environment:
Last Closed: 2013-11-21 23:16:14 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
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:
  https://www.redhat.com/archives/dm-devel/2012-June/msg00107.html

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:

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 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):

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 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.

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.