Merge "Dell SC: Reject thaw call when backend is failed over"

This commit is contained in:
Jenkins 2016-11-30 16:36:27 +00:00 committed by Gerrit Code Review
commit 94b5afc75f
3 changed files with 43 additions and 0 deletions

View File

@ -4015,3 +4015,20 @@ class DellSCSanISCSIDriverTestCase(test.TestCase):
ret = self.driver._get_qos(12345)
self.assertEqual('cinderqos', ret)
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)

View File

@ -1731,3 +1731,24 @@ class DellCommonDriver(driver.ConsistencyGroupVD, driver.ManageableVD,
# Free our snapshot.
api.unmanage_replay(screplay)
# 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

View File

@ -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.