diff --git a/vmware_nsx/nsxlib/v3/router.py b/vmware_nsx/nsxlib/v3/router.py index e43d2a73a0..f0e8255de7 100644 --- a/vmware_nsx/nsxlib/v3/router.py +++ b/vmware_nsx/nsxlib/v3/router.py @@ -16,6 +16,7 @@ """ NSX-V3 Plugin router module """ +import copy from neutron.common import exceptions as n_exc from oslo_log import log @@ -23,6 +24,7 @@ from oslo_log import log from vmware_nsx._i18n import _, _LW from vmware_nsx.common import exceptions as nsx_exc from vmware_nsx.common import nsx_constants +from vmware_nsx.common import utils from vmware_nsx.nsxlib import v3 as nsxlib LOG = log.getLogger(__name__) @@ -76,17 +78,22 @@ class RouterLib(object): 'edge_cluster_uuid': edge_cluster_uuid, 'member_index_list': member_index_list} - def add_router_link_port(self, tier1_uuid, tier0_uuid, edge_members): + def add_router_link_port(self, tier1_uuid, tier0_uuid, edge_members, + tags): # Create Tier0 logical router link port + t0_tags = copy.copy(tags) + t0_tags = utils.add_v3_tag(t0_tags, 'os-tier0-uuid', tier0_uuid) tier0_link_port = self._router_port_client.create( - tier0_uuid, display_name=TIER0_ROUTER_LINK_PORT_NAME, tags=None, + tier0_uuid, display_name=TIER0_ROUTER_LINK_PORT_NAME, tags=t0_tags, resource_type=nsx_constants.LROUTERPORT_LINKONTIER0, logical_port_id=None, address_groups=None) linked_logical_port_id = tier0_link_port['id'] # Create Tier1 logical router link port + t1_tags = copy.copy(tags) + t1_tags = utils.add_v3_tag(t1_tags, 'os-tier1-uuid', tier1_uuid) self._router_port_client.create( - tier1_uuid, display_name=TIER1_ROUTER_LINK_PORT_NAME, tags=None, + tier1_uuid, display_name=TIER1_ROUTER_LINK_PORT_NAME, tags=t1_tags, resource_type=nsx_constants.LROUTERPORT_LINKONTIER1, logical_port_id=linked_logical_port_id, address_groups=None) diff --git a/vmware_nsx/plugins/nsx_v3/plugin.py b/vmware_nsx/plugins/nsx_v3/plugin.py index 6fdfe934b1..00b3ae0383 100644 --- a/vmware_nsx/plugins/nsx_v3/plugin.py +++ b/vmware_nsx/plugins/nsx_v3/plugin.py @@ -1015,8 +1015,11 @@ class NsxV3Plugin(addr_pair_db.AllowedAddressPairsMixin, new_tier0_uuid) self._routerlib.update_router_edge_cluster( nsx_router_id, edge_cluster_uuid) + tags = utils.build_v3_tags_payload( + router, resource_type='os-neutron-rport', + project_name=context.tenant_name) self._routerlib.add_router_link_port(nsx_router_id, new_tier0_uuid, - members) + members, tags=tags) if add_snat_rules: self._routerlib.add_gw_snat_rule(nsx_router_id, newaddr) if bgp_announce: