diff --git a/cinder/tests/unit/volume/drivers/test_nimble.py b/cinder/tests/unit/volume/drivers/test_nimble.py index 1f35c91f1d4..5fdbb77040e 100644 --- a/cinder/tests/unit/volume/drivers/test_nimble.py +++ b/cinder/tests/unit/volume/drivers/test_nimble.py @@ -197,9 +197,7 @@ FAKE_POSITIVE_GROUP_INFO_RESPONSE = { 'name': 'group-nimble', 'usage_valid': True, 'usable_capacity_bytes': 8016883089408, - 'compressed_vol_usage_bytes': 2938311843, - 'compressed_snap_usage_bytes': 36189, - 'unused_reserve_bytes': 0} + 'free_space': 101111111901} FAKE_GET_VOL_INFO_RESPONSE = {'name': 'testvolume-cg', 'clone': False, @@ -1136,7 +1134,7 @@ class NimbleDriverVolumeTestCase(NimbleDriverBaseTestCase): 'storage_protocol': 'iSCSI', 'pools': [{'pool_name': 'NIMBLE', 'total_capacity_gb': 7466.30419921875, - 'free_capacity_gb': 7463.567649364471, + 'free_capacity_gb': 94.16706105787307, 'reserved_percentage': 0, 'QoS_support': False, 'multiattach': True, diff --git a/cinder/volume/drivers/nimble.py b/cinder/volume/drivers/nimble.py index 56cd702d1c7..cc5202fb992 100644 --- a/cinder/volume/drivers/nimble.py +++ b/cinder/volume/drivers/nimble.py @@ -382,15 +382,11 @@ class NimbleBaseVolumeDriver(san.SanDriver): 'array is invalid')) total_capacity = (group_info['usable_capacity_bytes'] / float(units.Gi)) - used_space = ((group_info['compressed_vol_usage_bytes'] + - group_info['compressed_snap_usage_bytes'] + - group_info['unused_reserve_bytes']) / + free_space = (group_info['free_space'] / float(units.Gi)) - free_space = total_capacity - used_space LOG.debug('total_capacity=%(capacity)f ' - 'used_space=%(used)f free_space=%(free)f', + 'free_space=%(free)f', {'capacity': total_capacity, - 'used': used_space, 'free': free_space}) backend_name = self.configuration.safe_get( diff --git a/releasenotes/notes/bug-1918229-0aa9fd75c5e843d5.yaml b/releasenotes/notes/bug-1918229-0aa9fd75c5e843d5.yaml new file mode 100644 index 00000000000..c64f4ee5fff --- /dev/null +++ b/releasenotes/notes/bug-1918229-0aa9fd75c5e843d5.yaml @@ -0,0 +1,8 @@ +--- +fixes: + - | + Nimble driver `bug #1918229 + `_: Corrected an issue + where the Nimble storage driver was inaccurately determining that there + was no free space left in the storage array. The driver now relies on the + storage array to report the amount of free space.