diff --git a/cinder/tests/unit/volume/drivers/dell_emc/powermax/test_powermax_rest.py b/cinder/tests/unit/volume/drivers/dell_emc/powermax/test_powermax_rest.py index d3c1a2ae88b..5ba487e051e 100644 --- a/cinder/tests/unit/volume/drivers/dell_emc/powermax/test_powermax_rest.py +++ b/cinder/tests/unit/volume/drivers/dell_emc/powermax/test_powermax_rest.py @@ -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): diff --git a/cinder/volume/drivers/dell_emc/powermax/rest.py b/cinder/volume/drivers/dell_emc/powermax/rest.py index ed945c54e52..52d27f0c9c9 100644 --- a/cinder/volume/drivers/dell_emc/powermax/rest.py +++ b/cinder/volume/drivers/dell_emc/powermax/rest.py @@ -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 diff --git a/doc/source/configuration/block-storage/drivers/dell-emc-powermax-driver.rst b/doc/source/configuration/block-storage/drivers/dell-emc-powermax-driver.rst index 73e9e3f697d..9620b17f899 100644 --- a/doc/source/configuration/block-storage/drivers/dell-emc-powermax-driver.rst +++ b/doc/source/configuration/block-storage/drivers/dell-emc-powermax-driver.rst @@ -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) | | | | +-------------+--------------------------------+ diff --git a/releasenotes/notes/dell-powermax-unisphere-v101-7195af74d1c7671c.yaml b/releasenotes/notes/dell-powermax-unisphere-v101-7195af74d1c7671c.yaml new file mode 100644 index 00000000000..62c144d9c96 --- /dev/null +++ b/releasenotes/notes/dell-powermax-unisphere-v101-7195af74d1c7671c.yaml @@ -0,0 +1,8 @@ +--- +fixes: + - | + Dell PowerMax driver '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.