Comment 2 for bug 1573073

Revision history for this message
Saverio Proto (zioproto) wrote : Re: When router has no ports _process_updated_router fails because the namespace does not exist

The namespaces with only the loopback interfaces are purged by a cronjob automatically installed with the ubuntu packages:

Filename: /etc/cron.d/neutron-l3-agent-netns-cleanup
Content:

# vim: set filetype=crontab:
# Periodically cleans Neutron's network namespaces on behalf of the Neutron
# L3 agent.
0 * * * * neutron if [ -x /usr/bin/neutron-netns-cleanup ] ; then /usr/bin/neutron-netns-cleanup --config-file=/etc/neutron/neutron.conf --config-file=/etc/neutron/l3_agent.ini >/dev/null 2>&1; fi

So basically this command:

/usr/bin/neutron-netns-cleanup --config-file=/etc/neutron/neutron.conf --config-file=/etc/neutron/l3_agent.ini

Will delete the namespaces if there is only the loopback interface.

So if you create a router in neutron and then you delete all interfaces and you clear the gateway, you will end up with a router in the neutron database but not a namespace in the network node.

This is why neutron code should always check if the namespace really exists before trying to exec commands in the namespace.