Bug 1034721 - LVMThinPoolDevice.freeSpace returns negative number
Summary: LVMThinPoolDevice.freeSpace returns negative number
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: python-blivet
Version: 22
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Vratislav Podzimek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-11-26 11:58 UTC by Jan Synacek
Modified: 2016-07-19 10:38 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-19 10:38:15 UTC
Type: Bug


Attachments (Terms of Use)

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.


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