HPE XP and NEC V: Host group name is not correct

Host group[1] name formats, which is managed by cinder driver,
for each storage models must be:
``HBSD-xxx`` for Hitachi storage(``xxx`` is WWPN of target host on FC,
or IP address of target host)
``HPEXP-xxx`` for HPE-XP storage
``NEC-xxx`` for NEC V storage , but the format `HBSD-xxx` is used for
OEM storage models because a bug in the merged patch
https://review.opendev.org/c/openstack/cinder/+/866526 overwrites the
prefix for Hitachi storage.

It should be fixed to use original prefixes.

[1] ``Host group``(or ``iSCSI target``), which is one of Hitachi and
OEM storage parameter,
is a group of multiple server hosts connecting to same storage port.

Following site would be help to know what host group is:
https://knowledge.hitachivantara.com/Documents/Management_Software/SVOS/9.1.x/Volume_Management_-_VSP_G130%2C_G%2F%2FF350%2C_G%2F%2FF370%2C_G%2F%2FF700%2C_G%2F%2FF900/Provisioning/11_About_LUN_Manager%2C_logical_units_(LUs)%2C_and_host_groups

Closes-Bug: #2012515
Change-Id: I1c9677112caa0808dff17cbde2db6afbe25a2129
This commit is contained in:
Atsushi Kawai 2023-04-07 10:35:04 +09:00 committed by Eric Harney
parent 2270611507
commit 61e7d1f83c
4 changed files with 37 additions and 26 deletions

View File

@ -578,6 +578,9 @@ class HPEXPRESTFCDriverTest(test.TestCase):
self.assertEqual(
{CONFIG_MAP['port_id']: CONFIG_MAP['target_wwn']},
drv.common.storage_info['wwns'])
self.assertEqual(CONFIG_MAP['host_grp_name'],
drv.common.format_info['group_name_format'].format(
wwn=min(DEFAULT_CONNECTOR['wwpns'])))
self.assertEqual(1, brick_get_connector_properties.call_count)
self.assertEqual(8, request.call_count)
# stop the Loopingcall within the do_setup treatment

View File

@ -490,6 +490,9 @@ class HPEXPRESTISCSIDriverTest(test.TestCase):
'ip': CONFIG_MAP['ipv4Address'],
'port': CONFIG_MAP['tcpPort']}},
drv.common.storage_info['portals'])
self.assertEqual(CONFIG_MAP['host_grp_name'],
drv.common.format_info['group_name_format'].format(
ip=DEFAULT_CONNECTOR['ip']))
self.assertEqual(1, brick_get_connector_properties.call_count)
self.assertEqual(8, request.call_count)
# stop the Loopingcall within the do_setup treatment

View File

@ -29,8 +29,6 @@ from cinder.volume.drivers.hitachi import hbsd_utils as utils
from cinder.volume import volume_types
from cinder.volume import volume_utils
_GROUP_NAME_FORMAT_DEFAULT_FC = utils.TARGET_PREFIX + '{wwn}'
_GROUP_NAME_FORMAT_DEFAULT_ISCSI = utils.TARGET_PREFIX + '{ip}'
_GROUP_NAME_MAX_LEN_FC = 64
_GROUP_NAME_MAX_LEN_ISCSI = 32
@ -147,27 +145,6 @@ COMMON_NAME_OPTS = [
help='Format of host groups, iSCSI targets, and server objects.'),
]
_GROUP_NAME_FORMAT = {
'FC': {
'group_name_max_len': _GROUP_NAME_MAX_LEN_FC,
'group_name_var_cnt': {
GROUP_NAME_VAR_WWN: [1],
GROUP_NAME_VAR_IP: [0],
GROUP_NAME_VAR_HOST: [0, 1],
},
'group_name_format_default': _GROUP_NAME_FORMAT_DEFAULT_FC,
},
'iSCSI': {
'group_name_max_len': _GROUP_NAME_MAX_LEN_ISCSI,
'group_name_var_cnt': {
GROUP_NAME_VAR_WWN: [0],
GROUP_NAME_VAR_IP: [1],
GROUP_NAME_VAR_HOST: [0, 1],
},
'group_name_format_default': _GROUP_NAME_FORMAT_DEFAULT_ISCSI,
}
}
CONF = cfg.CONF
CONF.register_opts(COMMON_VOLUME_OPTS, group=configuration.SHARED_CONF_GROUP)
CONF.register_opts(COMMON_PORT_OPTS, group=configuration.SHARED_CONF_GROUP)
@ -217,7 +194,28 @@ class HBSDCommon():
'portals': {},
}
self.storage_id = None
self.group_name_format = _GROUP_NAME_FORMAT[driverinfo['proto']]
if self.storage_info['protocol'] == 'FC':
self.group_name_format = {
'group_name_max_len': _GROUP_NAME_MAX_LEN_FC,
'group_name_var_cnt': {
GROUP_NAME_VAR_WWN: [1],
GROUP_NAME_VAR_IP: [0],
GROUP_NAME_VAR_HOST: [0, 1],
},
'group_name_format_default': self.driver_info[
'target_prefix'] + '{wwn}',
}
if self.storage_info['protocol'] == 'iSCSI':
self.group_name_format = {
'group_name_max_len': _GROUP_NAME_MAX_LEN_ISCSI,
'group_name_var_cnt': {
GROUP_NAME_VAR_WWN: [0],
GROUP_NAME_VAR_IP: [1],
GROUP_NAME_VAR_HOST: [0, 1],
},
'group_name_format_default': self.driver_info[
'target_prefix'] + '{ip}',
}
self.format_info = {
'group_name_format': self.group_name_format[
'group_name_format_default'],
@ -690,7 +688,8 @@ class HBSDCommon():
if self.conf.hitachi_group_name_format is not None:
error_flag = False
if re.match(
utils.TARGET_PREFIX + '(' + GROUP_NAME_VAR_WWN + '|' +
self.driver_info['target_prefix'] + '(' +
GROUP_NAME_VAR_WWN + '|' +
GROUP_NAME_VAR_IP + '|' + GROUP_NAME_VAR_HOST + '|' + '[' +
GROUP_NAME_ALLOWED_CHARS + '])+$',
self.conf.hitachi_group_name_format) is None:
@ -717,7 +716,7 @@ class HBSDCommon():
MSG.INVALID_PARAMETER,
param=self.driver_info['param_prefix'] +
'_group_name_format')
raise self.raise_error(msg)
self.raise_error(msg)
self.format_info['group_name_format'] = (
self.conf.hitachi_group_name_format)
self.format_info['group_name_format_without_var_len'] = (

View File

@ -0,0 +1,6 @@
---
fixes:
- |
HPE XP and NEC V driver `bug #2012515
<https://bugs.launchpad.net/cinder/+bug/2012515>`_: Fixed to use
correct Host group name.