diff --git a/cinder/tests/unit/volume/drivers/test_seagate.py b/cinder/tests/unit/volume/drivers/test_seagate.py index 472121d64ee..85ae0dd6e2b 100644 --- a/cinder/tests/unit/volume/drivers/test_seagate.py +++ b/cinder/tests/unit/volume/drivers/test_seagate.py @@ -255,8 +255,8 @@ class TestSeagateClient(test.TestCase): @mock.patch.object(STXClient, '_request') def test_backend_stats(self, mock_request): - stats = {'free_capacity_gb': 1979, - 'total_capacity_gb': 1979} + stats = {'free_capacity_gb': 1843, + 'total_capacity_gb': 1843} linear = etree.XML(response_stats_linear) virtual = etree.XML(response_stats_virtual) mock_request.side_effect = [linear, virtual] diff --git a/cinder/volume/drivers/stx/client.py b/cinder/volume/drivers/stx/client.py index f3a6951abde..598efe11697 100644 --- a/cinder/volume/drivers/stx/client.py +++ b/cinder/volume/drivers/stx/client.py @@ -338,7 +338,7 @@ class STXClient(object): return False def _get_size(self, size): - return int(math.ceil(float(size) * 512 / (units.G))) + return int(math.ceil(float(size) * 512 / (units.Gi))) def backend_stats(self, backend_name, backend_type): stats = {'free_capacity_gb': 0, diff --git a/releasenotes/notes/fix-size-reporting-seagate-driver.rst b/releasenotes/notes/fix-size-reporting-seagate-driver.rst new file mode 100644 index 00000000000..9286352c726 --- /dev/null +++ b/releasenotes/notes/fix-size-reporting-seagate-driver.rst @@ -0,0 +1,5 @@ +--- +fixes: + - | + Seagate, HPE MSA, Dell PowerVault, Lenovo drivers: report volume + size in GiB (2^30) rather than GB (10^9).