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 1110026 - LVM cache: Unable to lvcreate cache LV from existing origin LV
Summary: LVM cache: Unable to lvcreate cache LV from existing origin LV
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: lvm2
Version: 6.6
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Zdenek Kabelac
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
: 1107345 (view as bug list)
Depends On:
Blocks: 1119326
TreeView+ depends on / blocked
 
Reported: 2014-06-16 20:46 UTC by Jonathan Earl Brassow
Modified: 2015-07-22 07:35 UTC (History)
9 users (show)

Fixed In Version: lvm2-2.02.117-1.el6
Doc Type: Bug Fix
Doc Text:
Correction of supported syntax removed support for incorrect lvcreate syntax for actual LV conversion. But in the cases tool may uniquely deduce conversion syntax from lvcreate command line, support has been restored to reduce the risk of incompatibilities with existing scripts and documentation.
Clone Of:
Environment:
Last Closed: 2015-07-22 07:35:00 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:1411 0 normal SHIPPED_LIVE lvm2 bug fix and enhancement update 2015-07-20 18:06:52 UTC

Description Jonathan Earl Brassow 2014-06-16 20:46:06 UTC
It seems there has been a regression in the following commit:
commit 8a60cbcf45c553dfc168552cf9af3059359ec95d
Date:   Tue Mar 11 23:07:41 2014 +0100

    thin: always activate and deactive pool when creating
    
    When we create thin-pool we have used trick to keep
    volume active, but since we now support TEMPORARY flag,
    we could just localy active & deactive metadata LV,
    and let the thinpool through normal activation process.


It use to be that we could start with either a cache-pool LV or an origin and use 'lvcreate' to create its compliment and form the cache LV.  This is no longer possible since the above commit.

To reproduce:
# lvcreate -l 2 -n lv vg
# lvcreate --type cache -n lv_cachepool -l 1 vg/lv <-- should produce cache LV

Comment 1 Jonathan Earl Brassow 2014-08-27 12:43:30 UTC
not a blocker candidate due to tech preview status

Comment 2 Zdenek Kabelac 2014-09-25 08:09:45 UTC
IMHO this command is currently supported  - however the logic behind this command is not the best match.

Reason:

The primary user request in this command is to 'convert'  existing LV into cached LV  and for this 'create' cache pool.

So this is IMHO clear sign for 'lvconvert' command.

Lvcreate command should be left here rather for creation of cached LV.
(That's the reason why I'd propose to stop supporting this command).

Ideal end result is:

lvcreate --type cache -L10 -n my_cached_volume vg

creates 'cached' 10M sized volume  'my_cached_volume' with some 'implicitly created cache pool (i.e. lvolXXX) 

compare with:

lvcreate -V10 -n thin --thinpool vg/pool

this command fails when pool does not exist.

and we need to get match for:

lvcreate --type cache --cachepool vg/existing_cache -L10 -n volume  vg.

For pool creation we use:

lvcreate --type cache-pool -L10 vg
(and we should as well handle  'lvcreate --cachepool new_pool -L10 vg)

Obviously this logic is then getting greatly confused when we start to allow to use 'lvcreate vg/lv'  for conversion.

IMHO needs more discussion - and I'm almost sure should not support this type of command

Comment 3 Zdenek Kabelac 2014-09-25 09:24:47 UTC
I assume we should also possibly introduce  --poolsize option.


So then we have:


lvconvert --cache --poolsize 10M  vg/origin

and even 

lvconvert --cache  vg/origin
(when we define some policy like poolsize should be i.e. 10% of origin size)


It's probably matching on thinpool support as well:

lvconvert --thin [--poolsize xxx] vg/extorigin

Converts volume into 'external' origin with thinpool with some size.
This could be seen as a 'simple way' how to use thinpool for i.e. thin snapshot creation.

For now lvconvert requires to have 'precreated' pool data volume and I think we could skip this - we have already code to detect rotational media.

As for lvcreate  -

lvcreate --cache -L10 -n cached_volume vg

It should mean to create 'origin' of 10M and the make it a cache volume and create a cache pool - again either automatically by a policy - or with --poolsize option - or by giving existing cachepool (unlike with lvconvert) --cachepool  LV.

So we then have proper logic with:

lvcreate --cache --cachepool existing_cache_pool_lv -L10 -n new_cached_volume vg

But it's getting here somewhat complicated:

with thin pools - we have '-V' for virtual thin volumes - and -L is used for pool size.

So needs discussion which logic fits best current command layout.

Comment 4 Zdenek Kabelac 2014-09-25 14:53:18 UTC
*** Bug 1107345 has been marked as a duplicate of this bug. ***

Comment 5 Zdenek Kabelac 2014-09-25 14:55:55 UTC
So as mentioned in Bug 1107345 - in commit c95d43b28c5f89e1d96f2b16805ecd74eb4b02fb it's been already recognized there is syntax parsing problem.

So we need to allow only  vg/pool with lvcreate
And with lvconvert  we use  vg/lv  to specify lv for conversion.

Comment 7 Zdenek Kabelac 2014-11-05 14:42:54 UTC
Current git code base of 2.02.112 supports  syntax from BZ description again,

Comment 10 Nenad Peric 2015-04-22 13:59:06 UTC
Based on Comment 7 and Comment 8, and on the following test:

[root@tardis-02 ~]# vgcreate vg /dev/sdc1 /dev/sdd1
  Physical volume "/dev/sdc1" successfully created
  Physical volume "/dev/sdd1" successfully created
  Volume group "vg" successfully created

[root@tardis-02 ~]# lvcreate -l 50 -n normal_lv vg
  Logical volume "normal_lv" created.

[root@tardis-02 ~]# lvs -a
  LV        VG          Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  normal_lv vg          -wi-a----- 200.00m                                                    
  lv_home   vg_tardis02 -wi-ao---- 224.88g                                                    
  lv_root   vg_tardis02 -wi-ao----  50.00g                                                    
  lv_swap   vg_tardis02 -wi-ao----   4.00g                                                    

[root@tardis-02 ~]# lvcreate --type cache -n lv_cachepool -l 10 vg/normal_lv
  Logical volume vg/normal_lv is now cached.

[root@tardis-02 ~]# lvs -a
  LV                   VG          Attr       LSize   Pool           Origin            Data%  Meta%  Move Log Cpy%Sync Convert
  [lv_cachepool]       vg          Cwi---C---  40.00m                                  0.78   0.39            0.00            
  [lv_cachepool_cdata] vg          Cwi-ao----  40.00m                                                                         
  [lv_cachepool_cmeta] vg          ewi-ao----   8.00m                                                                         
  [lvol0_pmspare]      vg          ewi-------   8.00m                                                                         
  normal_lv            vg          Cwi-a-C--- 200.00m [lv_cachepool] [normal_lv_corig] 0.78   0.39            0.00            
  [normal_lv_corig]    vg          owi-aoC--- 200.00m                                                                         
  lv_home              vg_tardis02 -wi-ao---- 224.88g                                                                         
  lv_root              vg_tardis02 -wi-ao----  50.00g                                                                         
  lv_swap              vg_tardis02 -wi-ao----   4.00g                    


I will mark this BZ as VERIFIED against the original comment and bug descrption.

Verified with:

lvm2-2.02.118-2.el6.x86_64

Comment 11 errata-xmlrpc 2015-07-22 07:35:00 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.

https://rhn.redhat.com/errata/RHBA-2015-1411.html


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