Merge "[NetApp] cDOT to set valid QoS during migration" into stable/queens

This commit is contained in:
Zuul 2020-05-08 22:58:35 +00:00 committed by Gerrit Code Review
commit 4c0f6b7d5f
3 changed files with 31 additions and 5 deletions

View File

@ -2200,6 +2200,17 @@ class NetAppCmodeFileStorageLibrary(object):
destination_share, extra_specs, vserver, vserver_client) destination_share, extra_specs, vserver, vserver_client)
if qos_policy_group_name: if qos_policy_group_name:
provisioning_options['qos_policy_group'] = qos_policy_group_name provisioning_options['qos_policy_group'] = qos_policy_group_name
else:
# Removing the QOS Policy on the migrated share as the
# new extra-spec for which this share is being migrated to
# does not specify any QOS settings.
provisioning_options['qos_policy_group'] = "none"
qos_policy_of_src_share = self._get_backend_qos_policy_group_name(
source_share['id'])
self._client.mark_qos_policy_group_for_deletion(
qos_policy_of_src_share)
destination_aggregate = share_utils.extract_host( destination_aggregate = share_utils.extract_host(
destination_share['host'], level='pool') destination_share['host'], level='pool')

View File

@ -4731,8 +4731,18 @@ class NetAppFileStorageLibraryTestCase(test.TestCase):
self.assertFalse(self.library._create_export.called) self.assertFalse(self.library._create_export.called)
self.assertEqual(3, mock_warning_log.call_count) self.assertEqual(3, mock_warning_log.call_count)
@ddt.data('cutover_hard_deferred', 'cutover_soft_deferred', 'completed') @ddt.data({'phase': 'cutover_hard_deferred',
def test_migration_complete(self, phase): 'provisioning_options': fake.PROVISIONING_OPTIONS_WITH_QOS,
'policy_group_name': fake.QOS_POLICY_GROUP_NAME},
{'phase': 'cutover_soft_deferred',
'provisioning_options': fake.PROVISIONING_OPTIONS_WITH_QOS,
'policy_group_name': fake.QOS_POLICY_GROUP_NAME},
{'phase': 'completed',
'provisioning_options': fake.PROVISIONING_OPTIONS,
'policy_group_name': False})
@ddt.unpack
def test_migration_complete(self, phase, provisioning_options,
policy_group_name):
snap = fake_share.fake_snapshot_instance( snap = fake_share.fake_snapshot_instance(
id='src-snapshot', provider_location='test-src-provider-location') id='src-snapshot', provider_location='test-src-provider-location')
dest_snap = fake_share.fake_snapshot_instance(id='dest-snapshot', dest_snap = fake_share.fake_snapshot_instance(id='dest-snapshot',
@ -4766,10 +4776,10 @@ class NetAppFileStorageLibraryTestCase(test.TestCase):
mock.Mock(return_value=fake.EXTRA_SPEC)) mock.Mock(return_value=fake.EXTRA_SPEC))
self.mock_object( self.mock_object(
self.library, '_get_provisioning_options', self.library, '_get_provisioning_options',
mock.Mock(return_value=fake.PROVISIONING_OPTIONS_WITH_QOS)) mock.Mock(return_value=provisioning_options))
self.mock_object( self.mock_object(
self.library, '_modify_or_create_qos_for_existing_share', self.library, '_modify_or_create_qos_for_existing_share',
mock.Mock(return_value=fake.QOS_POLICY_GROUP_NAME)) mock.Mock(return_value=policy_group_name))
self.mock_object(vserver_client, 'modify_volume') self.mock_object(vserver_client, 'modify_volume')
src_share = fake_share.fake_share_instance(id='source-share-instance') src_share = fake_share.fake_share_instance(id='source-share-instance')
@ -4794,7 +4804,7 @@ class NetAppFileStorageLibraryTestCase(test.TestCase):
dest_share, fake.SHARE_SERVER, fake.VSERVER1, vserver_client, dest_share, fake.SHARE_SERVER, fake.VSERVER1, vserver_client,
clear_current_export_policy=False) clear_current_export_policy=False)
vserver_client.modify_volume.assert_called_once_with( vserver_client.modify_volume.assert_called_once_with(
dest_aggr, 'new_share_name', **fake.PROVISIONING_OPTIONS_WITH_QOS) dest_aggr, 'new_share_name', **provisioning_options)
mock_info_log.assert_called_once() mock_info_log.assert_called_once()
if phase != 'completed': if phase != 'completed':
self.assertEqual(2, mock_warning_log.call_count) self.assertEqual(2, mock_warning_log.call_count)

View File

@ -0,0 +1,5 @@
---
fixes:
- NetApp cDOT driver is now fixed to remove the QoS Policy on the
backend volume when a share is migrated from an extra-spec which had
QoS defined to another extra-spec which has no QoS defined in it.