Add cleanup service for neutron ovs bridges
Neutron used to run a neutron-ovs-cleanup service on startup and
shutdown to ensure clean configuration. Container specific version of
the cleanup service is needed as we are no longer installing neutron
packages in the overcloud image and the ordering dependencies of the
legacy services are not suitable for containerized neutron deployments.
Closes-Bug: #1786311
Change-Id: Iddd191f06b0a7cadb463abec7ef152c89fddb3cd
(cherry picked from commit 8126573718
)
This commit is contained in:
parent
c4bd13bb50
commit
a01dc10348
|
@ -168,7 +168,27 @@ outputs:
|
|||
- KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
|
||||
metadata_settings:
|
||||
get_attr: [NeutronOvsAgentBase, role_data, metadata_settings]
|
||||
host_prep_tasks: {get_attr: [NeutronLogging, host_prep_tasks]}
|
||||
host_prep_tasks:
|
||||
list_concat:
|
||||
- {get_attr: [NeutronLogging, host_prep_tasks]}
|
||||
-
|
||||
- block:
|
||||
- name: Copy in cleanup script
|
||||
copy:
|
||||
content: {get_file: ./neutron/neutron-cleanup}
|
||||
dest: '/usr/libexec/neutron-cleanup'
|
||||
force: yes
|
||||
mode: '0755'
|
||||
- name: Copy in cleanup service
|
||||
copy:
|
||||
content: {get_file: ./neutron/neutron-cleanup.service}
|
||||
dest: '/usr/lib/systemd/system/neutron-cleanup.service'
|
||||
force: yes
|
||||
- name: Enabling the cleanup service
|
||||
service:
|
||||
name: neutron-cleanup
|
||||
enabled: yes
|
||||
|
||||
upgrade_tasks:
|
||||
list_concat:
|
||||
- get_attr: [NeutronOvsAgentBase, role_data, ovs_upgrade_tasks]
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
#!/bin/bash
|
||||
# Cleanup neutron OVS bridges. To be called on startup to avoid
|
||||
# "difficult-to-debug" issues with partially configured resources.
|
||||
|
||||
NEUTRON_OVS_CONF=/var/lib/config-data/puppet-generated/neutron/etc/neutron/plugins/ml2/openvswitch_agent.ini
|
||||
|
||||
if [ -e ${NEUTRON_OVS_CONF} ];
|
||||
then
|
||||
INT_BRIDGE=`crudini --get ${NEUTRON_OVS_CONF} ovs integration_bridge`
|
||||
TUN_BRIDGE=`crudini --get ${NEUTRON_OVS_CONF} ovs tunnel_bridge`
|
||||
fi
|
||||
|
||||
for br in ${INT_BRIDGE:-"br-int"} ${TUN_BRIDGE:-"br-tun"};
|
||||
do
|
||||
ovs-vsctl --if-exists del-br $br
|
||||
done
|
||||
|
||||
# Clean up trunk port bridges
|
||||
for br in $(ovs-vsctl list-br | egrep 'tbr-[0-9a-f\-]+'); do
|
||||
ovs-vsctl --if-exists del-br $br
|
||||
done
|
|
@ -0,0 +1,12 @@
|
|||
[Unit]
|
||||
Description=Neutron cleanup on startup
|
||||
After=openvswitch.service network.target
|
||||
Before=docker.service
|
||||
RefuseManualStop=yes
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/libexec/neutron-cleanup
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
features:
|
||||
- |
|
||||
Add cleanup services for neutron bridges that work with container based deployments.
|
Loading…
Reference in New Issue