Bug 1302584 - CapacityFilter in capacity_filter.py does not calculate correctly
CapacityFilter in capacity_filter.py does not calculate correctly
Status: CLOSED DUPLICATE of bug 1302586
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-cinder (Show other bugs)
6.0 (Juno)
Unspecified Unspecified
medium Severity high
: ---
: 8.0 (Liberty)
Assigned To: Eric Harney
nlevinki
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-01-28 03:33 EST by Shinobu KINJO
Modified: 2016-04-26 09:51 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-01-28 06:13:28 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Shinobu KINJO 2016-01-28 03:33:08 EST
Description of problem:

In order to calculate free space correctly, free needs to be based on free_space value.
Is it possible to backport CapacityFilter class in [2] to Juno based OSP?


  [1] openstack-cinder-2014.2.4-2.el7ost.noarch
   29 class CapacityFilter(filters.BaseHostFilter):
   30     """CapacityFilter filters based on volume host's capacity utilization."""
   31 
   32     def host_passes(self, host_state, filter_properties):
     ...
   55         reserved = float(host_state.reserved_percentage) / 100
   56         free = math.floor(free_space * (1 - reserved))


  [2] openstack-cinder-2015.1.2-5.el7ost.noarch
   31 class CapacityFilter(filters.BaseHostFilter):
   32     """CapacityFilter filters based on volume host's capacity utilization."""
   33 
   34     def host_passes(self, host_state, filter_properties):
     ...
   50         free_space = host_state.free_capacity_gb
   51         total_space = host_state.total_capacity_gb
   52         reserved = float(host_state.reserved_percentage) / 100
     ...
   78         free = free_space - math.floor(total * reserved)

Rgds,
Shinobu

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

  [1] openstack-cinder-2014.2.4-2.el7ost.noarch.rpm

How reproducible:

Steps to Reproduce:
1.
2.
3.

Actual results:

Expected results:

Additional info:
Comment 2 Sergey Gotliv 2016-01-28 06:13:28 EST
I guess this is a dup of BZ#1302586.

*** This bug has been marked as a duplicate of bug 1302586 ***

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