From 88d5d18a3d20e51b1aa8d9669f3066b3c092b20a Mon Sep 17 00:00:00 2001 From: Atsushi Kawai Date: Fri, 26 Apr 2024 10:05:13 +0900 Subject: [PATCH] Hitachi: Fix to have compatibility of GAD volumes Hitachi driver with the following patch has lost compatibility of GAD volumes which are created by Hitachi out-of-tree driver until OSP16, because the naming rules of GAD copy group name are different. This patch fixes to have compatibility of GAD volumes by using same naming rule. GAD patch and blueprint: https://review.opendev.org/c/openstack/cinder/+/796170 https://blueprints.launchpad.net/cinder/+spec/hitachi-gad-support Closes-Bug: #2043978 Change-Id: Ie37a0eb8081f5c7a4432d5f390a4d7079ff0e5c9 --- .../drivers/hitachi/test_hitachi_hbsd_mirror_fc.py | 8 +++++++- cinder/volume/drivers/hitachi/hbsd_replication.py | 2 +- ...fix-gad-vol-compatibility-e9c62c18f7a12bc7.yaml | 14 ++++++++++++++ 3 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/hitachi-fix-gad-vol-compatibility-e9c62c18f7a12bc7.yaml 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 43df2e611d5..c40245bb7e8 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 @@ -495,7 +495,7 @@ GET_REMOTE_MIRROR_COPYPAIR_RESULT_SPLIT = { } GET_REMOTE_MIRROR_COPYGROUP_RESULT = { - 'copyGroupName': 'HBSD-127.0.0.100U00', + 'copyGroupName': 'HBSD-127.0.0.100G00', 'copyPairs': [GET_REMOTE_MIRROR_COPYPAIR_RESULT], } @@ -889,6 +889,12 @@ class HBSDMIRRORFCDriverTest(test.TestCase): 'remote-copy': hbsd_utils.MIRROR_ATTR})} self.assertEqual(actual, ret) self.assertEqual(14, request.call_count) + for args, kwargs in request.call_args_list: + if args[0] == 'POST' and 'remote-mirror-copypairs' in args[1]: + self.assertEqual('G', kwargs['json']['copyGroupName'][-3]) + break + else: + self.fail('no create pair api') @mock.patch.object(requests.Session, "request") @mock.patch.object(volume_types, 'get_volume_type_extra_specs') diff --git a/cinder/volume/drivers/hitachi/hbsd_replication.py b/cinder/volume/drivers/hitachi/hbsd_replication.py index 4615fe4c807..7129459956d 100644 --- a/cinder/volume/drivers/hitachi/hbsd_replication.py +++ b/cinder/volume/drivers/hitachi/hbsd_replication.py @@ -387,7 +387,7 @@ class HBSDREPLICATION(rest.HBSDREST): return pvol, svol def _create_rep_copy_group_name(self, ldev): - return self.driver_info['target_prefix'] + '%s%02XU%02d' % ( + return self.driver_info['target_prefix'] + '%s%02XG%02d' % ( CONF.my_ip, self.conf.hitachi_replication_number, ldev >> 10) def _get_rep_copy_speed(self): diff --git a/releasenotes/notes/hitachi-fix-gad-vol-compatibility-e9c62c18f7a12bc7.yaml b/releasenotes/notes/hitachi-fix-gad-vol-compatibility-e9c62c18f7a12bc7.yaml new file mode 100644 index 00000000000..a7842e125d3 --- /dev/null +++ b/releasenotes/notes/hitachi-fix-gad-vol-compatibility-e9c62c18f7a12bc7.yaml @@ -0,0 +1,14 @@ +--- +fixes: + - | + Hitachi driver `bug #2043978 + `_: Since around the Train + era, Hitachi had an out-of-tree driver that implemented the Global-Active + Device (GAD) and Remote Replication features. As part of an initiative to + unify the "Enterprise" and in-tree drivers, change I4543cd036897 in the + 2023.1 (Antelope) release implemented the GAD feature for the in-tree + driver. Unfortunately, this change used an incompatible string to indicate + what copy groups were under GAD control, and thus upgrading to the in-tree + driver breaks GAD for existing volumes. This bug fix makes the copy group + control identifier consistent so that current users of the out-of-tree + driver can upgrade to releases that contain the in-tree driver. \ No newline at end of file