NSX|V: add support for VLAN trunk with VLAN network
Completes the VLAN trunk support Change-Id: Ied8a299428486938d2006badf572c1308ccf1269
This commit is contained in:
@@ -428,6 +428,10 @@ class DvsManager(VCManagerBase):
|
|||||||
standby = list(set(uplinks.uplinkPortName) - set(ports))
|
standby = list(set(uplinks.uplinkPortName) - set(ports))
|
||||||
policy.uplinkPortOrder.standbyUplinkPort = standby
|
policy.uplinkPortOrder.standbyUplinkPort = standby
|
||||||
|
|
||||||
|
def update_port_group_spec_trunk(self, pg_spec, trunk_data):
|
||||||
|
port_conf = pg_spec.defaultPortConfig
|
||||||
|
port_conf.vlan = self._get_trunk_vlan_spec()
|
||||||
|
|
||||||
|
|
||||||
class VMManager(VCManagerBase):
|
class VMManager(VCManagerBase):
|
||||||
"""Management class for VMs related VC tasks."""
|
"""Management class for VMs related VC tasks."""
|
||||||
|
@@ -1087,9 +1087,6 @@ class NsxVPluginV2(addr_pair_db.AllowedAddressPairsMixin,
|
|||||||
net_morefs = [segment.get(pnet.PHYSICAL_NETWORK)]
|
net_morefs = [segment.get(pnet.PHYSICAL_NETWORK)]
|
||||||
dvs_net_ids = [net_data['name']]
|
dvs_net_ids = [net_data['name']]
|
||||||
else:
|
else:
|
||||||
if vlt:
|
|
||||||
raise NotImplementedError(_("Transparent support only "
|
|
||||||
"for VXLANs"))
|
|
||||||
segment = net_data[mpnet.SEGMENTS][0]
|
segment = net_data[mpnet.SEGMENTS][0]
|
||||||
physical_network = segment.get(pnet.PHYSICAL_NETWORK)
|
physical_network = segment.get(pnet.PHYSICAL_NETWORK)
|
||||||
# Retrieve the list of dvs-ids from physical network.
|
# Retrieve the list of dvs-ids from physical network.
|
||||||
@@ -1119,6 +1116,21 @@ class NsxVPluginV2(addr_pair_db.AllowedAddressPairsMixin,
|
|||||||
net_morefs.append(net_moref)
|
net_morefs.append(net_moref)
|
||||||
dvs_net_ids.append(self._get_vlan_network_name(
|
dvs_net_ids.append(self._get_vlan_network_name(
|
||||||
net_data, dvs_id))
|
net_data, dvs_id))
|
||||||
|
if vlt:
|
||||||
|
try:
|
||||||
|
self._vcm.update_port_groups_config(
|
||||||
|
dvs_id, net_data['id'], net_moref,
|
||||||
|
self._vcm.update_port_group_spec_trunk,
|
||||||
|
{})
|
||||||
|
except Exception:
|
||||||
|
with excutils.save_and_reraise_exception():
|
||||||
|
# Delete VLAN networks on other DVSes if it
|
||||||
|
# fails to be created on one DVS and reraise
|
||||||
|
# the original exception.
|
||||||
|
for dvsmoref, netmoref in six.iteritems(
|
||||||
|
dvs_pg_mappings):
|
||||||
|
self._delete_backend_network(
|
||||||
|
netmoref, dvsmoref)
|
||||||
try:
|
try:
|
||||||
net_data[psec.PORTSECURITY] = net_data.get(psec.PORTSECURITY, True)
|
net_data[psec.PORTSECURITY] = net_data.get(psec.PORTSECURITY, True)
|
||||||
# Create SpoofGuard policy for network anti-spoofing
|
# Create SpoofGuard policy for network anti-spoofing
|
||||||
|
Reference in New Issue
Block a user