Removes existing network namespaces for neutron-agents container

Previously, network namespaces would not work correctly when
restarting or stop/rm/start the neutron-agents container. This
is because network namespaces created within the container are
associated to the container's pid: /pid/$CONTAINER_PID/ns/net.
With this patch, when a container starts or restarts, the l3/dhcp
agent start scripts will remove any existing qrouter/qdhcp network
namespaces before starting the agents. The agents will recreate the
necessary network namespaces since they are stored in the db.

Closes-Bug: 1444219

Change-Id: Ia86729766fe8c2fc145b3a02d519746b149a73bb
This commit is contained in:
Daneyon Hansen 2015-04-21 07:37:32 +00:00
parent 66fb5138db
commit 17fc2d9b47
2 changed files with 10 additions and 0 deletions

View File

@ -77,5 +77,10 @@ dhcp-option-force=26,1450
log-facility=${NEUTRON_LOG_DIR}/neutron-dnsmasq.log
EOF
# Remove any existing qdhcp namespaces
ip netns list | grep qdhcp | while read -r line ; do
ip netns delete $line
done
# Start DHCP Agent
exec /usr/bin/neutron-dhcp-agent --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/dhcp_agent.ini

View File

@ -76,5 +76,10 @@ elif [ "${USE_NAMESPACES}" == "true" ] ; then
"true"
fi
# Remove any existing qrouter namespaces
ip netns list | grep qrouter | while read -r line ; do
ip netns delete $line
done
# Start L3 Agent
exec /usr/bin/neutron-l3-agent --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/l3_agent.ini --config-file /etc/neutron/fwaas_driver.ini