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 1284128 - thin and cache pool create commands should be consistent
Summary: thin and cache pool create commands should be consistent
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: lvm2
Version: 7.2
Hardware: x86_64
OS: Linux
unspecified
low
Target Milestone: rc
: ---
Assignee: LVM and device-mapper development team
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-11-20 23:01 UTC by Corey Marthaler
Modified: 2021-09-03 12:39 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-21 10:55:18 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Corey Marthaler 2015-11-20 23:01:00 UTC
Description of problem:
Shouldn't all these create commands behave the same whether it's a cache or thin pool being created? 


# --[thin,cache]-pool                                                                                                                                                             
[root@host-122 ~]# lvcreate --thin-pool POOL1 -L 100M vg                                                                                                                           
  Logical volume "POOL1" created.                                                                                                                                                        
[root@host-122 ~]# lvcreate --cache-pool POOL2 -L 100M vg                                                                                                                                     
  Ambiguous syntax, please create --type cache-pool POOL2 separately.


# --type [thin,cache]-pool
[root@host-122 ~]# lvcreate --type thin-pool POOL3 -L 100M vg
  Volume group "POOL3" not found
[root@host-122 ~]# lvcreate --type cache-pool POOL4 -L 100M vg
  Volume group "POOL4" not found


# --type [thin,cache]-pool -n
[root@host-122 ~]# lvcreate --type thin-pool -n POOL5 -L 100M vg
  Logical volume "POOL5" created.
[root@host-122 ~]# lvcreate --type cache-pool -n POOL6 -L 100M vg
  Logical volume "POOL6" created.


# --[thin,cache]pool
[root@host-122 ~]# lvcreate --thinpool POOL7 -L 100M vg
  Logical volume "POOL7" created.
[root@host-122 ~]# lvcreate --cachepool POOL8 -L 100M vg
  Ambiguous syntax, please create --type cache-pool POOL8 separately.


# --[thin,cache]pool -n
[root@host-122 ~]# lvcreate --thinpool -n POOL9 -L 100M vg
  Logical volume name "-n" is invalid.
  Run `lvcreate --help' for more information.
[root@host-122 ~]# lvcreate --cachepool -n POOL10 -L 100M vg
  Logical volume name "-n" is invalid.
  Run `lvcreate --help' for more information.


# --type [thin,cache]pool -n 
[root@host-122 ~]# lvcreate --type thinpool -n POOL11 -L 100M vg
  WARNING: Unrecognised segment type thinpool
  Invalid argument for --type: thinpool
  Error during parsing of command line.
[root@host-122 ~]# lvcreate --type cachepool -n POOL12 -L 100M vg
  WARNING: Unrecognised segment type cachepool
  Invalid argument for --type: cachepool
  Error during parsing of command line.


[root@host-122 ~]# lvs -a -o +devices
  LV              VG  Attr       LSize   Pool Origin Data%  Meta% Devices       
  POOL1           vg  twi-a-tz-- 100.00m             0.00   0.88  POOL1_tdata(0)
  [POOL1_tdata]   vg  Twi-ao---- 100.00m                          /dev/sda1(1)  
  [POOL1_tmeta]   vg  ewi-ao----   4.00m                          /dev/sdh1(0)  
  POOL5           vg  twi-a-tz-- 100.00m             0.00   0.88  POOL5_tdata(0)
  [POOL5_tdata]   vg  Twi-ao---- 100.00m                          /dev/sda1(26) 
  [POOL5_tmeta]   vg  ewi-ao----   4.00m                          /dev/sdh1(1)  
  POOL6           vg  Cwi---C--- 100.00m                          POOL6_cdata(0)
  [POOL6_cdata]   vg  Cwi------- 100.00m                          /dev/sda1(54) 
  [POOL6_cmeta]   vg  ewi-------   8.00m                          /dev/sda1(52) 
  POOL7           vg  twi-a-tz-- 100.00m             0.00   0.88  POOL7_tdata(0)
  [POOL7_tdata]   vg  Twi-ao---- 100.00m                          /dev/sda1(79) 
  [POOL7_tmeta]   vg  ewi-ao----   4.00m                          /dev/sdh1(2)  
  [lvol0_pmspare] vg  ewi-------   8.00m                          /dev/sda1(0)  
  [lvol0_pmspare] vg  ewi-------   8.00m                          /dev/sda1(51) 


Version-Release number of selected component (if applicable):
3.10.0-327.el7.x86_64

lvm2-2.02.130-5.el7    BUILT: Wed Oct 14 08:27:29 CDT 2015
lvm2-libs-2.02.130-5.el7    BUILT: Wed Oct 14 08:27:29 CDT 2015
lvm2-cluster-2.02.130-5.el7    BUILT: Wed Oct 14 08:27:29 CDT 2015
device-mapper-1.02.107-5.el7    BUILT: Wed Oct 14 08:27:29 CDT 2015
device-mapper-libs-1.02.107-5.el7    BUILT: Wed Oct 14 08:27:29 CDT 2015
device-mapper-event-1.02.107-5.el7    BUILT: Wed Oct 14 08:27:29 CDT 2015
device-mapper-event-libs-1.02.107-5.el7    BUILT: Wed Oct 14 08:27:29 CDT 2015
device-mapper-persistent-data-0.5.5-1.el7    BUILT: Thu Aug 13 09:58:10 CDT 2015
cmirror-2.02.130-5.el7    BUILT: Wed Oct 14 08:27:29 CDT 2015
sanlock-3.2.4-1.el7    BUILT: Fri Jun 19 12:48:49 CDT 2015
sanlock-lib-3.2.4-1.el7    BUILT: Fri Jun 19 12:48:49 CDT 2015
lvm2-lockd-2.02.130-5.el7    BUILT: Wed Oct 14 08:27:29 CDT 2015

