Bug 1034721

Summary: LVMThinPoolDevice.freeSpace returns negative number
Product: [Fedora] Fedora Reporter: Jan Synacek <jsynacek>
Component: python-blivetAssignee: Vratislav Podzimek <vpodzime>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 22CC: amulhern, anaconda-maint-list, bcl, dlehman, jsafrane
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-19 10:38:15 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:

Description Jan Synacek 2013-11-26 11:58:40 UTC
Description of problem:
# vgs
  VG   #PV #LV #SN Attr   VSize VFree  
  vg1    3   7   0 wz--n- 2.84g 480.00m
  vg2    1   2   0 wz--n- 1.38g 320.00m

# lvs
  LV        VG   Attr       LSize   Pool      Origin Data%
  lv1       vg1  -wi-a-----  96.00m
  lv2       vg1  -wi-a-----  96.00m
  thin1     vg1  Vwi-a-tz-- 100.00g thinpool           0.05
  thin2     vg1  Vwi-a-tz--  50.00g thinpool2          0.00
  thin22    vg1  Vwi-a-tz-- 100.00g thinpool2          0.00
  thinpool  vg1  twi-a-tz--   1.59g                    3.32
  thinpool2 vg1  twi-a-tz-- 512.00m                    0.00
  thin3     vg2  Vwi-a-tz-- 100.00g thinpool3          0.00
  thinpool3 vg2  twi-a-tz--   1.00g                    0.00

I fire up ipython -i, initialize blivet and say:

> tvg = b.devicetree.getDeviceByName('vg1-thinpool')

> tvg
(instance's string representation follows)
LVMThinPoolDevice instance (0x2dce910) --
name = vg1-thinpool ...

> tvg.freeSpace
-100768.0

As can be seen, tvg.freeSpace is determined as a simple substraction of 100 gigs of its only child 'thin1' and the thinpool's size of 1.59g.


Version-Release number of selected component (if applicable):
python-blivet-0.27-1.fc21.noarch


Steps to Reproduce:
1. See description


Actual results:
The computed free space of a thinpool is wrong.


Expected results:
The computed free space of a thinpool equals its size minus the size of the data (+ metadata?) present on all of its thin volumes.

In this case, size of the thinpool is 1.59g, that's about 1628m. Of that amount, 3.32% is occupied, that is about 54m. So free space of the thinpool should be 1628 - 54 = 1574. Or simply take 96.68% of the thinpool's size.

Comment 1 David Lehman 2013-11-26 17:34:01 UTC
For now, in blivet you will be able to create thin lvs in thin pools that are not overcommitted and you will be able to use existing thin lvs in thin pools that are overcommitted, but blivet will not perform any operation that causes (or furthers) overcommit of a thin pool's resources.

We can keep this bug open as a tracker if you like, but it is not a high priority for me.

Comment 2 Jaroslav Reznik 2015-03-03 16:57:09 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 22 development cycle.
Changing version to '22'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora22

Comment 3 Fedora End Of Life 2016-07-19 10:38:15 UTC
Fedora 22 changed to end-of-life (EOL) status on 2016-07-19. Fedora 22 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.