From 13ded44bc9aed07c965e6be0425ba79996f0177b Mon Sep 17 00:00:00 2001 From: Adit Sarfaty Date: Tue, 20 Feb 2018 08:04:47 +0200 Subject: [PATCH] NSX-V3: do not add the DHCP profile for ENS networks ENS networks/ports does not support any security profiles Change-Id: I2d0bb5b78c0953f70c5ae045425bd2465090ba4c --- vmware_nsx/plugins/nsx_v3/plugin.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/vmware_nsx/plugins/nsx_v3/plugin.py b/vmware_nsx/plugins/nsx_v3/plugin.py index dd55c94f4e..bc124dac0a 100644 --- a/vmware_nsx/plugins/nsx_v3/plugin.py +++ b/vmware_nsx/plugins/nsx_v3/plugin.py @@ -1379,6 +1379,9 @@ class NsxV3Plugin(agentschedulers_db.AZDhcpAgentSchedulerDbMixin, neutron_port, resource_type='os-neutron-dport-id', project_name=context.tenant_name) dhcp_server = None + dhcp_port_profiles = [] + if not self._is_ens_tz_net(context, network['id']): + dhcp_port_profiles.append(self._dhcp_profile) try: dhcp_server = self.nsxlib.dhcp_server.create(**server_data) LOG.debug("Created logical DHCP server %(server)s for network " @@ -1388,7 +1391,7 @@ class NsxV3Plugin(agentschedulers_db.AZDhcpAgentSchedulerDbMixin, nsx_port = self.nsxlib.logical_port.create( nsx_net_id, dhcp_server['id'], tags=port_tags, name=name, attachment_type=nsxlib_consts.ATTACHMENT_DHCP, - switch_profile_ids=[self._dhcp_profile]) + switch_profile_ids=dhcp_port_profiles) LOG.debug("Created DHCP logical port %(port)s for " "network %(network)s", {'port': nsx_port['id'], 'network': network['id']}) @@ -2874,7 +2877,8 @@ class NsxV3Plugin(agentschedulers_db.AZDhcpAgentSchedulerDbMixin, switch_profile_ids) # Update the DHCP profile - if updated_device_owner == const.DEVICE_OWNER_DHCP: + if (updated_device_owner == const.DEVICE_OWNER_DHCP and + not self._is_ens_tz_net(context, updated_port['network_id'])): switch_profile_ids.append(self._dhcp_profile) # Update QoS switch profile