NSX|V3: only allow physical network to be confogured for external net

External network type or segmentation ID is not support so we throw
an exception if one of these is configured at external network
creation.

An external network is just associated to a edge cluster.

Change-Id: I0a7f265f4af4be9a37169fe07cefe574f49d4401
This commit is contained in:
Gary Kotton 2018-02-05 06:49:55 -08:00
parent a7f1b3513f
commit a97627ac51

@ -901,6 +901,11 @@ class NsxV3Plugin(agentschedulers_db.AZDhcpAgentSchedulerDbMixin,
tier0_uuid = self._default_tier0_router
else:
tier0_uuid = net_data[pnet.PHYSICAL_NETWORK]
if ((validators.is_attr_set(net_data.get(pnet.NETWORK_TYPE)) and
net_data.get(pnet.NETWORK_TYPE) != utils.NetworkTypes.L3_EXT) or
validators.is_attr_set(net_data.get(pnet.SEGMENTATION_ID))):
msg = _("Invalid provider network configuration")
raise n_exc.InvalidInput(error_message=msg)
self.nsxlib.router.validate_tier0(self.tier0_groups_dict, tier0_uuid)
return (True, utils.NetworkTypes.L3_EXT, tier0_uuid, 0)