Skip to content

Commit

Permalink
ccloud: fix disabling cross-volume-deduplication
Browse files Browse the repository at this point in the history
Follow up of commit 445ea4d.  Some parent share has disabled
cross-volume-deduplication, but the efficiency policy is 'auto'. Check
policy name and set cross_volume_disabled only when policy name is
'inline-only'. Otherwise don't change the cross-volume-deduplication and
policy name.
  • Loading branch information
chuan137 authored and kpawar-sap committed Sep 13, 2022
1 parent 61d513e commit 334c8a7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -752,11 +752,13 @@ def _get_logical_space_options(self, vserver_client, share_name):

def _get_efficiency_options(self, vserver_client, share_name):
status = vserver_client.get_volume_efficiency_status(share_name)
cross_dedup_disabled = (status.get('policy') == 'inline-only'
and status.get('cross_dedup_disabled'))
provisioning_opts = {
'dedup_enabled': status.get('dedupe'),
'compression_enabled': status.get('compression'),
'policy': status.get('policy'),
'cross_dedup_disabled': status.get('cross_dedup_disabled'),
'policy': None,
'cross_dedup_disabled': cross_dedup_disabled,
}
return provisioning_opts

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ def test_create_share_from_snapshot(self, share_group_id):
mock_allocate_container_from_snapshot.assert_called_once_with(
share, fake.SNAPSHOT, fake.VSERVER1, vserver_client,
compression_enabled=True, dedup_enabled=True, policy=None,
cross_dedup_disabled=None, logical_space_reporting=False)
cross_dedup_disabled=False, logical_space_reporting=False)
mock_create_export.assert_called_once_with(share, fake.SHARE_SERVER,
fake.VSERVER1,
vserver_client)
Expand Down Expand Up @@ -1003,7 +1003,7 @@ def test_create_share_from_snapshot_another_host(self, dest_cluster,
self.mock_allocate_container.assert_called_once_with(
self.fake_share, fake.VSERVER2, self.dest_vserver_client,
replica=True, set_qos=False, compression_enabled=True,
dedup_enabled=True, policy=None, cross_dedup_disabled=None,
dedup_enabled=True, policy=None, cross_dedup_disabled=False,
logical_space_reporting=False)
self.mock_dm_create_snapmirror.assert_called_once()
self.temp_src_share['replica_state'] = (
Expand All @@ -1013,7 +1013,7 @@ def test_create_share_from_snapshot_another_host(self, dest_cluster,
self.mock_allocate_container_from_snapshot.assert_called_once_with(
self.fake_share, fake.SNAPSHOT, fake.VSERVER1,
self.src_vserver_client, split=True, compression_enabled=True,
dedup_enabled=True, policy=None, cross_dedup_disabled=None,
dedup_enabled=True, policy=None, cross_dedup_disabled=False,
logical_space_reporting=False)
state = self.library.STATE_SPLITTING_VOLUME_CLONE

Expand Down Expand Up @@ -1058,7 +1058,7 @@ def test_create_share_from_snapshot_another_host_driver_error(self):
self.mock_allocate_container_from_snapshot.assert_called_once_with(
self.fake_share, fake.SNAPSHOT, fake.VSERVER1,
self.src_vserver_client, split=True, compression_enabled=True,
dedup_enabled=True, policy=None, cross_dedup_disabled=None,
dedup_enabled=True, policy=None, cross_dedup_disabled=False,
logical_space_reporting=False)
mock_delete_snapmirror.assert_called_once_with(self.temp_src_share,
self.fake_share)
Expand Down Expand Up @@ -1348,7 +1348,7 @@ def test__create_from_snapshot_continue_state_splitting(self, src_host):
fake.POOL_NAME, fake.SHARE_NAME,
**fake.PROVISIONING_OPTIONS_WITH_QOS,
logical_space_reporting=True, policy=None,
cross_dedup_disabled=None)
cross_dedup_disabled=False)
self.mock_pvt_storage_delete.assert_called_once_with(
fake.SHARE['id'])
self.mock_create_export.assert_called_once_with(
Expand Down Expand Up @@ -1457,7 +1457,7 @@ def test__create_from_snapshot_continue_state_snapmirror(self,
fake.POOL_NAME, fake.SHARE_NAME,
**fake.PROVISIONING_OPTIONS_WITH_QOS,
logical_space_reporting=True, policy=None,
cross_dedup_disabled=None)
cross_dedup_disabled=False)
expect_result['status'] = constants.STATUS_AVAILABLE
self.mock_pvt_storage_delete.assert_called_once_with(
fake.SHARE['id'])
Expand Down

0 comments on commit 334c8a7

Please sign in to comment.