Dell EMC PS: Report total volumes on the backend

Adds support to report total_volumes in the volume stats. Total number
of volumes on the storage backend can be used in custom driver
filter functions.

Change-Id: I4dcbfada009efa4157558967dce3272c641ed324
Implements: blueprint ps-report-total-volumes
Closes-Bug: #1714338
This commit is contained in:
rajinir 2017-08-31 14:23:18 -05:00
parent e9f09a25e6
commit a8a4518580
3 changed files with 13 additions and 2 deletions

View File

@ -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'])

View File

@ -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']

View File

@ -0,0 +1,4 @@
---
features:
- Dell EMC PS volume driver reports the total number
of volumes on the backend in volume stats.