Comment 1 Zdenek Kabelac 2015-11-21 10:55:18 UTC
(In reply to Corey Marthaler from comment #0)
> Description of problem:
> Shouldn't all these create commands behave the same whether it's a cache or
> thin pool being created? 

So let's go one-by-one

> 
> 
> # --[thin,cache]-pool                                                       
> 
> [root@host-122 ~]# lvcreate --thin-pool POOL1 -L 100M vg                    
> 
>   Logical volume "POOL1" created.                                           
> 
> [root@host-122 ~]# lvcreate --cache-pool POOL2 -L 100M vg                   
> 
>   Ambiguous syntax, please create --type cache-pool POOL2 separately.


--type thin-pool       !=    --thin-pool|--thinpool
--type cache-pool       !=    --cache-pool|--cachepool

For 'thin-pool' we have implemented 'cheat' support into command line,
so if the tool 'guesses' you wanted to create POOL1  it will do it.

However for cache - we cannot 'cheat' since it's not actually clear
(ambigous) if you wanted to create 'cachedLV' or  'cachepool'

With thin - case is simple - without -V  you cannot create thin volume
so the only thing you could create is pool.




> # --type [thin,cache]-pool
> [root@host-122 ~]# lvcreate --type thin-pool POOL3 -L 100M vg
>   Volume group "POOL3" not found
> [root@host-122 ~]# lvcreate --type cache-pool POOL4 -L 100M vg
>   Volume group "POOL4" not found


Correct -   --type  takes argument   thin-pool,cache-pool
So first 'free' arg is volume group name - in this case POOL3, POOL4



> 
> 
> # --type [thin,cache]-pool -n
> [root@host-122 ~]# lvcreate --type thin-pool -n POOL5 -L 100M vg
>   Logical volume "POOL5" created.
> [root@host-122 ~]# lvcreate --type cache-pool -n POOL6 -L 100M vg
>   Logical volume "POOL6" created.

Correct -   --name of pool is given and name of volume group is 'vg'
(first free arg on line)

> 
> 
> # --[thin,cache]pool
> [root@host-122 ~]# lvcreate --thinpool POOL7 -L 100M vg
>   Logical volume "POOL7" created.
> [root@host-122 ~]# lvcreate --cachepool POOL8 -L 100M vg
>   Ambiguous syntax, please create --type cache-pool POOL8 separately.


Opposite case for the first case.

Worth to note here -  for a while lvm2 now support arbitrary amount
of '-' in option name  i.e. --thin-pool  == --t-h-i-n-p-o-o-l
and many other variants basically from any option name  all '-' are dropped and
this gives you the 'base' option name.


So let's reapeat this case  '--type thinpool'  !=  --thinpool

--thinpool takes argument  poolname

so lvcreate 'knows' pool name, knows size and knows  VG name and can create.

The cache case is 'ambiguous' - if POOL8 doesn't exists command doesn't know if you wanted to create cache-pool or cached LV.

In future it's possible we will have some 'policy' to pick 'cachepool' size according to LV size (i.e. 10% of LV size), but until this happens,
we report  ambiguous syntax error...



> 
> 
> # --[thin,cache]pool -n
> [root@host-122 ~]# lvcreate --thinpool -n POOL9 -L 100M vg
>   Logical volume name "-n" is invalid.
>   Run `lvcreate --help' for more information.
> [root@host-122 ~]# lvcreate --cachepool -n POOL10 -L 100M vg
>   Logical volume name "-n" is invalid.
>   Run `lvcreate --help' for more information.

--thin  !=  --thinpool
--cache !=  --cachepool


--thin       takes no argument
--cache      takes no argument 

--thinpool <poolname>
--cachepool <poolname>


> # --type [thin,cache]pool -n 
> [root@host-122 ~]# lvcreate --type thinpool -n POOL11 -L 100M vg
>   WARNING: Unrecognised segment type thinpool
>   Invalid argument for --type: thinpool
>   Error during parsing of command line.
> [root@host-122 ~]# lvcreate --type cachepool -n POOL12 -L 100M vg
>   WARNING: Unrecognised segment type cachepool
>   Invalid argument for --type: cachepool
>   Error during parsing of command line.


Name of 'segment type'  is   cache-pool,  thin-pool
We may eventually add support for  segment aliases
so tool will make   thin-pool == thinpool.

Possibly RFE this separately.

---

So overall no bug here - everything works as expected.
(The situation is worse with 'lvconvert' - that command needs fixes)


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