Revert "Correct RBD Provision stats&fix a perf problem"

This reverts commit b907450d7d.

Even though this approach should perform better, the value it calculates
is not what the scheduler expects, we should be returning allocated
size.

We'll address the performance issue in a follow up patch

Change-Id: I01b8fb2302884c3ed398f9553bb8e6a2aeb307c7
This commit is contained in:
Jon Bernard 2017-07-12 13:35:19 -04:00
parent 431d356c8a
commit 86e8cf948a

View File

@ -360,6 +360,10 @@ class RBDDriver(driver.CloneableImageVD,
ports.append(port)
return hosts, ports
def _iterate_cb(self, offset, length, exists):
if exists:
self._total_usage += length
def _get_usage_info(self):
with RADOSClient(self) as client:
for t in self.RBDProxy().list(client.ioctx):
@ -368,7 +372,7 @@ class RBDDriver(driver.CloneableImageVD,
# non-default volume_name_template settings. Template
# must start with "volume".
with RBDVolumeProxy(self, t, read_only=True) as v:
self._total_usage += v.size()
v.diff_iterate(0, v.size(), None, self._iterate_cb)
def _update_volume_stats(self):
stats = {