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 1043646 - RFE: Add ability to create LVM cache LVs
Summary: RFE: Add ability to create LVM cache LVs
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: lvm2
Version: 7.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Jonathan Earl Brassow
QA Contact: Cluster QE
URL:
Whiteboard:
: 984716 (view as bug list)
Depends On:
Blocks: 841379 921279 1004480 BrassowRHEL7Bugs
TreeView+ depends on / blocked
 
Reported: 2013-12-16 20:05 UTC by Jonathan Earl Brassow
Modified: 2021-09-08 20:22 UTC (History)
14 users (show)

Fixed In Version: lvm2-2.02.105-9.el7
Doc Type: Technology Preview
Doc Text:
LVM Cache Red Hat Enterprise Linux 7.0 introduces LVM cache as a Technology Preview. This feature allows users to create logical volumes with a small fast device performing as a cache to larger slower devices. Please refer to the lvm(8) manual page for information on creating cache logical volumes. Note that the following commands are not currently allowed on cache logical volumes: pvmove: will skip over any cache logical volume, lvresize, lvreduce, lvextend: cache logical volumes cannot be resized currently, vgsplit: splitting a volume group is not allowed when cache logical volumes exist in it.
Clone Of:
Environment:
Last Closed: 2014-06-13 10:49:49 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Jonathan Earl Brassow 2013-12-16 20:05:20 UTC
Allow LVM to utilize dm-cache (or other in-kernel caching implementations) to create logical volumes that are hierarchical in nature, with a small fast device performing as a cache to larger slower device or devices.

This bug shall cover the minimum requirements:
1) Be able to create a cache LV.
2) Be able to remove a cache LV
3) Be able to convert an existing LV to a cached LV
4) Be able to display via 'lvs' the type and characteristics of cache type LVs
5) Be able to rename cache type LVs
6) Man page updates for the above

The following restrictions apply to this bug.
1) Any cache mode beyond 'writethrough' will be a separate bug.
2) Any cache policy other than default will be a separate bug.
3) Changing either cache mode or policy without removing and recreating the cache will be a separate bug.
4) Changing the size of the cache w/o removing and recreating the cache will be a separate bug.

Comment 2 Marian Csontos 2013-12-17 13:09:29 UTC
Pull request:

-3) Be able to convert an existing LV to a cached LV
+3a) Be able to convert an existing LV to a cached LV
+3b) and back to non-cached LV

Comment 3 Tom Coughlan 2014-01-10 16:42:39 UTC
We are planning for this to be a Tech. Preview in 7.0.

Comment 9 Jonathan Earl Brassow 2014-02-24 23:17:17 UTC
Would it also help to add that the following commands are not currently allowed on cache logical volumes:
- pvmove: will skip over any cache LVs
- lvresize/lvreduce/lvextend:  cache LVs cannot be resized currently
- vgsplit: splitting a VG is not allowed when cache LVs exist in it

Comment 11 Eliska Slobodova 2014-02-26 15:10:44 UTC
Absolutely.
Both the book and the doc text field are updated.
Thank you!

Comment 14 Corey Marthaler 2014-02-27 23:12:38 UTC
This doesn't appear to be in the latest lvm rpms.

3.10.0-90.el7.x86_64
lvm2-2.02.105-8.el7    BUILT: Thu Feb 27 07:35:52 CST 2014
lvm2-libs-2.02.105-8.el7    BUILT: Thu Feb 27 07:35:52 CST 2014
lvm2-cluster-2.02.105-8.el7    BUILT: Thu Feb 27 07:35:52 CST 2014
device-mapper-1.02.84-8.el7    BUILT: Thu Feb 27 07:35:52 CST 2014
device-mapper-libs-1.02.84-8.el7    BUILT: Thu Feb 27 07:35:52 CST 2014
device-mapper-event-1.02.84-8.el7    BUILT: Thu Feb 27 07:35:52 CST 2014
device-mapper-event-libs-1.02.84-8.el7    BUILT: Thu Feb 27 07:35:52 CST 2014
device-mapper-persistent-data-0.2.8-4.el7    BUILT: Fri Jan 24 14:28:55 CST 2014
cmirror-2.02.105-8.el7    BUILT: Thu Feb 27 07:35:52 CST 2014

[root@harding-03 ~]# lvcreate -L 10G -n OriginLV VG /dev/sdb1
  Logical volume "OriginLV" created
[root@harding-03 ~]#  lvcreate -L 1G -n CacheDataLV VG /dev/sdb2
  Logical volume "CacheDataLV" created
[root@harding-03 ~]# lvcreate -L 10M -n CacheMetaLV VG /dev/sdb2
  Rounding up size to full physical extent 12.00 MiB
  Logical volume "CacheMetaLV" created

