From 6119b361d43ba124c861cd8618968ce817fe6e92 Mon Sep 17 00:00:00 2001 From: Avishay Traeger Date: Wed, 31 Jul 2013 12:27:21 +0300 Subject: [PATCH] Storwize/SVC: Use reserved percentage from conf. For reserved_percentage, use the value from the configuration file instead of 0. Change-Id: I549822c09449f8d9fc0c8b84d56660c381bddbd5 --- cinder/tests/test_storwize_svc.py | 2 ++ cinder/volume/drivers/storwize_svc.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cinder/tests/test_storwize_svc.py b/cinder/tests/test_storwize_svc.py index 02b1b59b2..ea2f27291 100644 --- a/cinder/tests/test_storwize_svc.py +++ b/cinder/tests/test_storwize_svc.py @@ -1949,9 +1949,11 @@ class StorwizeSVCDriverTestCase(test.TestCase): self.fail('%s not less than or equal to %s' % (repr(a), repr(b))) def test_storwize_svc_get_volume_stats(self): + self._set_flag('reserved_percentage', 25) stats = self.driver.get_volume_stats() self.assertLessEqual(stats['free_capacity_gb'], stats['total_capacity_gb']) + self.assertEquals(stats['reserved_percentage'], 25) if self.USESIM: self.assertEqual(stats['volume_backend_name'], 'storwize-svc-sim_volpool') diff --git a/cinder/volume/drivers/storwize_svc.py b/cinder/volume/drivers/storwize_svc.py index 85ad8fbec..8f803975e 100755 --- a/cinder/volume/drivers/storwize_svc.py +++ b/cinder/volume/drivers/storwize_svc.py @@ -1371,7 +1371,7 @@ class StorwizeSVCDriver(san.SanDriver): data['total_capacity_gb'] = 0 # To be overwritten data['free_capacity_gb'] = 0 # To be overwritten - data['reserved_percentage'] = 0 + data['reserved_percentage'] = self.configuration.reserved_percentage data['QoS_support'] = False pool = self.configuration.storwize_svc_volpool_name -- 2.45.2