Dell SC: Reject thaw call when backend is failed over
Implements thaw_backend function. Driver has limited support in a failed over state so thaw_backend has been implemented to reject the thaw call when in such a state. Change-Id: I3552f67f0c39c1d1e77e4fa8111ae7a4be165b0d
This commit is contained in:
parent
41b516234f
commit
3f5a7e1bc8
@ -4003,3 +4003,20 @@ class DellSCSanISCSIDriverTestCase(test.TestCase):
|
|||||||
ret = self.driver._get_qos(12345)
|
ret = self.driver._get_qos(12345)
|
||||||
self.assertEqual('cinderqos', ret)
|
self.assertEqual('cinderqos', ret)
|
||||||
self.driver.backends = backends
|
self.driver.backends = backends
|
||||||
|
|
||||||
|
def test_thaw_backend(self,
|
||||||
|
mock_close_connection,
|
||||||
|
mock_open_connection,
|
||||||
|
mock_init):
|
||||||
|
self.driver.failed_over = False
|
||||||
|
ret = self.driver.thaw_backend(self._context)
|
||||||
|
self.assertTrue(ret)
|
||||||
|
|
||||||
|
def test_thaw_backend_failed_over(self,
|
||||||
|
mock_close_connection,
|
||||||
|
mock_open_connection,
|
||||||
|
mock_init):
|
||||||
|
self.driver.failed_over = True
|
||||||
|
self.assertRaises(exception.Invalid,
|
||||||
|
self.driver.thaw_backend,
|
||||||
|
self._context)
|
||||||
|
@ -1730,3 +1730,24 @@ class DellCommonDriver(driver.ConsistencyGroupVD, driver.ManageableVD,
|
|||||||
# Free our snapshot.
|
# Free our snapshot.
|
||||||
api.unmanage_replay(screplay)
|
api.unmanage_replay(screplay)
|
||||||
# Do not check our result.
|
# Do not check our result.
|
||||||
|
|
||||||
|
def thaw_backend(self, context):
|
||||||
|
"""Notify the backend that it's unfrozen/thawed.
|
||||||
|
|
||||||
|
This is a gate. We do not allow the backend to be thawed if
|
||||||
|
it is still failed over.
|
||||||
|
|
||||||
|
:param context: security context
|
||||||
|
:response: True on success
|
||||||
|
:raises Invalid: if it cannot be thawed.
|
||||||
|
"""
|
||||||
|
# We shouldn't be called if we are not failed over.
|
||||||
|
if self.failed_over:
|
||||||
|
msg = _('The Dell SC array does not support thawing a failed over'
|
||||||
|
' replication. Please migrate volumes to an operational '
|
||||||
|
'back-end or resolve primary system issues and '
|
||||||
|
'fail back to reenable full functionality.')
|
||||||
|
LOG.error(msg)
|
||||||
|
raise exception.Invalid(reason=msg)
|
||||||
|
|
||||||
|
return True
|
||||||
|
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
issues:
|
||||||
|
- Dell SC Cinder driver has limited support in a failed
|
||||||
|
over state so thaw_backend has been implemented to
|
||||||
|
reject the thaw call when in such a state.
|
Loading…
x
Reference in New Issue
Block a user