Recognize Dell PowerMax Unisphere 10.x (x>0)

Fixes an issue introduced by change Ie9561eeb30a54539cbd, which added
support for PowerMax Unisphere 10.

Closes-bug: #2051828
Change-Id: Ib66688f319d6aed5d7339f4eabdd7ca9ce7e0f6c
This commit is contained in:
Yian Zong 2023-11-09 06:16:01 +00:00
parent 4ee1bdaf64
commit 5d725806ff
4 changed files with 77 additions and 25 deletions

View File

@ -2429,6 +2429,27 @@ class PowerMaxRestTest(test.TestCase):
request_count = mock_req.call_count
self.assertEqual(1, request_count)
def test_validate_unisphere_version_101(self):
version = 'T10.1.0.501'
returned_version = {'version': version}
with mock.patch.object(self.rest, "request",
return_value=(200,
returned_version)) as mock_req:
valid_version = self.rest.validate_unisphere_version()
self.assertTrue(valid_version)
self.assertEqual(self.rest.u4p_version, rest.U4P_100_VERSION)
request_count = mock_req.call_count
self.assertEqual(1, request_count)
def test_validate_unisphere_version_110(self):
version = 'T11.1.0.501'
returned_version = {'version': version}
with mock.patch.object(self.rest, "request",
return_value=(200,
returned_version)):
self.assertRaises(exception.InvalidConfigurationValue,
self.rest.validate_unisphere_version)
@mock.patch.object(rest.PowerMaxRest, '_build_uri_kwargs')
@mock.patch.object(rest.PowerMaxRest, '_build_uri_legacy_args')
def test_build_uri_legacy(self, mck_build_legacy, mck_build_kwargs):

View File

@ -35,6 +35,7 @@ LOG = logging.getLogger(__name__)
SLOPROVISIONING = 'sloprovisioning'
REPLICATION = 'replication'
SYSTEM = 'system'
U4P_110_VERSION = '110'
U4P_100_VERSION = '100'
MIN_U4P_100_VERSION = '10.0.0.0'
U4P_92_VERSION = '92'
@ -760,9 +761,11 @@ class PowerMaxRest(object):
version, major_version = None, None
response = self.get_unisphere_version()
if response and response.get('version'):
version = response['version']
version_list = version.split('.')
major_version = version_list[0][1:] + version_list[1]
regex = re.compile(r'^[a-zA-Z]\d+(.\d+){3}$')
if regex.match(response['version']):
version = response['version']
version_list = version.split('.')
major_version = version_list[0][1:] + version_list[1]
return version, major_version
def get_unisphere_version(self):
@ -3462,18 +3465,28 @@ class PowerMaxRest(object):
def validate_unisphere_version(self):
"""Validate that the running Unisphere version meets min requirement
:raises: InvalidConfigurationValue
:returns: unisphere_meets_min_req -- boolean
"""
running_version, major_version = self.get_uni_version()
if major_version == U4P_100_VERSION:
self.u4p_version = U4P_100_VERSION
minimum_version = MIN_U4P_100_VERSION
elif major_version:
self.u4p_version = U4P_92_VERSION
minimum_version = MIN_U4P_92_VERSION
unisphere_meets_min_req = False
self.u4p_version = U4P_92_VERSION
minimum_version = MIN_U4P_92_VERSION
running_version, major_version = self.get_uni_version()
if not running_version or not major_version:
LOG.warning("Unable to validate Unisphere instance meets minimum "
"requirements.")
else:
if int(major_version) >= int(U4P_110_VERSION):
msg = _("Unisphere version %(running_version)s "
"is not supported.") % {
'running_version': running_version}
LOG.error(msg)
raise exception.InvalidConfigurationValue(message=msg)
if int(major_version) >= int(U4P_100_VERSION):
self.u4p_version = U4P_100_VERSION
minimum_version = MIN_U4P_100_VERSION
if running_version and (running_version[0].isalpha()):
# remove leading letter
if running_version.lower()[0] == QUAL_CODE:
version = running_version[1:]
@ -3485,20 +3498,18 @@ class PowerMaxRest(object):
"Unisphere.", {'version': running_version})
return int(major_version) >= int(self.u4p_version)
if unisphere_meets_min_req:
LOG.info("Unisphere version %(running_version)s meets minimum "
"requirement of version %(minimum_version)s.",
{'running_version': running_version,
'minimum_version': minimum_version})
elif running_version:
LOG.error("Unisphere version %(running_version)s does not meet "
"minimum requirement for use with this release, please "
"upgrade to Unisphere %(minimum_version)s at minimum.",
{'running_version': running_version,
'minimum_version': minimum_version})
else:
LOG.warning("Unable to validate Unisphere instance meets minimum "
"requirements.")
if unisphere_meets_min_req:
LOG.info("Unisphere version %(running_version)s meets minimum "
"requirement of version %(minimum_version)s.",
{'running_version': running_version,
'minimum_version': minimum_version})
else:
LOG.error("Unisphere version %(running_version)s does "
"not meet minimum requirement for use with this "
"release, please upgrade to Unisphere "
"%(minimum_version)s at minimum.",
{'running_version': running_version,
'minimum_version': minimum_version})
return unisphere_meets_min_req

View File

@ -59,6 +59,18 @@ Guide` at the `Dell Support`_ site.
| OpenStack | Unisphere | PowerMax OS | Supported Arrays |
| release | for PowerMax | | |
+===========+==============+=============+================================+
| Caracal | 10.1.0 | 10.1.0 | PowerMax 2500,8500 |
| | | (6079.225) | |
| | +-------------+--------------------------------+
| | | 5978.711 | PowerMax 2000,8000 |
| | | | VMAX 250F, 450F, 850F, 950F |
+-----------+--------------+-------------+--------------------------------+
| Bobcat | 10.0.1 | 10.0.1 | PowerMax 2500,8500 |
| | | (6079.175) | |
| | +-------------+--------------------------------+
| | | 5978.711 | PowerMax 2000,8000 |
| | | | VMAX 250F, 450F, 850F, 950F |
+-----------+--------------+-------------+--------------------------------+
| Antelope | 10.0.1 | 10.0.1 | PowerMax 2500,8500 |
| | | (6079.175) | |
| | +-------------+--------------------------------+

View File

@ -0,0 +1,8 @@
---
fixes:
- |
Dell PowerMax driver 'bug #2051828
<https://bugs.launchpad.net/cinder/+bug/2051828>`_: The driver
only recognized 10.0 as being Unisphere 10 and would try to
use 9.2 for Unisphere 10.x (where x > 0), but now it correctly
recognizes 10.x as being Unisphere 10.