From b15938b746688add286f0a8d1203bcf9c8061f06 Mon Sep 17 00:00:00 2001 From: Tom Swanson Date: Thu, 30 Jun 2016 11:27:22 -0500 Subject: [PATCH] Dell SC: Do not set High Availability in async mode. The Dell SC driver was setting replication SyncMode to HighAvailability even if the replication type was Asynchronous. This is not supported on the platform. Change-Id: I209b70e7bca790e3fbb091fa5c11ec7aad4a2480 Closes-Bug: #1597820 --- cinder/tests/unit/test_dellscapi.py | 4 ++-- cinder/volume/drivers/dell/dell_storagecenter_api.py | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/cinder/tests/unit/test_dellscapi.py b/cinder/tests/unit/test_dellscapi.py index 3c9ac3bb9..d24bdcf7c 100644 --- a/cinder/tests/unit/test_dellscapi.py +++ b/cinder/tests/unit/test_dellscapi.py @@ -6100,7 +6100,6 @@ class DellSCSanAPITestCase(test.TestCase): 'StorageCenter': ssn, 'ReplicateActiveReplay': False, 'Type': 'Asynchronous', - 'SyncMode': 'HighAvailability', 'DestinationVolumeAttributes': {'CreateSourceVolumeFolderPath': True, 'Notes': notes, @@ -6116,6 +6115,7 @@ class DellSCSanAPITestCase(test.TestCase): self.assertDictEqual(self.SCREPL[0], ret) payload['Type'] = 'Synchronous' payload['ReplicateActiveReplay'] = True + payload['SyncMode'] = 'HighAvailability' ret = self.scapi.create_replication(self.VOLUME, str(destssn), qosnode, @@ -6166,7 +6166,6 @@ class DellSCSanAPITestCase(test.TestCase): 'StorageCenter': ssn, 'ReplicateActiveReplay': False, 'Type': 'Asynchronous', - 'SyncMode': 'HighAvailability', 'DestinationVolumeAttributes': {'CreateSourceVolumeFolderPath': True, 'Notes': notes, @@ -6183,6 +6182,7 @@ class DellSCSanAPITestCase(test.TestCase): payload['Type'] = 'Synchronous' payload['ReplicateActiveReplay'] = True + payload['SyncMode'] = 'HighAvailability' ret = self.scapi.create_replication(self.VOLUME, str(destssn), qosnode, diff --git a/cinder/volume/drivers/dell/dell_storagecenter_api.py b/cinder/volume/drivers/dell/dell_storagecenter_api.py index 5297cf19a..8ba7d8599 100644 --- a/cinder/volume/drivers/dell/dell_storagecenter_api.py +++ b/cinder/volume/drivers/dell/dell_storagecenter_api.py @@ -2702,8 +2702,12 @@ class StorageCenterApi(object): payload['StorageCenter'] = self.find_sc() # Have to replicate the active replay. payload['ReplicateActiveReplay'] = replicate_active or synchronous - payload['Type'] = 'Synchronous' if synchronous else 'Asynchronous' - payload['SyncMode'] = 'HighAvailability' + if synchronous: + payload['Type'] = 'Synchronous' + # If our type is synchronous we prefer high availability be set. + payload['SyncMode'] = 'HighAvailability' + else: + payload['Type'] = 'Asynchronous' destinationvolumeattributes = {} destinationvolumeattributes['CreateSourceVolumeFolderPath'] = True destinationvolumeattributes['Notes'] = self.notes