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
This commit is contained in:
Atsushi Kawai
2024-04-26 10:05:13 +09:00
committed by anthony gamboa
parent a169a4543d
commit 88d5d18a3d
3 changed files with 22 additions and 2 deletions

View File

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

View File

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

View File

@@ -0,0 +1,14 @@
---
fixes:
- |
Hitachi driver `bug #2043978
<https://bugs.launchpad.net/cinder/+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.