Follow up: Hitachi: Change option name `hitachi_pool` to `hitachi_pools`

This patch changes option name ``hitachi_pool`` to ``hitachi_pools`` and
sets ``hitachi_pool`` as deprecated name, along review comment[*1]
On the related patch[*2], we've supported MULTIPLE pools,
but option name is still ``hitachi_pool``.

[1] review comment:
https://review.opendev.org/c/openstack/cinder/+/846977/2/cinder/volume/drivers/hitachi/hbsd_common.py#52
[2] Related-Id: I49ac061011293900b04a7a5b90ff5b840521993d

A parent patch is not the related patch, why diffrent is we would like
to avoid re-uploading this patch by rebase when parent patch is merged.

Change-Id: If31edee3c8d51300b01272cf29e31f6ad3e9dc4f
This commit is contained in:
Atsushi Kawai 2023-02-28 09:34:32 +00:00
parent 3eb8bb739b
commit 6e37be2257
14 changed files with 53 additions and 43 deletions

View File

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

View File

@ -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()

View File

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

View File

@ -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()

View File

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

View File

@ -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()

View File

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

View File

@ -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,

View File

@ -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,

View File

@ -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):

View File

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

View File

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

View File

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

View File

@ -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.