diff --git a/cinder/tests/unit/volume/drivers/hitachi/test_hitachi_hbsd_mirror_fc.py b/cinder/tests/unit/volume/drivers/hitachi/test_hitachi_hbsd_mirror_fc.py index 58877572a1a..e65c2fde7c8 100644 --- a/cinder/tests/unit/volume/drivers/hitachi/test_hitachi_hbsd_mirror_fc.py +++ b/cinder/tests/unit/volume/drivers/hitachi/test_hitachi_hbsd_mirror_fc.py @@ -546,7 +546,7 @@ class HBSDMIRRORFCDriverTest(test.TestCase): self.configuration.driver_ssl_cert_verify = False self.configuration.hitachi_storage_id = CONFIG_MAP['serial'] - self.configuration.hitachi_pool = ["30"] + self.configuration.hitachi_pools = ["30"] self.configuration.hitachi_snap_pool = None self.configuration.hitachi_ldev_range = "0-1" self.configuration.hitachi_target_ports = [CONFIG_MAP['port_id']] diff --git a/cinder/tests/unit/volume/drivers/hitachi/test_hitachi_hbsd_rest_fc.py b/cinder/tests/unit/volume/drivers/hitachi/test_hitachi_hbsd_rest_fc.py index 3743a2cb3e9..63e48b5bdd0 100644 --- a/cinder/tests/unit/volume/drivers/hitachi/test_hitachi_hbsd_rest_fc.py +++ b/cinder/tests/unit/volume/drivers/hitachi/test_hitachi_hbsd_rest_fc.py @@ -492,7 +492,7 @@ class HBSDRESTFCDriverTest(test.TestCase): self.configuration.driver_ssl_cert_verify = False self.configuration.hitachi_storage_id = CONFIG_MAP['serial'] - self.configuration.hitachi_pool = ["30"] + self.configuration.hitachi_pools = ["30"] self.configuration.hitachi_snap_pool = None self.configuration.hitachi_ldev_range = "0-1" self.configuration.hitachi_target_ports = [CONFIG_MAP['port_id']] @@ -760,8 +760,8 @@ class HBSDRESTFCDriverTest(test.TestCase): drv = hbsd_fc.HBSDFCDriver( configuration=self.configuration) self._setup_config() - tmp_pool = self.configuration.hitachi_pool - self.configuration.hitachi_pool = [CONFIG_MAP['pool_name']] + tmp_pools = self.configuration.hitachi_pools + self.configuration.hitachi_pools = [CONFIG_MAP['pool_name']] request.side_effect = [FakeResponse(200, POST_SESSIONS_RESULT), FakeResponse(200, GET_POOLS_RESULT), FakeResponse(200, GET_PORTS_RESULT), @@ -773,7 +773,7 @@ class HBSDRESTFCDriverTest(test.TestCase): drv.common.storage_info['wwns']) self.assertEqual(1, brick_get_connector_properties.call_count) self.assertEqual(5, request.call_count) - self.configuration.hitachi_pool = tmp_pool + self.configuration.hitachi_pools = tmp_pools # stop the Loopingcall within the do_setup treatment self.driver.common.client.keep_session_loop.stop() self.driver.common.client.keep_session_loop.wait() diff --git a/cinder/tests/unit/volume/drivers/hitachi/test_hitachi_hbsd_rest_iscsi.py b/cinder/tests/unit/volume/drivers/hitachi/test_hitachi_hbsd_rest_iscsi.py index 6306e8cd36a..9d79a1031e0 100644 --- a/cinder/tests/unit/volume/drivers/hitachi/test_hitachi_hbsd_rest_iscsi.py +++ b/cinder/tests/unit/volume/drivers/hitachi/test_hitachi_hbsd_rest_iscsi.py @@ -344,7 +344,7 @@ class HBSDRESTISCSIDriverTest(test.TestCase): self.configuration.driver_ssl_cert_verify = False self.configuration.hitachi_storage_id = CONFIG_MAP['serial'] - self.configuration.hitachi_pool = ['30'] + self.configuration.hitachi_pools = ['30'] self.configuration.hitachi_snap_pool = None self.configuration.hitachi_ldev_range = "0-1" self.configuration.hitachi_target_ports = [CONFIG_MAP['port_id']] diff --git a/cinder/tests/unit/volume/drivers/hpe/xp/test_hpe_xp_rest_fc.py b/cinder/tests/unit/volume/drivers/hpe/xp/test_hpe_xp_rest_fc.py index d8c52f95884..1499964c3aa 100644 --- a/cinder/tests/unit/volume/drivers/hpe/xp/test_hpe_xp_rest_fc.py +++ b/cinder/tests/unit/volume/drivers/hpe/xp/test_hpe_xp_rest_fc.py @@ -426,7 +426,7 @@ class HPEXPRESTFCDriverTest(test.TestCase): self.configuration.driver_ssl_cert_verify = False self.configuration.hpexp_storage_id = CONFIG_MAP['serial'] - self.configuration.hpexp_pool = ["30"] + self.configuration.hpexp_pools = ["30"] self.configuration.hpexp_snap_pool = None self.configuration.hpexp_ldev_range = "0-1" self.configuration.hpexp_target_ports = [CONFIG_MAP['port_id']] @@ -593,8 +593,8 @@ class HPEXPRESTFCDriverTest(test.TestCase): drv = hpe_xp_fc.HPEXPFCDriver( configuration=self.configuration) self._setup_config() - tmp_pool = self.configuration.hitachi_pool - self.configuration.hitachi_pool = [CONFIG_MAP['pool_name']] + tmp_pools = self.configuration.hitachi_pools + self.configuration.hitachi_pools = [CONFIG_MAP['pool_name']] request.side_effect = [FakeResponse(200, POST_SESSIONS_RESULT), FakeResponse(200, GET_POOLS_RESULT), FakeResponse(200, GET_PORTS_RESULT), @@ -605,7 +605,7 @@ class HPEXPRESTFCDriverTest(test.TestCase): drv.common.storage_info['wwns']) self.assertEqual(1, brick_get_connector_properties.call_count) self.assertEqual(4, request.call_count) - self.configuration.hitachi_pool = tmp_pool + self.configuration.hitachi_pools = tmp_pools # stop the Loopingcall within the do_setup treatment self.driver.common.client.keep_session_loop.stop() self.driver.common.client.keep_session_loop.wait() diff --git a/cinder/tests/unit/volume/drivers/hpe/xp/test_hpe_xp_rest_iscsi.py b/cinder/tests/unit/volume/drivers/hpe/xp/test_hpe_xp_rest_iscsi.py index be902e674ec..18e933d8085 100644 --- a/cinder/tests/unit/volume/drivers/hpe/xp/test_hpe_xp_rest_iscsi.py +++ b/cinder/tests/unit/volume/drivers/hpe/xp/test_hpe_xp_rest_iscsi.py @@ -330,7 +330,7 @@ class HPEXPRESTISCSIDriverTest(test.TestCase): self.configuration.driver_ssl_cert_verify = False self.configuration.hpexp_storage_id = CONFIG_MAP['serial'] - self.configuration.hpexp_pool = ["30"] + self.configuration.hpexp_pools = ["30"] self.configuration.hpexp_snap_pool = None self.configuration.hpexp_ldev_range = "0-1" self.configuration.hpexp_target_ports = [CONFIG_MAP['port_id']] diff --git a/cinder/tests/unit/volume/drivers/nec/v/test_internal_nec_rest_fc.py b/cinder/tests/unit/volume/drivers/nec/v/test_internal_nec_rest_fc.py index 6289cc3809b..43b3bfb9250 100644 --- a/cinder/tests/unit/volume/drivers/nec/v/test_internal_nec_rest_fc.py +++ b/cinder/tests/unit/volume/drivers/nec/v/test_internal_nec_rest_fc.py @@ -420,7 +420,7 @@ class VStorageRESTFCDriverTest(test.TestCase): self.configuration.driver_ssl_cert_verify = False self.configuration.nec_v_storage_id = CONFIG_MAP['serial'] - self.configuration.nec_v_pool = ["30"] + self.configuration.nec_v_pools = ["30"] self.configuration.nec_v_snap_pool = None self.configuration.nec_v_ldev_range = "0-1" self.configuration.nec_v_target_ports = [CONFIG_MAP['port_id']] @@ -587,8 +587,8 @@ class VStorageRESTFCDriverTest(test.TestCase): drv = nec_v_fc.VStorageFCDriver( configuration=self.configuration) self._setup_config() - tmp_pool = self.configuration.hitachi_pool - self.configuration.hitachi_pool = [CONFIG_MAP['pool_name']] + tmp_pools = self.configuration.hitachi_pools + self.configuration.hitachi_pools = [CONFIG_MAP['pool_name']] request.side_effect = [FakeResponse(200, POST_SESSIONS_RESULT), FakeResponse(200, GET_POOLS_RESULT), FakeResponse(200, GET_PORTS_RESULT), @@ -599,7 +599,7 @@ class VStorageRESTFCDriverTest(test.TestCase): drv.common.storage_info['wwns']) self.assertEqual(1, brick_get_connector_properties.call_count) self.assertEqual(4, request.call_count) - self.configuration.hitachi_pool = tmp_pool + self.configuration.hitachi_pools = tmp_pools # stop the Loopingcall within the do_setup treatment self.driver.common.client.keep_session_loop.stop() self.driver.common.client.keep_session_loop.wait() diff --git a/cinder/tests/unit/volume/drivers/nec/v/test_internal_nec_rest_iscsi.py b/cinder/tests/unit/volume/drivers/nec/v/test_internal_nec_rest_iscsi.py index 0e48f864912..b5baa149a6d 100644 --- a/cinder/tests/unit/volume/drivers/nec/v/test_internal_nec_rest_iscsi.py +++ b/cinder/tests/unit/volume/drivers/nec/v/test_internal_nec_rest_iscsi.py @@ -331,7 +331,7 @@ class VStorageRESTISCSIDriverTest(test.TestCase): self.configuration.driver_ssl_cert_verify = False self.configuration.nec_v_storage_id = CONFIG_MAP['serial'] - self.configuration.nec_v_pool = ["30"] + self.configuration.nec_v_pools = ["30"] self.configuration.nec_v_snap_pool = None self.configuration.nec_v_ldev_range = "0-1" self.configuration.nec_v_target_ports = [CONFIG_MAP['port_id']] diff --git a/cinder/tests/unit/volume/drivers/nec/v/test_nec_rest_fc.py b/cinder/tests/unit/volume/drivers/nec/v/test_nec_rest_fc.py index 75fd90ebad9..dadbd1f1d9e 100644 --- a/cinder/tests/unit/volume/drivers/nec/v/test_nec_rest_fc.py +++ b/cinder/tests/unit/volume/drivers/nec/v/test_nec_rest_fc.py @@ -1,4 +1,4 @@ -# Copyright (C) 2021 NEC corporation +# Copyright (C) 2021, 2023, NEC corporation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain @@ -158,7 +158,7 @@ class VStorageRESTFCDriverTest(test.TestCase): self.configuration.driver_ssl_cert_verify = False self.configuration.nec_v_storage_id = CONFIG_MAP['serial'] - self.configuration.nec_v_pool = ["30"] + self.configuration.nec_v_pools = ["30"] self.configuration.nec_v_snap_pool = None self.configuration.nec_v_ldev_range = "0-1" self.configuration.nec_v_target_ports = [CONFIG_MAP['port_id']] @@ -268,8 +268,8 @@ class VStorageRESTFCDriverTest(test.TestCase): configuration=self.configuration, db=db) self.assertEqual(drv.configuration.hitachi_storage_id, drv.configuration.nec_v_storage_id) - self.assertEqual(drv.configuration.hitachi_pool, - drv.configuration.nec_v_pool) + self.assertEqual(drv.configuration.hitachi_pools, + drv.configuration.nec_v_pools) self.assertEqual(drv.configuration.hitachi_snap_pool, drv.configuration.nec_v_snap_pool) self.assertEqual(drv.configuration.hitachi_ldev_range, diff --git a/cinder/tests/unit/volume/drivers/nec/v/test_nec_rest_iscsi.py b/cinder/tests/unit/volume/drivers/nec/v/test_nec_rest_iscsi.py index c779105c355..2edb42a566d 100644 --- a/cinder/tests/unit/volume/drivers/nec/v/test_nec_rest_iscsi.py +++ b/cinder/tests/unit/volume/drivers/nec/v/test_nec_rest_iscsi.py @@ -1,4 +1,4 @@ -# Copyright (C) 2021 NEC corporation +# Copyright (C) 2021, 2023, NEC corporation # # # Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -180,7 +180,7 @@ class VStorageRESTISCSIDriverTest(test.TestCase): self.configuration.driver_ssl_cert_verify = False self.configuration.nec_v_storage_id = CONFIG_MAP['serial'] - self.configuration.nec_v_pool = ["30"] + self.configuration.nec_v_pools = ["30"] self.configuration.nec_v_snap_pool = None self.configuration.nec_v_ldev_range = "0-1" self.configuration.nec_v_target_ports = [CONFIG_MAP['port_id']] @@ -290,8 +290,8 @@ class VStorageRESTISCSIDriverTest(test.TestCase): configuration=self.configuration, db=db) self.assertEqual(drv.configuration.hitachi_storage_id, drv.configuration.nec_v_storage_id) - self.assertEqual(drv.configuration.hitachi_pool, - drv.configuration.nec_v_pool) + self.assertEqual(drv.configuration.hitachi_pools, + drv.configuration.nec_v_pools) self.assertEqual(drv.configuration.hitachi_snap_pool, drv.configuration.nec_v_snap_pool) self.assertEqual(drv.configuration.hitachi_ldev_range, diff --git a/cinder/volume/drivers/hitachi/hbsd_common.py b/cinder/volume/drivers/hitachi/hbsd_common.py index 8512c8b7de4..a6847a220fc 100644 --- a/cinder/volume/drivers/hitachi/hbsd_common.py +++ b/cinder/volume/drivers/hitachi/hbsd_common.py @@ -67,8 +67,9 @@ COMMON_VOLUME_OPTS = [ default=None, help='Product number of the storage system.'), cfg.ListOpt( - 'hitachi_pool', + 'hitachi_pools', default=[], + deprecated_name='hitachi_pool', help='Pool number[s] or pool name[s] of the DP pool.'), cfg.StrOpt( 'hitachi_snap_pool', @@ -236,7 +237,7 @@ class HBSDCommon(): self._required_common_opts = [ self.driver_info['param_prefix'] + '_storage_id', - self.driver_info['param_prefix'] + '_pool', + self.driver_info['param_prefix'] + '_pools', ] self.port_index = {} @@ -503,10 +504,10 @@ class HBSDCommon(): 'pools': [], } for pool_id, pool_name, cap_data in zip( - self.storage_info['pool_id'], self.conf.hitachi_pool, + self.storage_info['pool_id'], self.conf.hitachi_pools, self.get_pool_infos(self.storage_info['pool_id'])): single_pool = self._create_single_pool_data( - pool_id, pool_name if len(self.conf.hitachi_pool) > 1 else + pool_id, pool_name if len(self.conf.hitachi_pools) > 1 else data['volume_backend_name'], cap_data) data['pools'].append(single_pool) LOG.debug("Updating volume status. (%s)", data) @@ -670,11 +671,11 @@ class HBSDCommon(): if not self.conf.safe_get(opt): msg = self.output_log(MSG.INVALID_PARAMETER, param=opt) self.raise_error(msg) - for pool in self.conf.hitachi_pool: + for pool in self.conf.hitachi_pools: if len(pool) == 0: msg = self.output_log( MSG.INVALID_PARAMETER, - param=self.driver_info['param_prefix'] + '_pool') + param=self.driver_info['param_prefix'] + '_pools') self.raise_error(msg) if self.storage_info['protocol'] == 'FC': self.check_param_fc() @@ -738,7 +739,7 @@ class HBSDCommon(): pass def check_pool_id(self): - """Check the pool id of hitachi_pool and hitachi_snap_pool.""" + """Check the pool id of hitachi_pools and hitachi_snap_pool.""" raise NotImplementedError() def connect_storage(self): diff --git a/cinder/volume/drivers/hitachi/hbsd_rest.py b/cinder/volume/drivers/hitachi/hbsd_rest.py index 65d28c5e2bc..ac7eb2c8606 100644 --- a/cinder/volume/drivers/hitachi/hbsd_rest.py +++ b/cinder/volume/drivers/hitachi/hbsd_rest.py @@ -980,11 +980,11 @@ class HBSDREST(common.HBSDCommon): self.raise_error(msg) def check_pool_id(self): - """Check the pool id of hitachi_pool and hitachi_snap_pool.""" + """Check the pool id of hitachi_pools and hitachi_snap_pool.""" pool_id_list = [] pool_list = {'pool_list': None} - for pool in self.conf.hitachi_pool: + for pool in self.conf.hitachi_pools: pool_id_list.append(self._get_pool_id(pool_list, pool)) snap_pool = self.conf.hitachi_snap_pool diff --git a/cinder/volume/drivers/hpe/xp/hpe_xp_rest.py b/cinder/volume/drivers/hpe/xp/hpe_xp_rest.py index 15b82caad2c..6f42435d02b 100644 --- a/cinder/volume/drivers/hpe/xp/hpe_xp_rest.py +++ b/cinder/volume/drivers/hpe/xp/hpe_xp_rest.py @@ -1,4 +1,4 @@ -# Copyright (C) 2022, Hewlett Packard Enterprise, Ltd. +# Copyright (C) 2022, 2023, Hewlett Packard Enterprise, Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain @@ -28,8 +28,9 @@ COMMON_VOLUME_OPTS = [ default=None, help='Product number of the storage system.'), cfg.ListOpt( - 'hpexp_pool', + 'hpexp_pools', default=[], + deprecated_name='hpexp_pool', help='Pool number[s] or pool name[s] of the THP pool.'), cfg.StrOpt( 'hpexp_snap_pool', @@ -212,7 +213,7 @@ class HPEXPRESTFC(hbsd_rest_fc.HBSDRESTFC): """Update configuration""" # COMMON_VOLUME_OPTS self.conf.hitachi_storage_id = self.conf.hpexp_storage_id - self.conf.hitachi_pool = self.conf.hpexp_pool + self.conf.hitachi_pools = self.conf.hpexp_pools self.conf.hitachi_snap_pool = self.conf.hpexp_snap_pool self.conf.hitachi_ldev_range = self.conf.hpexp_ldev_range self.conf.hitachi_target_ports = self.conf.hpexp_target_ports @@ -283,7 +284,7 @@ class HPEXPRESTISCSI(hbsd_rest_iscsi.HBSDRESTISCSI): """Update configuration""" # COMMON_VOLUME_OPTS self.conf.hitachi_storage_id = self.conf.hpexp_storage_id - self.conf.hitachi_pool = self.conf.hpexp_pool + self.conf.hitachi_pools = self.conf.hpexp_pools self.conf.hitachi_snap_pool = self.conf.hpexp_snap_pool self.conf.hitachi_ldev_range = self.conf.hpexp_ldev_range self.conf.hitachi_target_ports = self.conf.hpexp_target_ports diff --git a/cinder/volume/drivers/nec/v/nec_v_rest.py b/cinder/volume/drivers/nec/v/nec_v_rest.py index ebe5942c763..27560dd3aad 100644 --- a/cinder/volume/drivers/nec/v/nec_v_rest.py +++ b/cinder/volume/drivers/nec/v/nec_v_rest.py @@ -1,4 +1,4 @@ -# Copyright (C) 2021 NEC corporation +# Copyright (C) 2021, 2023, NEC corporation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain @@ -28,8 +28,9 @@ COMMON_VOLUME_OPTS = [ default=None, help='Product number of the storage system.'), cfg.ListOpt( - 'nec_v_pool', + 'nec_v_pools', default=[], + deprecated_name='nec_v_pool', help='Pool number[s] or pool name[s] of the DP pool.'), cfg.StrOpt( 'nec_v_snap_pool', @@ -198,7 +199,7 @@ CONF.register_opts(FC_VOLUME_OPTS, group=configuration.SHARED_CONF_GROUP) def update_conf(conf): # COMMON_VOLUME_OPTS conf.hitachi_storage_id = conf.nec_v_storage_id - conf.hitachi_pool = conf.nec_v_pool + conf.hitachi_pools = conf.nec_v_pools conf.hitachi_snap_pool = conf.nec_v_snap_pool conf.hitachi_ldev_range = conf.nec_v_ldev_range conf.hitachi_target_ports = conf.nec_v_target_ports diff --git a/releasenotes/notes/hitachi-vsp-add-multi-pool-4c4589b93399e641.yaml b/releasenotes/notes/hitachi-vsp-add-multi-pool-4c4589b93399e641.yaml index 817e9a567e4..0223d7a5b66 100644 --- a/releasenotes/notes/hitachi-vsp-add-multi-pool-4c4589b93399e641.yaml +++ b/releasenotes/notes/hitachi-vsp-add-multi-pool-4c4589b93399e641.yaml @@ -1,5 +1,12 @@ --- features: -- | - Supported multi-pool for Hitachi driver and OEM storage driver. - + - | + Supported multi-pools for Hitachi driver and OEM storage drivers. +upgrades: + - | + Hitachi driver and OEM storage drivers: Changed option names + ``hitachi_pool`` to ``hitachi_pools``, + ``hpexp_pool`` to ``hpexp_pools`` and + ``nec_v_pool`` to ``nec_v_pools``. + The options ``hitachi_pool``, ``hpexp_pool`` and ``nec_v_pool`` + are deprecated. \ No newline at end of file