Steps to reproduce:
1. Set up a DHCP agent
2. Create a network with a subnet and ensure the subnet is hosted by the DHCP agent mentioned above
3. Optional: create an instance, attached to the created network.
4. Stop the DHCP agent.
5. If an instance has been launched at the step 3, terminate it.
6. Delete a network.
What happens at this point:
1. Since the agent went down the instance of dnsmaqs that was serving the network is still up and running. Configuraion files for the deleted network still exist.
2. No error was reported neither to the web ui, nor to the quantum log.
After restarting the DHCP agent the garbage won't get wiped because its message queue was destroyed.
There's no way of being informed about the error from the user side other than setting up an external monitoring environment.
There's also no way of cleaning up the garbasge other than doing some manual labor on the server side.
It seems the initial synchronization after the dhcp agent restart is not properly detecting deleted networks.
Detection of added networks works fine.
This is not really problematic when namespaces are enabled, but will cause errors when then another subnet will try and reuse the same cidr as the deleted one:
Stderr: '\ndnsmasq: failed to create listening socket for 10.0.11.2: Address already in use\n' execute /usr/local/ lib/python2. 7/dist- packages/ quantum- 2013.1. a67.gc507251- py2.7.egg/ quantum/ agent/linux/ utils.py: 59 agent.dhcp_ agent [-] Unable to enable dhcp. agent.dhcp_ agent Traceback (most recent call last): agent.dhcp_ agent File "/usr/local/ lib/python2. 7/dist- packages/ quantum- 2013.1. a67.gc507251- py2.7.egg/ quantum/ agent/dhcp_ agent.py" , line 109, in call_driver agent.dhcp_ agent getattr(driver, action)() agent.dhcp_ agent File "/usr/local/ lib/python2. 7/dist- packages/ quantum- 2013.1. a67.gc507251- py2.7.egg/ quantum/ agent/linux/ dhcp.py" , line 114, in enable agent.dhcp_ agent self.spawn_ process( ) agent.dhcp_ agent File "/usr/local/ lib/python2. 7/dist- packages/ quantum- 2013.1. a67.gc507251- py2.7.egg/ quantum/ agent/linux/ dhcp.py" , line 264, in spawn_process agent.dhcp_ agent utils.execute(cmd, self.root_helper) agent.dhcp_ agent File "/usr/local/ lib/python2. 7/dist- packages/ quantum- 2013.1. a67.gc507251- py2.7.egg/ quantum/ agent/linux/ utils.py" , line 61, in execute agent.dhcp_ agent raise RuntimeError(m) agent.dhcp_ agent RuntimeError: agent.dhcp_ agent Command: ['sudo', '/usr/local/ bin/quantum- rootwrap' , '/etc/quantum/ rootwrap. conf', 'QUANTUM_ RELAY_SOCKET_ PATH=/opt/ stack/data/ quantum/ dhcp/lease_ relay', 'QUANTUM_ NETWORK_ ID=496ded90- e6c2-4a1c- be07-d6aeb51089 27', 'dnsmasq', '--no-hosts', '--no-resolv', '--strict-order', '--bind- interfaces' , '--interface= tap0406faf9- 27', '--except- interface= lo', '--pid- file=/opt/ stack/data/ quantum/ dhcp/496ded90- e6c2-4a1c- be07-d6aeb51089 27/pid' , '--dhcp- hostsfile= /opt/stack/ data/quantum/ dhcp/496ded90- e6c2-4a1c- be07-d6aeb51089 27/host' , '--dhcp- optsfile= /opt/stack/ data/quantum/ dhcp/496ded90- e6c2-4a1c- be07-d6aeb51089 27/opts' , '--dhcp- script= /opt/stack/ quantum/ bin/quantum- dhcp-agent- dnsmasq- lease-update' , '--leasefile-ro', '--dhcp- range=set: tag0,10. 0.11.0, static, 120s', '--conf-file=', '--domain= openstacklocal' ]
2013-02-28 18:37:38.993 16352 ERROR quantum.
2013-02-28 18:37:38.993 16352 TRACE quantum.
2013-02-28 18:37:38.993 16352 TRACE quantum.
2013-02-28 18:37:38.993 16352 TRACE quantum.
2013-02-28 18:37:38.993 16352 TRACE quantum.
2013-02-28 18:37:38.993 16352 TRACE quantum.
2013-02-28 18:37:38.993 16352 TRACE quantum.
2013-02-28 18:37:38.993 16352 TRACE quantum.
2013-02-28 18:37:38.993 16352 TRACE quantum.
2013-02-28 18:37:38.993 16352 TRACE quantum.
2013-02-28 18:37:38.993 16352 TRACE quantum.
2013-02-28 18:37:38.993 16352 TRACE quantum.
And of course, it will waste resources, which is never good.