Browse Source

Merge "[NetApp] cDOT to set valid QoS during migration"

tags/10.0.0.0rc1
Zuul 3 months ago
committed by Gerrit Code Review
parent
commit
8b3c4e5e6b
3 changed files with 31 additions and 5 deletions
  1. +11
    -0
      manila/share/drivers/netapp/dataontap/cluster_mode/lib_base.py
  2. +15
    -5
      manila/tests/share/drivers/netapp/dataontap/cluster_mode/test_lib_base.py
  3. +5
    -0
      releasenotes/notes/bug-1706137-netapp-manila-set-valid-qos-during-migration-4405fff02bd6fa83.yaml

+ 11
- 0
manila/share/drivers/netapp/dataontap/cluster_mode/lib_base.py View File

@@ -2229,6 +2229,17 @@ class NetAppCmodeFileStorageLibrary(object):
destination_share, extra_specs, vserver, vserver_client)
if 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_share['host'], level='pool')



+ 15
- 5
manila/tests/share/drivers/netapp/dataontap/cluster_mode/test_lib_base.py View File

@@ -4762,8 +4762,18 @@ class NetAppFileStorageLibraryTestCase(test.TestCase):
self.assertFalse(self.library._create_export.called)
self.assertEqual(3, mock_warning_log.call_count)

@ddt.data('cutover_hard_deferred', 'cutover_soft_deferred', 'completed')
def test_migration_complete(self, phase):
@ddt.data({'phase': 'cutover_hard_deferred',
'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(
id='src-snapshot', provider_location='test-src-provider-location')
dest_snap = fake_share.fake_snapshot_instance(id='dest-snapshot',
@@ -4797,10 +4807,10 @@ class NetAppFileStorageLibraryTestCase(test.TestCase):
mock.Mock(return_value=fake.EXTRA_SPEC))
self.mock_object(
self.library, '_get_provisioning_options',
mock.Mock(return_value=fake.PROVISIONING_OPTIONS_WITH_QOS))
mock.Mock(return_value=provisioning_options))
self.mock_object(
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')

src_share = fake_share.fake_share_instance(id='source-share-instance')
@@ -4825,7 +4835,7 @@ class NetAppFileStorageLibraryTestCase(test.TestCase):
dest_share, fake.SHARE_SERVER, fake.VSERVER1, vserver_client,
clear_current_export_policy=False)
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()
if phase != 'completed':
self.assertEqual(2, mock_warning_log.call_count)


+ 5
- 0
releasenotes/notes/bug-1706137-netapp-manila-set-valid-qos-during-migration-4405fff02bd6fa83.yaml 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.

Loading…
Cancel
Save