diff --git a/manila/share/drivers/netapp/dataontap/client/client_cmode.py b/manila/share/drivers/netapp/dataontap/client/client_cmode.py index 8ee89e23de..0c1384c6e2 100644 --- a/manila/share/drivers/netapp/dataontap/client/client_cmode.py +++ b/manila/share/drivers/netapp/dataontap/client/client_cmode.py @@ -1464,6 +1464,7 @@ class NetAppCmodeClient(client_base.NetAppBaseClient): elif security_service['type'].lower() == 'active_directory': vserver_client.configure_active_directory(security_service, vserver_name) + vserver_client.configure_cifs_options(security_service) elif security_service['type'].lower() == 'kerberos': vserver_client.create_kerberos_realm(security_service) @@ -1997,6 +1998,22 @@ class NetAppCmodeClient(client_base.NetAppBaseClient): msg = _("Failed to update DNS configuration. %s") raise exception.NetAppException(msg % e.message) + @na_utils.trace + def configure_cifs_options(self, security_service): + if not security_service['server']: + return + + api_args = {'mode': 'none'} + try: + self.send_request( + 'cifs-domain-server-discovery-mode-modify', + api_args) + except netapp_api.NaApiError as e: + msg = ('Failed to set cifs domain server discovery mode to ' + '%(mode)s. Exception: %(exception)s') + msg_args = {'mode': api_args['mode'], 'exception': e.message} + LOG.warning(msg, msg_args) + @na_utils.trace def set_preferred_dc(self, security_service): # server is optional diff --git a/manila/tests/share/drivers/netapp/dataontap/client/test_client_cmode.py b/manila/tests/share/drivers/netapp/dataontap/client/test_client_cmode.py index 71339b2819..70464eb683 100644 --- a/manila/tests/share/drivers/netapp/dataontap/client/test_client_cmode.py +++ b/manila/tests/share/drivers/netapp/dataontap/client/test_client_cmode.py @@ -2390,6 +2390,7 @@ class NetAppClientCmodeTestCase(test.TestCase): self.mock_object(self.client, 'send_request') self.mock_object(self.vserver_client, 'configure_active_directory') + self.mock_object(self.vserver_client, 'configure_cifs_options') self.client.setup_security_services([fake.CIFS_SECURITY_SERVICE], self.vserver_client, @@ -2410,6 +2411,8 @@ class NetAppClientCmodeTestCase(test.TestCase): mock.call('vserver-modify', vserver_modify_args)]) self.vserver_client.configure_active_directory.assert_has_calls([ mock.call(fake.CIFS_SECURITY_SERVICE, fake.VSERVER_NAME)]) + self.vserver_client.configure_cifs_options.assert_has_calls([ + mock.call(fake.CIFS_SECURITY_SERVICE)]) def test_setup_security_services_kerberos(self): diff --git a/releasenotes/notes/netapp-set-discovery-mode-to-none-d66b2125a8d12740.yaml b/releasenotes/notes/netapp-set-discovery-mode-to-none-d66b2125a8d12740.yaml new file mode 100644 index 0000000000..f40106b144 --- /dev/null +++ b/releasenotes/notes/netapp-set-discovery-mode-to-none-d66b2125a8d12740.yaml @@ -0,0 +1,7 @@ +--- +features: + - | + If user is configuring 'Servers' in AD Server in the security service then, + for NetApp ONTAP, the discovery mode should be changed to 'none'. Value of + 'none' indicates that domain controller discovery will not be done, and it + will depend only on preferred DC's configured.