Browse Source

Merge "Bug fix for free space calculation"

changes/77/789077/1
Zuul 2 weeks ago
committed by Gerrit Code Review
parent
commit
f3e3356fcf
3 changed files with 12 additions and 10 deletions
  1. +2
    -4
      cinder/tests/unit/volume/drivers/test_nimble.py
  2. +2
    -6
      cinder/volume/drivers/nimble.py
  3. +8
    -0
      releasenotes/notes/bug-1918229-0aa9fd75c5e843d5.yaml

+ 2
- 4
cinder/tests/unit/volume/drivers/test_nimble.py View File

@ -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,


+ 2
- 6
cinder/volume/drivers/nimble.py View File

@ -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(


+ 8
- 0
releasenotes/notes/bug-1918229-0aa9fd75c5e843d5.yaml View File

@ -0,0 +1,8 @@
---
fixes:
- |
Nimble driver `bug #1918229
<https://bugs.launchpad.net/cinder/+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.

Loading…
Cancel
Save