Bug 1191061

Summary: unable to specifiy a non default --poolmetadatasize when also using an external origin volume
Product: Red Hat Enterprise Linux 7 Reporter: Nenad Peric <nperic>
Component: lvm2Assignee: Zdenek Kabelac <zkabelac>
lvm2 sub component: Thin Provisioning QA Contact: cluster-qe <cluster-qe>
Status: CLOSED CURRENTRELEASE Docs Contact:
Severity: low    
Priority: low CC: agk, cmarthal, heinzm, jbrassow, msnitzer, nperic, prajnoha, prockai, thornber, zkabelac
Version: 7.1Keywords: Triaged
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: lvm2-2.02.130-2.el7.x86_64 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1203456 (view as bug list) Environment:
Last Closed: 2016-01-07 17:20:19 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1203456    

Description Nenad Peric 2015-02-10 12:00:13 UTC
Description of problem:

When trying a lvconvert with a bit 'weird' extent sizes, the rounding made for the human readable format makes the error a bit nonsensical. 

Version-Release number of selected component (if applicable):

lvm2-2.02.115-3.el7.x86_64

How reproducible:
Everytime

Steps to Reproduce:

I ran an automated script which hit it:
SCENARIO - [valid_non_power_2_vg_extentsizes]
Using extent size of 384 KiB
Create pool volumes on top of VGs with *non* power of 2 extent sizes from 128K to somewhere less than 8G


pvcreate --dataalignment 2304k /dev/sdc1 /dev/sdd1 /dev/sde1 /dev/sdf1 /dev/sdg1
lvcreate  --thinpool POOL --profile thin-performance --zero n -L 1G --poolmetadatasize 4M snapper_thinp

Create LV to be used as an EXTERNAL origin device
lvcreate  -L 1G -n origin snapper_thinp
Converting LV into an external thin origin device
lvconvert --thinpool snapper_thinp/POOL --originname extorigin -T origin --yes
Can't use "snapper_thinp/origin" as external origin with "snapper_thinp/POOL" pool. Size 1.00 GiB is not a multiple of pool's chunk size 1.00 MiB.

Actual results:

Can't use "snapper_thinp/origin" as external origin with "snapper_thinp/POOL" pool. Size 1.00 GiB is not a multiple of pool's chunk size 1.00 MiB.

Expected results:

Either forbid creation of 1024 chunk size with extent size of 384 (or something which is not a multiple), or make the error show units which are not rounded (ie. 0.99G or 1.01G), or print some warning so the user knows what is going on. 

Additional info:

Comment 2 Corey Marthaler 2015-02-10 15:31:39 UTC
This error only appears went using an external origin volume with a pool device where a non default '--poolmetadatasize' option is used. If we remove the '--poolmetadatasize 4M' arg during pool creation, everything "just works".

Comment 4 Zdenek Kabelac 2015-12-14 15:56:49 UTC
Please retest, I believe bug has been already fixed with 7.2 release.

Comment 5 Jonathan Earl Brassow 2016-01-07 17:18:38 UTC
Seems to work for me in 7.2 beta:

[root@bp-02 ~]# pvcreate --dataalignment 2304k /dev/mapper/mpath[abcdefgh]1
  Physical volume "/dev/mapper/mpatha1" successfully created
  Physical volume "/dev/mapper/mpathb1" successfully created
  Physical volume "/dev/mapper/mpathc1" successfully created
  Physical volume "/dev/mapper/mpathd1" successfully created
  Physical volume "/dev/mapper/mpathe1" successfully created
  Physical volume "/dev/mapper/mpathf1" successfully created
  Physical volume "/dev/mapper/mpathg1" successfully created
  Physical volume "/dev/mapper/mpathh1" successfully created
[root@bp-02 ~]# vgcreate vg  /dev/mapper/mpath[abcdefgh]1
  Volume group "vg" successfully created
[root@bp-02 ~]# lvcreate --thinpool POOL --profile thin-performance --zero n -L 1G --poolmetadatasize 4M vg
  Logical volume "POOL" created.
[root@bp-02 ~]# lvcreate  -L 1G -n origin vg
  Logical volume "origin" created.
[root@bp-02 ~]# lvconvert --thinpool vg/POOL --originname extorigin -T origin --yes
  WARNING: Logical volume vg/extorigin not zeroed.
  Logical volume "extorigin" created.
  Converted vg/origin to thin volume with external origin vg/extorigin.