From 4c4a62ba5c8bf33d7a017c76daefb0aa9eaa9207 Mon Sep 17 00:00:00 2001 From: Gary Kotton Date: Tue, 27 Mar 2018 04:42:01 -0700 Subject: [PATCH] NSX|V3: prevent attaching transparent VLAN to router Currently NSX does not support attaching a trunked network to a router Change-Id: I6396d07cbd12f023263b9b50374b49255f54102d --- vmware_nsx/plugins/nsx_v3/plugin.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/vmware_nsx/plugins/nsx_v3/plugin.py b/vmware_nsx/plugins/nsx_v3/plugin.py index d903e615dc..dd717275d2 100644 --- a/vmware_nsx/plugins/nsx_v3/plugin.py +++ b/vmware_nsx/plugins/nsx_v3/plugin.py @@ -4017,7 +4017,13 @@ class NsxV3Plugin(agentschedulers_db.AZDhcpAgentSchedulerDbMixin, "network") % {'net_id': net_id, 'net_type': net_type}) LOG.error(err_msg) raise n_exc.InvalidInput(error_message=err_msg) - + # Unable to attach a trunked network to a router interface + if cfg.CONF.vlan_transparent: + if network.get('vlan_transparent') is True: + err_msg = (_("Transparent VLAN networks cannot be attached to " + "a logical router.")) + LOG.error(err_msg) + raise n_exc.InvalidInput(error_message=err_msg) port_filters = {'device_owner': [l3_db.DEVICE_OWNER_ROUTER_INTF], 'network_id': [net_id]} intf_ports = self.get_ports(context.elevated(), filters=port_filters)