diff --git a/cinder/tests/unit/volume/drivers/dell_emc/vmax/test_vmax.py b/cinder/tests/unit/volume/drivers/dell_emc/vmax/test_vmax.py index b38efb1ee80..1262fa2267e 100644 --- a/cinder/tests/unit/volume/drivers/dell_emc/vmax/test_vmax.py +++ b/cinder/tests/unit/volume/drivers/dell_emc/vmax/test_vmax.py @@ -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) diff --git a/cinder/volume/drivers/dell_emc/vmax/common.py b/cinder/volume/drivers/dell_emc/vmax/common.py index 6f5da6558f1..9b0c81e72e4 100644 --- a/cinder/volume/drivers/dell_emc/vmax/common.py +++ b/cinder/volume/drivers/dell_emc/vmax/common.py @@ -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" diff --git a/cinder/volume/drivers/dell_emc/vmax/provision.py b/cinder/volume/drivers/dell_emc/vmax/provision.py index efc8f994e91..587ad96e0ac 100644 --- a/cinder/volume/drivers/dell_emc/vmax/provision.py +++ b/cinder/volume/drivers/dell_emc/vmax/provision.py @@ -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)