Browse Source

NSX|V3: address edge case of subnet deletion when attached to router

There is a edge case when when a subnet deletion fails due to it
being attached to a router. If the subnet did not have an attached
instance ports then the DHCP server was deleted.

Subsequent instance ports will not get IP addresses.

Change-Id: I12ffcda503f3647d481d574a09104e837c7af5d6
changes/36/521636/1
Gary Kotton 4 years ago
parent
commit
09d3049be1
  1. 3
      vmware_nsx/plugins/nsx_v3/plugin.py

3
vmware_nsx/plugins/nsx_v3/plugin.py

@ -1533,6 +1533,9 @@ class NsxV3Plugin(agentschedulers_db.AZDhcpAgentSchedulerDbMixin,
def delete_subnet(self, context, subnet_id):
# TODO(berlin): cancel public external subnet announcement
if cfg.CONF.nsx_v3.native_dhcp_metadata:
# Ensure that subnet is not deleted if attached to router.
self._subnet_check_ip_allocations_internal_router_ports(
context, subnet_id)
subnet = self.get_subnet(context, subnet_id)
if subnet['enable_dhcp']:
lock = 'nsxv3_network_' + subnet['network_id']

Loading…
Cancel
Save