From dbc3d6ca676046abc27c5c3df5882a58633aa46e Mon Sep 17 00:00:00 2001 From: asarfaty Date: Mon, 25 Jan 2021 10:00:07 +0200 Subject: [PATCH] NSX|P: keep service router when vlan interfaces exist ince vlan interfaces require service router, do not remove it when updating the router GW if a vlan interface exists. Change-Id: I51beddcfc45ff14c60a2d8b29759a149cfcf02c3 --- vmware_nsx/plugins/nsx_p/plugin.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/vmware_nsx/plugins/nsx_p/plugin.py b/vmware_nsx/plugins/nsx_p/plugin.py index 023d78287f..e902de6817 100644 --- a/vmware_nsx/plugins/nsx_p/plugin.py +++ b/vmware_nsx/plugins/nsx_p/plugin.py @@ -2623,12 +2623,15 @@ class NsxPolicyPlugin(nsx_plugin_common.NsxPluginV3Base): sr_currently_exists = self.verify_sr_at_backend(context, router_id) fw_exist = self._router_has_edge_fw_rules(context, router) vpn_exist = self.service_router_has_vpnaas(context, router_id) + vlan_interfaces = self._get_router_vlan_interfaces( + context.elevated(), router_id) lb_exist = False - if not (fw_exist or vpn_exist): + if not (fw_exist or vpn_exist or vlan_interfaces): # This is a backend call, so do it only if must lb_exist = self.service_router_has_loadbalancers( context, router_id) - tier1_services_exist = fw_exist or vpn_exist or lb_exist + tier1_services_exist = (fw_exist or vpn_exist or lb_exist or + vlan_interfaces) actions = self._get_update_router_gw_actions( org_tier0_uuid, orgaddr, org_enable_snat,