Bug 983753 - request for clarification: attempting to run through all -T, --thin, and --thinpool scenarios/combinations
request for clarification: attempting to run through all -T, --thin, and --...
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: lvm2 (Show other bugs)
7.0
x86_64 Linux
unspecified Severity medium
: rc
: ---
Assigned To: Zdenek Kabelac
Cluster QE
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-11 17:17 EDT by Corey Marthaler
Modified: 2014-01-27 08:08 EST (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-01-27 08:08:33 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 Corey Marthaler 2013-07-11 17:17:06 EDT
Description of problem:
One of the test requirements for thinp is:

"test all thinp/snaps related command line option such as -T/--thinpool, -V and their respective option arguments covering good and bad options and arguments"


The lvconvert man page is pretty clear about how/when -T, --thin, and --thinpool are to be used,  however, the lvcreate man page is more vague and almost implies that they can all be used interchangeably which is not true.


" -T, --thin, --thinpool ThinPoolLogicalVolume{Name|Path}
              Creates thin pool or thin logical volume or both.  Specifying the optional argument --size will cause the creation of the thin pool logical volume.  Specifying  the  optional  argument  --virtualsize will  cause the creation of the thin logical volume from given thin pool volume.  Specifying both arguments will cause the creation of both thin pool and thin volume using this pool.  Requires device mapper kernel driver for thin provisioning from kernel 3.2 or newer."


The clearest description is what was written on the thinp etherpad itself:

Emphasize that '-T' is for creation of thin volumes - it's just the smartness of the tool, it may create and select thin pool as well - but since the support of external origin, we have to be careful when we will use  -T and when we require --thinpool. Especially our documentation should be 'exact' here to avoid further confusion. Also our doc should be exact when talking about thin volume and thin pool.


The man pages/docs should probably be more clear. 

Here are all the combinations of commands that I could think of. I think all are expected behavior (except for bug 983743). Please look these over and let me know if these are all correct and let me know of any other options that should be attempted/included.


### 1. Creation of thin pool ONLY:

# PASSES
[root@qalvm-01 ~]# lvcreate --thinpool POOL1 -L 1G VG
  Logical volume "POOL1" created
# FAILS 
[root@qalvm-01 ~]# lvcreate -T POOL2 -L 1G VG
  Volume group "POOL2" not found
# FAILS
[root@qalvm-01 ~]# lvcreate --thin POOL3 -L 1G VG
  Volume group "POOL3" not found


### 2. Conversion to thin pool (w/o specified meta volume):

[root@qalvm-02 ~]# lvcreate --type raid1 -m 1 -L 1G -n POOL1 VG
  Logical volume "POOL1" created
[root@qalvm-02 ~]# lvcreate --type raid1 -m 1 -L 1G -n POOL2 VG
  Logical volume "POOL2" created
[root@qalvm-02 ~]# lvcreate --type raid1 -m 1 -L 1G -n POOL3 VG
  Logical volume "POOL3" created

# PASSES
[root@qalvm-02 ~]# lvconvert --thinpool VG/POOL1
  Logical volume "POOL1_tmeta" created
  Converted VG/POOL1 to thin pool.
# FAILS
[root@qalvm-02 ~]# lvconvert -T VG/POOL2
  --thin is only valid with --thinpool.
  Run `lvconvert --help' for more information.
# FAILS
[root@qalvm-02 ~]# lvconvert --thin VG/POOL3
  --thin is only valid with --thinpool.
  Run `lvconvert --help' for more information.


### 3. Conversion to thin pool (w/ specified meta volume):

[root@qalvm-02 ~]# lvcreate --type raid1 -m 1 -L 1G -n POOL1 VG
  Logical volume "POOL1" created
[root@qalvm-02 ~]# lvcreate --type raid1 -m 1 -L 1G -n meta1 VG
  Logical volume "meta1" created
[root@qalvm-02 ~]# lvcreate --type raid1 -m 1 -L 1G -n POOL2 VG
  Logical volume "POOL2" created
[root@qalvm-02 ~]# lvcreate --type raid1 -m 1 -L 1G -n meta2 VG
  Logical volume "meta2" created
[root@qalvm-02 ~]# lvcreate --type raid1 -m 1 -L 1G -n POOL3 VG
  Logical volume "POOL3" created
[root@qalvm-02 ~]# lvcreate --type raid1 -m 1 -L 1G -n meta3 VG
  Logical volume "meta3" created


# PASSES
[root@qalvm-02 ~]# lvconvert --thinpool VG/POOL1 --poolmetadata meta1
  device-mapper: remove ioctl on  failed: Device or resource busy
  Converted VG/POOL1 to thin pool.
# FAILS
[root@qalvm-02 ~]# lvconvert -T VG/POOL2 --poolmetadata meta2
  --thin is only valid with --thinpool.
  Run `lvconvert --help' for more information.
# FAILS
[root@qalvm-02 ~]# lvconvert --thin VG/POOL3 --poolmetadata meta3
  --thin is only valid with --thinpool.
  Run `lvconvert --help' for more information.



### 4. Creation of thin pool and virtual thin volume on one cmd line:

# PASSES
[root@qalvm-01 ~]# lvcreate --thinpool POOL1 -L 1G --virtualsize 1G VG
  device-mapper: remove ioctl on  failed: Device or resource busy
  Logical volume "lvol0" created
# FAILS
[root@qalvm-01 ~]# lvcreate -T POOL2 -L 1G --virtualsize 1G VG
  Volume group "POOL2" not found
# FAILS
[root@qalvm-01 ~]# lvcreate --thin POOL3 -L 1G --virtualsize 1G VG
  Volume group "POOL3" not found

# PASSES
[root@qalvm-01 ~]# lvcreate --thinpool POOL5 -L 1G -V 1G VG
  device-mapper: remove ioctl on  failed: Device or resource busy
  Logical volume "lvol1" created
# FAILS
[root@qalvm-01 ~]# lvcreate -T POOL6 -L 1G -V 1G VG
  Volume group "POOL6" not found
# FAILS
[root@qalvm-01 ~]# lvcreate -T POOL7 -L 1G -V 1G VG
  Volume group "POOL7" not found


### 5. Creation of virtual thin devices only:

[root@qalvm-01 ~]# lvcreate --thinpool POOL1 -L 1G  VG
  device-mapper: remove ioctl on  failed: Device or resource busy
  Logical volume "POOL1" created

# ALL PASS
[root@qalvm-01 ~]# lvcreate --virtualsize 1G --thinpool VG/POOL1 -n virt1
  Logical volume "virt1" created
[root@qalvm-01 ~]# lvcreate -V 1G --thinpool VG/POOL1 -n virt2
  Logical volume "virt2" created

[root@qalvm-01 ~]# lvcreate --virtualsize 1G -T VG/POOL1 -n virt3
  Logical volume "virt3" created
[root@qalvm-01 ~]# lvcreate -V 1G -T VG/POOL1 -n virt4
  Logical volume "virt4" created

[root@qalvm-01 ~]# lvcreate --virtualsize 1G --thin VG/POOL1 -n virt5
  Logical volume "virt5" created
[root@qalvm-01 ~]# lvcreate -V 1G --thin VG/POOL1 -n virt6
  Logical volume "virt6" created


### 6. Conversion of external origin volume:

[root@qalvm-01 ~]# lvcreate --thinpool POOL -L 1G  VG
  device-mapper: remove ioctl on  failed: Device or resource busy
  Logical volume "POOL" created
[root@qalvm-01 ~]# lvcreate -L 1G -n origin1 VG
  Logical volume "origin1" created
[root@qalvm-01 ~]# lvcreate -L 1G -n origin2 VG
  Logical volume "origin2" created
[root@qalvm-01 ~]# lvcreate -L 1G -n origin3 VG
  Logical volume "origin3" created

# PASSES
[root@qalvm-01 ~]# lvconvert --thinpool VG/POOL --originname extorigin1 -T origin1
  Logical volume "extorigin1" created
  Converted VG/extorigin1 to thin external origin.
# PASSES
[root@qalvm-01 ~]# lvconvert --thinpool VG/POOL --originname extorigin2 --thin origin2
  Logical volume "extorigin2" created
  Converted VG/extorigin2 to thin external origin.
# FAILS
[root@qalvm-01 ~]# lvconvert --thinpool VG/POOL --originname extorigin3 --thinpool origin3
  Option --thinpool may not be repeated.
  Error during parsing of command line.
# PASSES WITH PROBLEMS (BUG 983743)
[root@qalvm-01 ~]# lvconvert -T VG/POOL --originname extorigin3 --thinpool origin3
  Logical volume "origin3_tmeta" created
  origin3_tdata is expected to have only one segment using it, while it has 3
  Failed to find pool_seg for origin3_tdata
  LV origin3_tdata: segment 1 pool data LV does not point back to same LV
  Internal error: LV segments corrupted in origin3_tdata.
  origin3_tdata is expected to have only one segment using it, while it has 3
  Failed to find pool_seg for origin3_tdata
  LV POOL: thin pool segment 1 data LV does not refer back to pool LV
  Internal error: LV segments corrupted in POOL.



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

lvm2-2.02.99-0.79.el7    BUILT: Mon Jul  8 08:28:24 CDT 2013
lvm2-libs-2.02.99-0.79.el7    BUILT: Mon Jul  8 08:28:24 CDT 2013
lvm2-cluster-2.02.99-0.79.el7    BUILT: Mon Jul  8 08:28:24 CDT 2013
device-mapper-1.02.78-0.79.el7    BUILT: Mon Jul  8 08:28:24 CDT 2013
device-mapper-libs-1.02.78-0.79.el7    BUILT: Mon Jul  8 08:28:24 CDT 2013
device-mapper-event-1.02.78-0.79.el7    BUILT: Mon Jul  8 08:28:24 CDT 2013
device-mapper-event-libs-1.02.78-0.79.el7    BUILT: Mon Jul  8 08:28:24 CDT 2013
cmirror-2.02.99-0.79.el7    BUILT: Mon Jul  8 08:28:24 CDT 2013
Comment 1 Zdenek Kabelac 2014-01-27 08:08:33 EST
> ### 1. Creation of thin pool ONLY:
> 
> # PASSES
> [root@qalvm-01 ~]# lvcreate --thinpool POOL1 -L 1G VG
>   Logical volume "POOL1" created
> # FAILS 
> [root@qalvm-01 ~]# lvcreate -T POOL2 -L 1G VG
>   Volume group "POOL2" not found
> # FAILS
> [root@qalvm-01 ~]# lvcreate --thin POOL3 -L 1G VG
>   Volume group "POOL3" not found

Correct -  -T/--thin does not take an argument - so the POOL1/3 is then 'the 1st.' free argument on your arg list - thus it's taken as a vgname  (which is the typical use of the free arg. - the following args are then typically PVs)


> 
> ### 2. Conversion to thin pool (w/o specified meta volume):
> 
> [root@qalvm-02 ~]# lvcreate --type raid1 -m 1 -L 1G -n POOL1 VG
>   Logical volume "POOL1" created
> [root@qalvm-02 ~]# lvcreate --type raid1 -m 1 -L 1G -n POOL2 VG
>   Logical volume "POOL2" created
> [root@qalvm-02 ~]# lvcreate --type raid1 -m 1 -L 1G -n POOL3 VG
>   Logical volume "POOL3" created
> 
> # PASSES
> [root@qalvm-02 ~]# lvconvert --thinpool VG/POOL1
>   Logical volume "POOL1_tmeta" created
>   Converted VG/POOL1 to thin pool.
> # FAILS
> [root@qalvm-02 ~]# lvconvert -T VG/POOL2
>   --thin is only valid with --thinpool.
>   Run `lvconvert --help' for more information.
> # FAILS
> [root@qalvm-02 ~]# lvconvert --thin VG/POOL3
>   --thin is only valid with --thinpool.
>   Run `lvconvert --help' for more information.

Correct - you want to convert to --thinpool.
Conversion to --thin (volume)  needs a thinpool.

> ### 3. Conversion to thin pool (w/ specified meta volume):
> 
> [root@qalvm-02 ~]# lvcreate --type raid1 -m 1 -L 1G -n POOL1 VG
>   Logical volume "POOL1" created
> [root@qalvm-02 ~]# lvcreate --type raid1 -m 1 -L 1G -n meta1 VG
>   Logical volume "meta1" created
> [root@qalvm-02 ~]# lvcreate --type raid1 -m 1 -L 1G -n POOL2 VG
>   Logical volume "POOL2" created
> [root@qalvm-02 ~]# lvcreate --type raid1 -m 1 -L 1G -n meta2 VG
>   Logical volume "meta2" created
> [root@qalvm-02 ~]# lvcreate --type raid1 -m 1 -L 1G -n POOL3 VG
>   Logical volume "POOL3" created
> [root@qalvm-02 ~]# lvcreate --type raid1 -m 1 -L 1G -n meta3 VG
>   Logical volume "meta3" created

ok.


> # PASSES
> [root@qalvm-02 ~]# lvconvert --thinpool VG/POOL1 --poolmetadata meta1
>   device-mapper: remove ioctl on  failed: Device or resource busy
>   Converted VG/POOL1 to thin pool.
> # FAILS
> [root@qalvm-02 ~]# lvconvert -T VG/POOL2 --poolmetadata meta2
>   --thin is only valid with --thinpool.
>   Run `lvconvert --help' for more information.
> # FAILS
> [root@qalvm-02 ~]# lvconvert --thin VG/POOL3 --poolmetadata meta3
>   --thin is only valid with --thinpool.
>   Run `lvconvert --help' for more information.

Nearly same as 2.


> 
> ### 4. Creation of thin pool and virtual thin volume on one cmd line:
> 
> # PASSES
> [root@qalvm-01 ~]# lvcreate --thinpool POOL1 -L 1G --virtualsize 1G VG
>   device-mapper: remove ioctl on  failed: Device or resource busy
>   Logical volume "lvol0" created
> # FAILS
> [root@qalvm-01 ~]# lvcreate -T POOL2 -L 1G --virtualsize 1G VG
>   Volume group "POOL2" not found
> # FAILS
> [root@qalvm-01 ~]# lvcreate --thin POOL3 -L 1G --virtualsize 1G VG
>   Volume group "POOL3" not found
> 
> # PASSES
> [root@qalvm-01 ~]# lvcreate --thinpool POOL5 -L 1G -V 1G VG
>   device-mapper: remove ioctl on  failed: Device or resource busy
>   Logical volume "lvol1" created
> # FAILS
> [root@qalvm-01 ~]# lvcreate -T POOL6 -L 1G -V 1G VG
>   Volume group "POOL6" not found

ok - 1st. free arg POOL6 is either vgname or vgname/poolname

> # FAILS
> [root@qalvm-01 ~]# lvcreate -T POOL7 -L 1G -V 1G VG
>   Volume group "POOL7" not found
> 
> 
> ### 5. Creation of virtual thin devices only:
> 
> [root@qalvm-01 ~]# lvcreate --thinpool POOL1 -L 1G  VG
>   device-mapper: remove ioctl on  failed: Device or resource busy
>   Logical volume "POOL1" created
> 
> # ALL PASS
> [root@qalvm-01 ~]# lvcreate --virtualsize 1G --thinpool VG/POOL1 -n virt1
>   Logical volume "virt1" created
> [root@qalvm-01 ~]# lvcreate -V 1G --thinpool VG/POOL1 -n virt2
>   Logical volume "virt2" created
> 
> [root@qalvm-01 ~]# lvcreate --virtualsize 1G -T VG/POOL1 -n virt3
>   Logical volume "virt3" created
> [root@qalvm-01 ~]# lvcreate -V 1G -T VG/POOL1 -n virt4
>   Logical volume "virt4" created
> 
> [root@qalvm-01 ~]# lvcreate --virtualsize 1G --thin VG/POOL1 -n virt5
>   Logical volume "virt5" created
> [root@qalvm-01 ~]# lvcreate -V 1G --thin VG/POOL1 -n virt6
>   Logical volume "virt6" created
> 

ok

> 
> ### 6. Conversion of external origin volume:
> 
> [root@qalvm-01 ~]# lvcreate --thinpool POOL -L 1G  VG
>   device-mapper: remove ioctl on  failed: Device or resource busy
>   Logical volume "POOL" created
> [root@qalvm-01 ~]# lvcreate -L 1G -n origin1 VG
>   Logical volume "origin1" created
> [root@qalvm-01 ~]# lvcreate -L 1G -n origin2 VG
>   Logical volume "origin2" created
> [root@qalvm-01 ~]# lvcreate -L 1G -n origin3 VG
>   Logical volume "origin3" created
> 
> # PASSES
> [root@qalvm-01 ~]# lvconvert --thinpool VG/POOL --originname extorigin1 -T
> origin1
>   Logical volume "extorigin1" created
>   Converted VG/extorigin1 to thin external origin.
> # PASSES
> [root@qalvm-01 ~]# lvconvert --thinpool VG/POOL --originname extorigin2
> --thin origin2
>   Logical volume "extorigin2" created
>   Converted VG/extorigin2 to thin external origin.
> # FAILS
> [root@qalvm-01 ~]# lvconvert --thinpool VG/POOL --originname extorigin3
> --thinpool origin3
>   Option --thinpool may not be repeated.
>   Error during parsing of command line.

ok 

> # PASSES WITH PROBLEMS (BUG 983743)
> [root@qalvm-01 ~]# lvconvert -T VG/POOL --originname extorigin3 --thinpool
> origin3
>   Logical volume "origin3_tmeta" created
>   origin3_tdata is expected to have only one segment using it, while it has 3
>   Failed to find pool_seg for origin3_tdata
>   LV origin3_tdata: segment 1 pool data LV does not point back to same LV
>   Internal error: LV segments corrupted in origin3_tdata.
>   origin3_tdata is expected to have only one segment using it, while it has 3
>   Failed to find pool_seg for origin3_tdata
>   LV POOL: thin pool segment 1 data LV does not refer back to pool LV
>   Internal error: LV segments corrupted in POOL.

Should be fixed and report error message as the thinpool can't be used as external origin.

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