Add new neutron-ovs-cleanup element.

This patch adds a new neutron-ovs-cleanup element which
configures the neutron-ovs-cleanup service to run
so that it cleans up *all* OVS ports. We want to do this
at a very specific time in the boot process so that DHCP
on reboot works properly:

 1) after OVS is available (nonetworking)
 2) before networking is started

NOTE: This service is not started on first boot but will
run on any subsequent reboots (it is enabled in os-refresh-config)

Without this fix networking after rebooting an overcloud instance
is a total failure due to the fact that the physical NIC has been
moved to an OVS bridge by init-neutron-ovs and DHCP requests
fail.

The currently patch implements this on systemd only.

In addition to all the above, cleaning up old neutron ports is
a good idea on reboot anyways. So we get that for free here too.

Change-Id: Ic87f2388680ec4f67b6275b8d923f76b75559c78
Closes-bug: 1254533
This commit is contained in:
Dan Prince 2014-01-10 15:36:29 -05:00
parent 3907d57ffc
commit 9a3c1cd20a
5 changed files with 36 additions and 0 deletions

View File

@ -0,0 +1,7 @@
Install and configure OpenStack Networking cleanup utility.
We use this utility to cleanup all OVS ports on reboot. This helps fix
a race condition where DHCP on reboot fails due to the fact that
Openvswitch starts after networking on most distros.
Currently supports systemd distributions only.

View File

@ -0,0 +1 @@
neutron

View File

@ -0,0 +1,9 @@
#!/bin/bash
set -x
SCRIPTDIR=$(dirname $0)
DIB_INIT_SYSTEM=$(dib-init-system)
if [ "$DIB_INIT_SYSTEM" == "systemd" ]; then
install -D -g root -o root -m 0755 ${SCRIPTDIR}/neutron-ovs-cleanup.service /usr/lib/systemd/system/neutron-ovs-cleanup.service
fi

View File

@ -0,0 +1,15 @@
[Unit]
Description=Neutron OVS Cleanup Service
Wants=network.service openvswitch-nonetwork.service
After=openvswitch-nonetwork.service
Before=network.service
[Service]
Type=oneshot
ExecStart=/opt/stack/venvs/neutron/bin/neutron-ovs-cleanup --ovs_all_ports
User=root
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
Alias=neutron-ovs-cleanup.service

View File

@ -0,0 +1,4 @@
#!/bin/bash
set -eux
os-svc-enable -n neutron-ovs-cleanup