diff --git a/cinder/tests/unit/volume/drivers/dell_emc/test_ps.py b/cinder/tests/unit/volume/drivers/dell_emc/test_ps.py index 0ddccc8d200..43c48749f87 100644 --- a/cinder/tests/unit/volume/drivers/dell_emc/test_ps.py +++ b/cinder/tests/unit/volume/drivers/dell_emc/test_ps.py @@ -58,7 +58,8 @@ class PSSeriesISCSIDriverTestCase(test.TestCase): self.driver_stats_output = ['TotalCapacity: 111GB', 'FreeSpace: 11GB', - 'VolumeReserve: 80GB'] + 'VolumeReserve: 80GB', + 'TotalVolumes: 100'] self.cmd = 'this is dummy command' self._context = context.get_admin_context() self.driver = ps.PSSeriesISCSIDriver( @@ -410,6 +411,7 @@ class PSSeriesISCSIDriverTestCase(test.TestCase): thin_enabled = self.configuration.san_thin_provision self.assertEqual(float('111.0'), stats['total_capacity_gb']) self.assertEqual(float('11.0'), stats['free_capacity_gb']) + self.assertEqual(100, stats['total_volumes']) if thin_enabled: self.assertEqual(80.0, stats['provisioned_capacity_gb']) diff --git a/cinder/volume/drivers/dell_emc/ps.py b/cinder/volume/drivers/dell_emc/ps.py index 09b12064c6a..a6d7fb1d440 100644 --- a/cinder/volume/drivers/dell_emc/ps.py +++ b/cinder/volume/drivers/dell_emc/ps.py @@ -136,10 +136,11 @@ class PSSeriesISCSIDriver(san.SanISCSIDriver): eqlx_chap_login, and eqlx_chap_password. 1.4.1 - Rebranded driver to Dell EMC. 1.4.2 - Enable report discard support. + 1.4.3 - Report total_volumes in volume stats """ - VERSION = "1.4.2" + VERSION = "1.4.3" # ThirdPartySytems wiki page CI_WIKI_NAME = "Dell_Storage_CI" @@ -302,6 +303,7 @@ class PSSeriesISCSIDriver(san.SanISCSIDriver): data['total_capacity_gb'] = 0 data['free_capacity_gb'] = 0 data['multiattach'] = False + data['total_volumes'] = 0 provisioned_capacity = 0 @@ -316,6 +318,9 @@ class PSSeriesISCSIDriver(san.SanISCSIDriver): if line.startswith('VolumeReserve:'): out_tup = line.rstrip().partition(' ') provisioned_capacity = self._get_space_in_gb(out_tup[-1]) + if line.startswith('TotalVolumes:'): + out_tup = line.rstrip().partition(' ') + data['total_volumes'] = int(out_tup[-1]) global_capacity = data['total_capacity_gb'] global_free = data['free_capacity_gb'] diff --git a/releasenotes/notes/ps-report-total-volumes-8aa447c50f2474a7.yaml b/releasenotes/notes/ps-report-total-volumes-8aa447c50f2474a7.yaml new file mode 100644 index 00000000000..68d852b5bb7 --- /dev/null +++ b/releasenotes/notes/ps-report-total-volumes-8aa447c50f2474a7.yaml @@ -0,0 +1,4 @@ +--- +features: + - Dell EMC PS volume driver reports the total number + of volumes on the backend in volume stats.