Merge "VMAX driver - Incorrect stats reporting"

This commit is contained in:
Zuul 2018-01-14 14:07:55 +00:00 committed by Gerrit Code Review
commit 5420a050b2
3 changed files with 12 additions and 11 deletions

View File

@ -507,9 +507,10 @@ class VMAXCommonData(object):
srp_details = {"srpSloDemandId": ["Bronze", "Diamond", "Gold",
"None", "Optimized", "Silver"],
"srpId": srp,
"total_allocated_cap_gb": 5244.7,
"total_used_cap_gb": 5244.7,
"total_usable_cap_gb": 20514.4,
"total_subscribed_cap_gb": 84970.1,
"fba_used_capacity": 5244.7,
"reserved_cap_percent": 10}
volume_details = [{"cap_gb": 2,
@ -2994,7 +2995,7 @@ class VMAXProvisionTest(test.TestCase):
array_info = self.common.pool_info['arrays_info'][0]
ref_stats = (self.data.srp_details['total_usable_cap_gb'],
float(self.data.srp_details['total_usable_cap_gb']
- self.data.srp_details['total_allocated_cap_gb']),
- self.data.srp_details['total_used_cap_gb']),
self.data.srp_details['total_subscribed_cap_gb'],
self.data.srp_details['reserved_cap_percent'])
stats = self.provision.get_srp_pool_stats(array, array_info)

View File

@ -817,6 +817,9 @@ class VMAXCommon(object):
(location_info, total_capacity_gb, free_capacity_gb,
provisioned_capacity_gb,
array_reserve_percent) = self._update_srp_stats(array_info)
arrays[array_info['SerialNumber']] = (
[total_capacity_gb, free_capacity_gb,
provisioned_capacity_gb, array_reserve_percent])
else:
already_queried = True
pool_name = ("%(slo)s+%(workload)s+%(srpName)s+%(array)s"

View File

@ -294,7 +294,6 @@ class VMAXProvision(object):
"""
total_capacity_gb = 0
remaining_capacity_gb = 0
allocated_capacity_gb = None
subscribed_capacity_gb = 0
array_reserve_percent = 0
srp = array_info['srpName']
@ -310,19 +309,17 @@ class VMAXProvision(object):
return 0, 0, 0, 0, False
try:
total_capacity_gb = srp_details['total_usable_cap_gb']
allocated_capacity_gb = srp_details['total_allocated_cap_gb']
try:
used_capacity_gb = srp_details['total_used_cap_gb']
remaining_capacity_gb = float(
total_capacity_gb - used_capacity_gb)
except KeyError:
remaining_capacity_gb = srp_details['fba_free_capacity']
subscribed_capacity_gb = srp_details['total_subscribed_cap_gb']
remaining_capacity_gb = float(
total_capacity_gb - allocated_capacity_gb)
array_reserve_percent = srp_details['reserved_cap_percent']
except KeyError:
pass
LOG.debug(
"Remaining capacity %(remaining_capacity_gb)s "
"GBs is determined from SRP capacity ",
{'remaining_capacity_gb': remaining_capacity_gb})
return (total_capacity_gb, remaining_capacity_gb,
subscribed_capacity_gb, array_reserve_percent)