]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Fix free_capacity reporting in SolidFire driver
authorjohn-griffith <john.griffith@solidfire.com>
Tue, 25 Feb 2014 06:02:11 +0000 (23:02 -0700)
committerjohn-griffith <john.griffith@solidfire.com>
Tue, 25 Feb 2014 15:17:44 +0000 (08:17 -0700)
The SolidFire driver reports capacity info in bytes, the
capabilities update reports available_GB.  Sadly we neglected
to convert the bytes to gigibytes here which made for a VERY
large backend and caused things like capacity filtering to not
work correctly.

This patch just adds conversion to GiB when reporting capabilities.

Change-Id: I62c6ad2edd8c2ced344df766c198504894f4902b
Closes-Bug: 1284452

cinder/volume/drivers/solidfire.py

index a50877eec292ea69002e925555466c2e21d87a74..5ed33134e53aaa82e8a62192243d4ab835849cae 100644 (file)
@@ -683,7 +683,7 @@ class SolidFireDriver(SanISCSIDriver):
 
         data['total_capacity_gb'] = results['maxProvisionedSpace']
 
-        data['free_capacity_gb'] = float(free_capacity)
+        data['free_capacity_gb'] = float(free_capacity / units.GiB)
         data['reserved_percentage'] = 0
         data['QoS_support'] = True
         data['compression_percent'] =\