Dell PowerMax: RDF consistency exempt (follow-up)

Main patch id: https://review.opendev.org/c/openstack/cinder/+/915935
Change-Id: Ia425df9d23a48f29df9607394759d6000ec78d78
Signed-off-by: Nilesh Thathagar <nilesh.thathagar@dell.com>
This commit is contained in:
Nilesh Thathagar
2025-09-02 18:34:39 +00:00
parent 7926029d07
commit d047840da1
4 changed files with 35 additions and 10 deletions

View File

@@ -533,6 +533,11 @@ class PowerMaxData(object):
rep_extra_specs_metro[utils.METROBIAS] = True
rep_extra_specs_metro['replication_enabled'] = '<is> True'
rep_extra_specs_async = deepcopy(rep_extra_specs)
rep_extra_specs_async[utils.REP_MODE] = utils.REP_ASYNC
rep_extra_specs_async[utils.METROBIAS] = True
rep_extra_specs_async['replication_enabled'] = '<is> True'
rep_config = {
'array': remote_array, 'srp': srp, 'portgroup': port_group_name_i,
'rdf_group_no': rdf_group_no_1, 'sync_retries': 200,

View File

@@ -2087,7 +2087,7 @@ class PowerMaxRestTest(test.TestCase):
rep_extra_specs = self.data.rep_extra_specs
self.rest.srdf_suspend_replication(
array_id, sg_name, rdf_group_no, rep_extra_specs)
# Replication mode in this test is synchronous, so the expecation
# Replication mode in this test is synchronous, so the expectation
# is that the consistency exempt flag is false.
mck_modify.assert_called_once_with(
array_id, rdf_group_no, sg_name,
@@ -2106,7 +2106,7 @@ class PowerMaxRestTest(test.TestCase):
rep_extra_specs = self.data.rep_extra_specs
self.rest.srdf_suspend_replication(
array_id, sg_name, rdf_group_no, rep_extra_specs)
# Replication mode in this test is synchronous, so the expecation
# Replication mode in this test is synchronous, so the expectation
# is that the consistency exempt flag is false.
mck_modify.assert_called_once_with(
array_id, rdf_group_no, sg_name,
@@ -2114,6 +2114,27 @@ class PowerMaxRestTest(test.TestCase):
'action': 'Suspend'},
rep_extra_specs, 'Suspend SRDF Group Replication')
@mock.patch.object(rest.PowerMaxRest, 'srdf_modify_group')
@mock.patch.object(rest.PowerMaxRest,
'get_storage_group_rdf_group_state',
return_value=[utils.RDF_SUSPENDED_STATE,
utils.RDF_CONSISTENT_STATE])
def test_srdf_suspend_metro_replication_dual_states(self, mck_get,
mck_modify):
array_id = self.data.array
rdf_group_no = self.data.rdf_group_no_1
sg_name = self.data.default_sg_re_enabled
rep_extra_specs = self.data.rep_extra_specs_async
self.rest.srdf_suspend_replication(
array_id, sg_name, rdf_group_no, rep_extra_specs)
# Replication mode in this test is asynchronous, so the expectation
# is that the consistency exempt flag is true.
mck_modify.assert_called_once_with(
array_id, rdf_group_no, sg_name,
{'suspend': {'force': 'true', 'consExempt': 'true'},
'action': 'Suspend'},
rep_extra_specs, 'Suspend SRDF Group Replication')
@mock.patch.object(rest.PowerMaxRest, 'srdf_modify_group')
@mock.patch.object(rest.PowerMaxRest, 'get_storage_group_rdf_group_state',
return_value=[utils.RDF_SUSPENDED_STATE])

View File

@@ -3019,8 +3019,7 @@ class PowerMaxRest(object):
array_id, storage_group, rdf_group_no,
rep_extra_specs['rep_mode'])
payload = {"suspend": {"force": "true"}, "action": "Suspend"}
payload["suspend"]["consExempt"] = (
"true" if cons_exempt else "false")
payload["suspend"]["consExempt"] = cons_exempt
self.srdf_modify_group(
array_id, rdf_group_no, storage_group,
payload, rep_extra_specs,
@@ -3037,13 +3036,12 @@ class PowerMaxRest(object):
:returns: A boolean indicating if consistency is exempt
"""
if not rep_mode:
return False
return "false"
resource = ('storagegroup/%(sg)s/rdf_group/%(rdfg)s' % {
'sg': storage_group, 'rdfg': rdf_group_no})
rdf_group = self.get_resource(array_id, REPLICATION, resource)
modes = list(rep_mode)
modes = [rep_mode]
if rdf_group and rdf_group.get('modes'):
modes.append(rdf_group.get('modes'))
# Ensure we don't see the error message:
@@ -3052,7 +3050,7 @@ class PowerMaxRest(object):
# asynchronous mode"
cons_exempt = utils.REP_ASYNC in modes
LOG.debug("Consistency exempt: %s", cons_exempt)
return cons_exempt
return self._bool_to_str(cons_exempt)
def srdf_resume_replication(self, array_id, storage_group, rdf_group_no,
rep_extra_specs, async_call=True):
@@ -3633,6 +3631,9 @@ class PowerMaxRest(object):
self.ucode_minor_level >= utils.UCODE_5978_HICKORY) or (
self.ucode_major_level >= utils.UCODE_6079)
def _bool_to_str(self, param):
return "true" if param else "false"
@staticmethod
def _check_force(extra_specs, force_flag=False):
"""Determine whether force should be used

View File

@@ -13,5 +13,3 @@ features:
volumes are added to SRDF groups, but not when volumes are
removed. This incurs an unnecessary performance penalty that is
resolved by this change.
Blueprint: dell-powermax-srdf-exempt