Hi, We are proposing following code change to fix the bug. Please provide your comments. As described in bug, Dhcpagent association with the given network is not getting deleted even if no subnet with dhcp-enable . In side neutron/db/db_base_plugin_v2.py, modified update_subnet() to check for any subnet is having dhcp-enable for given network. If there are no subnets with dhcp-enable, then removing network association with the dhcp agents. In update_subnet() # Keep up with fields that changed result.update(changes) + plugin = manager.NeutronManager.get_plugin() + enable_dhcp=False + if not s.get('enable_dhcp'): + network_dhcp_status = self.get_network_dhcp_status(context,db_subnet.network_id) + if not network_dhcp_status: + dhcp_agents = plugin.list_dhcp_agents_hosting_network(context,db_subnet.network_id).get('agents') + for agnet in dhcp_agents: + self.remove_network_from_dhcp_agent(context,agnet['id'],db_subnet.network_id,notify=False) + if update_ports_needed: # Find ports that have not yet been updated # with an IP address by Prefix Delegation, and update them Added new function get_network_dhcp_status(). It will return True if any subnet of given network has enable_dhcp value True. + def get_network_dhcp_status(self, context, network_id): + enable_dhcp = False + filters = {'network_id': [network_id]} + fields = ['network_id', 'enable_dhcp'] + subnets = self.plugin.get_subnets(context, filters=filters, fields=fields) + for s in subnets: + if s['enable_dhcp']: + return True + if not enable_dhcp: + return False After above change, Observed following error message. ERROR neutron.api.rpc.agentnotifiers.dhcp_rpc_agent_api [req-ee89dd42-4d8a-4065-b9cd-b13a6e1d5c12 admin 1e87b805d0c34b4ea0d303d56dcac7fb] Will not send event subnet_update_end for network 411adad2-e41b-4229-9cb7-ae7cee58ef4b: no agent available. Payload: {'subnet': {'name': u'sub10', 'enable_dhcp': False, 'network_id': u'411adad2-e41b-4229-9cb7-ae7cee58ef4b', 'tenant_id': u'1e87b805d0c34b4ea0d303d56dcac7fb', 'dns_nameservers': [], 'gateway_ip': u'2.2.2.1', 'ipv6_ra_mode': None, 'allocation_pools': [{'start': u'2.2.2.2', 'end': u'2.2.2.254'}], 'host_routes': [], 'ip_version': 4, 'ipv6_address_mode': None, 'cidr': u'2.2.2.0/24', 'id': u'1dfb91c7-f2c7-4190-974e-fd767cfff051', 'subnetpool_id': None}} This error message is notification coming from neutron/api/rpc/agentnotifiers/dhcp_rpc_agent_api.py. So to fix this error log, modified code in _get_enabled_agents() to Log error message only if any subnet is having enable_dhcp is true and not associated with dhcp agent. @@ -94,8 +95,9 @@ class DhcpAgentNotifyAPI(object): if not enabled_agents: num_ports = self.plugin.get_ports_count( context, {'network_id': [network_id]}) + notification_required = ( - num_ports > 0 and len(network['subnets']) >= 1) + num_ports > 0 and len(network['subnets']) >= 1 and self.plugin.get_network_dhcp_status(context, network_id))