NSX|V3: prevent attaching transparent VLAN to router

Currently NSX does not support attaching a trunked network to a
router

Change-Id: I6396d07cbd12f023263b9b50374b49255f54102d
This commit is contained in:
Gary Kotton 2018-03-27 04:42:01 -07:00
parent 9e77debf51
commit 4c4a62ba5c
1 changed files with 7 additions and 1 deletions

View File

@ -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)