Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1132211

Summary: thin pool conversion fails when the size gap between the pool and meta device is too great
Product: Red Hat Enterprise Linux 6 Reporter: Corey Marthaler <cmarthal>
Component: lvm2Assignee: Zdenek Kabelac <zkabelac>
lvm2 sub component: Thin Provisioning (RHEL6) QA Contact: cluster-qe <cluster-qe>
Status: CLOSED ERRATA Docs Contact:
Severity: high    
Priority: unspecified CC: agk, heinzm, jbrassow, msnitzer, nperic, prajnoha, prockai, thornber, tlavigne, zkabelac
Version: 6.6   
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: lvm2-2.02.117-1.el6 Doc Type: Bug Fix
Doc Text:
Missing rounding of chunk size during thin pool creation could have resulted into failing activation of the created thin pool with unsupported chunk size. Tool now properly rounds to 64kB thin pool chunk size.
Story Points: ---
Clone Of:
: 1168140 (view as bug list) Environment:
Last Closed: 2015-07-22 07:35:10 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: 1119323, 1168140    
Attachments:
Description Flags
-vvvv of the lvconvert none

Description Corey Marthaler 2014-08-20 22:04:57 UTC
Created attachment 928953 [details]
-vvvv of the lvconvert

Description of problem:
I started seeing this when I lowered the size of the meta device to only 4M but had a pool device of 10G. If the meta device is say 400M, or the pool device is only 1G, i wont see this issue.

[root@host-050 ~]# lvs -a -o +devices
  LV   VG            Attr       LSize   Pool Origin Data% Devices        
  POOL snapper_thinp -wi-a-----  10.00g                   /dev/sdb1(1)   
  meta snapper_thinp -wi-a-----   4.00m                   /dev/sdb1(0)   

[root@host-050 ~]# lvconvert --thinpool snapper_thinp/POOL --poolmetadata meta --yes
  WARNING: Converting logical volume snapper_thinp/POOL and snapper_thinp/meta to pool's data and metadata volumes.
  THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.)
  Logical volume "lvol0" created
  device-mapper: reload ioctl on  failed: Invalid argument
  Failed to activate pool logical volume snapper_thinp/POOL.


I tried the version before this (.109-1) and the bug exists there as well.

Version-Release number of selected component (if applicable):
2.6.32-495.el6.x86_64
lvm2-2.02.109-2.el6    BUILT: Tue Aug 19 09:32:25 CDT 2014
lvm2-libs-2.02.109-2.el6    BUILT: Tue Aug 19 09:32:25 CDT 2014
lvm2-cluster-2.02.109-2.el6    BUILT: Tue Aug 19 09:32:25 CDT 2014
udev-147-2.57.el6    BUILT: Thu Jul 24 08:48:47 CDT 2014
device-mapper-1.02.88-2.el6    BUILT: Tue Aug 19 09:32:25 CDT 2014
device-mapper-libs-1.02.88-2.el6    BUILT: Tue Aug 19 09:32:25 CDT 2014
device-mapper-event-1.02.88-2.el6    BUILT: Tue Aug 19 09:32:25 CDT 2014
device-mapper-event-libs-1.02.88-2.el6    BUILT: Tue Aug 19 09:32:25 CDT 2014
device-mapper-persistent-data-0.3.2-1.el6    BUILT: Fri Apr  4 08:43:06 CDT 2014
cmirror-2.02.109-2.el6    BUILT: Tue Aug 19 09:32:25 CDT 2014

Comment 2 Zdenek Kabelac 2014-11-26 09:12:53 UTC
The code was missing rounding to 64kb when chunk size was estimated.
Code in 2.02.113 catches the problem before metadata are written.

With this upstream patch:
https://www.redhat.com/archives/lvm-devel/2014-November/msg00199.html

missed rounding is fixed:

# lvcreate -L10G --poolmetadatasize 4M  -T vg/pool1
  Logical volume "pool1" created.

# lvs -o+chunk_size
  LV    VG   Attr       LSize  Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert Chunk  
  pool1 vg   twi-a-tz-- 10,00g             0,00   1,17                             192,00k

Comment 4 Nenad Peric 2015-04-23 09:52:37 UTC
[root@tardis-02 ~]# lvcreate -L 4M -n meta vg
  Logical volume "meta" created.
[root@tardis-02 ~]# lvcreate -L 10G -n pool vg
  Logical volume "pool" created.
[root@tardis-02 ~]# lvconvert --thinpool vg/pool --poolmetadata meta --yes
  WARNING: Converting logical volume vg/pool and vg/meta to pool's data and metadata volumes.
  THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.)
  Converted vg/pool to thin pool.
[root@tardis-02 ~]# lvs -a
  LV              VG          Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  [lvol0_pmspare] vg          ewi-------   4.00m                                                    
  pool            vg          twi-a-tz--  10.00g             0.00   1.17                            
  [pool_tdata]    vg          Twi-ao----  10.00g                                                    
  [pool_tmeta]    vg          ewi-ao----   4.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    


The test/issue mentioned in the opening comment passes with lvm2-2.02.118-2.el6.x86_64

marking as VERIFIED

Comment 5 errata-xmlrpc 2015-07-22 07:35:10 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