Dell EMC PS: Optimize parsing of capacity info from backend

The backend api returns large amounts of information and
times out when there are lots of volumes. Accelerated the
process by terminating the parsing after the capacity info
is retrieved.

Closes Bug: #1661154

Change-Id: I1f0adaa8e25cd3ec74084b22bbe1573b92713959
(cherry picked from commit a9a0c2ee2e)
This commit is contained in:
rajinir 2017-10-02 10:51:48 -05:00 committed by Rajini Karthik
parent dd1030a54b
commit 02e858b5da
2 changed files with 15 additions and 6 deletions

View File

@ -158,11 +158,12 @@ class DellEQLSanISCSIDriver(san.SanISCSIDriver):
1.1.0 - Misc fixes
1.2.0 - Deprecated eqlx_cli_timeout infavor of ssh_conn_timeout
1.3.0 - Added support for manage/unmanage volume
1.3.0a - Fixed over-subscription ratio calculation
1.4.4 - Fixed over-subscription ratio calculation
1.4.5 - Optimize volume stats information parsing
"""
VERSION = "1.3.0a"
VERSION = "1.4.5"
# ThirdPartySytems wiki page
CI_WIKI_NAME = "Dell_Storage_CI"
@ -344,12 +345,11 @@ class DellEQLSanISCSIDriver(san.SanISCSIDriver):
data['reserved_percentage'] = 0
data['QoS_support'] = False
data['total_capacity_gb'] = 0
data['free_capacity_gb'] = 0
data['total_capacity_gb'] = None
data['free_capacity_gb'] = None
data['multiattach'] = True
provisioned_capacity = 0
provisioned_capacity = None
for line in self._eql_execute('pool', 'select',
self.configuration.eqlx_pool, 'show'):
if line.startswith('TotalCapacity:'):
@ -361,6 +361,10 @@ class DellEQLSanISCSIDriver(san.SanISCSIDriver):
if line.startswith('VolumeReportedSpace:'):
out_tup = line.rstrip().partition(' ')
provisioned_capacity = self._get_space_in_gb(out_tup[-1])
# Terminate parsing once this data is found to improve performance
if (data['total_capacity_gb'] and data['free_capacity_gb'] and
provisioned_capacity):
break
global_capacity = data['total_capacity_gb']
global_free = data['free_capacity_gb']

View File

@ -0,0 +1,5 @@
---
fixes:
- Dell EMC PS Series Driver code reporting volume stats is now optimized
to return the information earlier and accelerate the process. This change
fixes bug 1661154.