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:
parent
3907d57ffc
commit
9a3c1cd20a
7
elements/neutron-ovs-cleanup/README.md
Normal file
7
elements/neutron-ovs-cleanup/README.md
Normal 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.
|
1
elements/neutron-ovs-cleanup/element-deps
Normal file
1
elements/neutron-ovs-cleanup/element-deps
Normal file
@ -0,0 +1 @@
|
||||
neutron
|
9
elements/neutron-ovs-cleanup/install.d/81-neutron-ovs-cleanup
Executable file
9
elements/neutron-ovs-cleanup/install.d/81-neutron-ovs-cleanup
Executable 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
|
@ -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
|
@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
set -eux
|
||||
|
||||
os-svc-enable -n neutron-ovs-cleanup
|
Loading…
Reference in New Issue
Block a user