Browse Source

NSX|P: Fix router interface removal

With Policy DHCP, subnets should not allways be removed from the
segment.

Change-Id: I80344e506e225b13838bc06999dbc72930414c68
(cherry picked from commit e567073dfb)
changes/84/725484/1
asarfaty 3 months ago
committed by Adit Sarfaty
parent
commit
f9ed36ec04
1 changed files with 13 additions and 6 deletions
  1. +13
    -6
      vmware_nsx/plugins/nsx_p/plugin.py

+ 13
- 6
vmware_nsx/plugins/nsx_p/plugin.py View File

@@ -2716,16 +2716,23 @@ class NsxPolicyPlugin(nsx_plugin_common.NsxPluginV3Base):
seg_subnets = self._get_segment_subnets(
context, network_id, interface_subnets=net_rtr_subnets)

if not net_rtr_subnets:
if not net_rtr_subnets and not seg_subnets:
# Remove the tier1 connectivity of this segment
# This must be done is a separate call as it uses PUT
self.nsxpolicy.segment.remove_connectivity_and_subnets(
segment_id)

# update remaining (DHCP/ipv4/6) subnets
if seg_subnets:
self.nsxpolicy.segment.update(segment_id,
subnets=seg_subnets)
else:
#TODO(asarfaty): Try to combine the 2 backend calls
if not net_rtr_subnets:
# Remove connectivity path
# This must be done is a separate call as it uses PUT
self.nsxpolicy.segment.remove_connectivity_path(
segment_id)

# update remaining (DHCP/ipv4/6) subnets
if seg_subnets:
self.nsxpolicy.segment.update(segment_id,
subnets=seg_subnets)

# will update the router only if needed
self._update_slaac_on_router(context, router_id,


Loading…
Cancel
Save