Bug 1022714

Summary: ThinLVM pool created with incorrect size
Product: Red Hat OpenStack Reporter: Eric Harney <eharney>
Component: openstack-cinderAssignee: Jon Bernard <jobernar>
Status: CLOSED ERRATA QA Contact: Giulio Fidente <gfidente>
Severity: high Docs Contact:
Priority: unspecified    
Version: 4.0CC: abaron, ddomingo, eharney, gfidente, hateya, jobernar, sgordon, yeylon
Target Milestone: rc   
Target Release: 4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-cinder-2013.2-8.el6ost Doc Type: Bug Fix
Doc Text:
A bug in way the the Block Storage ThinLVM driver handled volume sizes made it possible for the Block Storage service to create ThinLVM pools with incorrect sizes. Specifically, if a thin pool did not exist in Cinder's volume group, the Block Storage service created one but with a smaller size than intended. Whenever this occurred, I/O traffic to volumes failed when the pool space was exhausted. This release fixes the bug, ensuring that the Block Storage service calculates volume sizes correctly and creates ThinLVM pools with correct sizes consistently.
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-12-20 00:32:14 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: 975606, 1002648    

Description Eric Harney 2013-10-23 20:24:13 UTC
Description of problem:
When enabling the LVM driver with option lvm_type=thin, if the vg does not have a -pool VG, cinder creates a <vgname>-pool LVM thin pool.  This may be created with the wrong size because Cinder determines the VG capacity as X GB and then runs "lvcreate -T -L X <path>" rather than "lvcreate -T -L XG <path>".

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

Steps to Reproduce:
1.  Create new VG named "cinder-vg"
2.  Set volume_group=cinder-vg in cinder.conf
3.  Start cinder-volume service

Actual results:
# lvs cinder-vg
shows a cinder-vg-pool LV of size 4.00m rather than XGB.


LVM brick needs to do something like _sizestr() to set the unit being passed to the lvcreate command.


Also need to look at Grizzly as it uses different code (not brick) for handling this and may or may not have this problem.

Comment 1 Eric Harney 2013-10-31 18:49:31 UTC
Jon's testing here also revealed that ThinLVM free space calculation is not handled correctly, so when you have a pool of correct size (~ the entire VG), the LVM driver / Cinder scheduler will report that you do not have enough free space for a Cinder volume to be created.  (It considers the VG full since the pool LV is consuming the space -- should calculate usable space inside the pool somehow.)

Comment 5 Giulio Fidente 2013-12-12 11:55:01 UTC
verified using openstack-cinder-2013.2-8.el6ost.noarch

Comment 7 errata-xmlrpc 2013-12-20 00:32:14 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.

http://rhn.redhat.com/errata/RHEA-2013-1859.html