[root@harding-03 ~]# lvconvert --type cache-pool --poolmetadata VG/CacheMetaLV VG/CacheDataLV
  WARNING: Unrecognised segment type cache-pool

[root@harding-03 ~]# lvconvert --type cache --cachepool VG/CachePoolLV VG/OriginLV
  WARNING: Unrecognised segment type cache

[root@harding-03 ~]# lvcreate --type cache-pool -L 1G -n my_lv_cachepool VG /dev/sdb7
  WARNING: Unrecognised segment type cache-pool
  Unable to create LV with unknown segment type cache-pool.
  Run `lvcreate --help' for more information.

[root@harding-03 ~]# lvcreate --type cache -L 1G -n my_lv_cachepool VG /dev/sdb7
  WARNING: Unrecognised segment type cache
  Unable to create LV with unknown segment type cache.
  Run `lvcreate --help' for more information.

[root@harding-03 ~]# lsmod | grep cache
dm_cache               43291  0 
dm_persistent_data     61844  1 dm_cache
dm_bio_prison          15501  1 dm_cache
dm_mod                102999  22 dm_log,dm_persistent_data,dm_mirror,dm_cache,dm_bufio

Comment 15 Jonathan Earl Brassow 2014-02-28 03:07:59 UTC
Was '--with-cache=internal' used to configure?

Comment 16 Peter Rajnoha 2014-02-28 07:00:21 UTC
(In reply to Jonathan Earl Brassow from comment #15)
> Was '--with-cache=internal' used to configure?

Sigh. Nope, will need to add that!

Comment 17 Peter Rajnoha 2014-02-28 12:03:02 UTC
Should be ready now: lvm2-2.02.105-9.el7.

Comment 18 Jonathan Earl Brassow 2014-03-11 17:00:42 UTC
*** Bug 984716 has been marked as a duplicate of this bug. ***

Comment 19 Corey Marthaler 2014-04-11 21:54:12 UTC
Marking verified (SanityOnly). Cache testing and cache test development is still ongoing, however the basic test cases for tech preview listed in comment #0 pass with the only current issue found being bug 1086426. 

Also, the ability to convert a cached LV back to a "normal" LV is not documented anywhere in the man page, so I'm not sure how that is supposed to happen.


3.10.0-116.el7.x86_64
lvm2-2.02.105-14.el7    BUILT: Wed Mar 26 08:29:41 CDT 2014
lvm2-libs-2.02.105-14.el7    BUILT: Wed Mar 26 08:29:41 CDT 2014
lvm2-cluster-2.02.105-14.el7    BUILT: Wed Mar 26 08:29:41 CDT 2014
device-mapper-1.02.84-14.el7    BUILT: Wed Mar 26 08:29:41 CDT 2014
device-mapper-libs-1.02.84-14.el7    BUILT: Wed Mar 26 08:29:41 CDT 2014
device-mapper-event-1.02.84-14.el7    BUILT: Wed Mar 26 08:29:41 CDT 2014
device-mapper-event-libs-1.02.84-14.el7    BUILT: Wed Mar 26 08:29:41 CDT 2014
device-mapper-persistent-data-0.3.0-1.el7    BUILT: Fri Mar 28 07:42:24 CDT 2014
cmirror-2.02.105-14.el7    BUILT: Wed Mar 26 08:29:41 CDT 2014

Comment 20 Marian Csontos 2014-04-15 06:50:16 UTC
(In reply to Corey Marthaler from comment #19)
> Also, the ability to convert a cached LV back to a "normal" LV is not
> documented anywhere in the man page, so I'm not sure how that is supposed to
> happen.

See `man 8 lvm`:

   Removing Cache Logical Volumes
       If  you  wish to remove all logical volumes associated with a cache LV,
       you must remove both top-level, user-visible devices.  The cache  meta‐
       data  LV  and  cache  data  LV cannot be removed directly.  If only the
       cache pool LV is specfied for removal, any cached blocks not yet on the
       origin LV will be flush, the cache pool LV will be removed, and the now
       un-cached origin LV will remain.  If the user specifies a cache LV  for
       removal,  then the origin LV is removed and only the cache pool LV will
       remain.  The cache pool LV can then be used to create another cache  LV
       with a different origin LV if desired.

       When users intend to remove all logical volumes associated with a cache
       LV, it is generally better to start with the origin LV and then  remove
       the  cache  pool  LV.   If  the operations are performed in the reverse
       order, the user will have to wait for the contents of the cache pool LV
       to  be  flushed  before the origin LV is removed.  This could take some
       time.

Comment 21 Ludek Smid 2014-06-13 10:49:49 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.


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