ScaleIO Driver - include snap usage in provisioned capacity

Provisioned capacity of storage pools was not correctly accounting
for space used by snapshots.

Change-Id: I945300cac84658bbd25182ba615645af881920f8
Closes-Bug: #1724929
(cherry picked from commit 64180530c1)
This commit is contained in:
Eric Young 2017-10-19 15:01:07 -04:00 committed by Eric Harney
parent 983ed799d7
commit a36d041c2a
2 changed files with 4 additions and 0 deletions

View File

@ -67,6 +67,7 @@ class TestMisc(scaleio.TestScaleIODriver):
'spareCapacityInKb': 6000000,
'thickCapacityInUseInKb': 266,
'thinCapacityAllocatedInKm': 0,
'snapCapacityInUseInKb': 266,
},
},
'instances/Volume::{}/action/setVolumeName'.format(
@ -200,6 +201,7 @@ class TestMisc(scaleio.TestScaleIODriver):
'capacityLimitInKb': 16000000,
'spareCapacityInKb': 6000000,
'thickCapacityInUseInKb': 266,
'snapCapacityInUseInKb': 266,
property: 0,
},
},

View File

@ -318,6 +318,7 @@ class ScaleIODriver(driver.VolumeDriver):
def _get_queryable_statistics(self, sio_type, sio_id):
if self.statisticProperties is None:
self.statisticProperties = [
"snapCapacityInUseInKb",
"capacityAvailableForVolumeAllocationInKb",
"capacityLimitInKb", "spareCapacityInKb",
"thickCapacityInUseInKb"]
@ -971,6 +972,7 @@ class ScaleIODriver(driver.VolumeDriver):
# Divide by two because ScaleIO creates a copy for each volume
provisioned_capacity = (
((res['thickCapacityInUseInKb'] +
res['snapCapacityInUseInKb'] +
thin_capacity_allocated) / 2) / units.Mi)
LOG.info("Free capacity of pool %(pool)s is: %(free)s, "