[OVN] Move OVN module from Neutron to DevStack
As part of the Victoria PTG the Neutron team entertained the idea of
having the OVN driver as the default backend in DevStack (this hasn't
yet being decided by the community, this will be discussed within this
cycle).
For this to happen, we also would need to move the module that configures
OVN to the DevStack repository. This is what this patch is doing.
Note that we are updating the lib/neutron-legacy module instead of
lib/neutron in this patch, this is because as part of the PTG the
Neutron team has decided to un-deprecate the neutron-legacy module since
the "new" lib/neutron module is broken and nobody is current working on
it (also all services uses neutron-legacy).
Also, the ovsdbapp has been added to the ALL_LIBS list because a gate
job in the ovsdbapp project repository relies on installing the library
from source instead of pip to run.
Depends-On: https://review.opendev.org/#/c/740663/
Change-Id: Ib4194329474e8d68a90886d2a04f027eecd741df
Signed-off-by: Lucas Alvares Gomes <lucasagomes@gmail.com>
diff --git a/lib/neutron-legacy b/lib/neutron-legacy
index 59649ef..363c62e 100644
--- a/lib/neutron-legacy
+++ b/lib/neutron-legacy
@@ -362,6 +362,14 @@
_configure_neutron_ceilometer_notifications
fi
+ if [[ $Q_AGENT == "ovn" ]]; then
+ configure_ovn
+ if is_service_enabled q-port-forwarding neutron-port-forwarding; then
+ configure_port_forwarding
+ fi
+ configure_ovn_plugin
+ fi
+
iniset $NEUTRON_CONF DEFAULT api_workers "$API_WORKERS"
# devstack is not a tool for running uber scale OpenStack
# clouds, therefore running without a dedicated RPC worker
@@ -438,6 +446,10 @@
git_clone $NEUTRON_REPO $NEUTRON_DIR $NEUTRON_BRANCH
setup_develop $NEUTRON_DIR
+
+ if [[ $Q_AGENT == "ovn" ]]; then
+ install_ovn
+ fi
}
# install_neutron_agent_packages() - Collect source and prepare
@@ -459,6 +471,22 @@
fi
}
+# Start running OVN processes
+function start_ovn_services {
+ if [[ $Q_AGENT == "ovn" ]]; then
+ init_ovn
+ start_ovn
+ if [[ "$OVN_L3_CREATE_PUBLIC_NETWORK" == "True" ]]; then
+ if [[ "$NEUTRON_CREATE_INITIAL_NETWORKS" != "True" ]]; then
+ echo "OVN_L3_CREATE_PUBLIC_NETWORK=True is being ignored "
+ echo "because NEUTRON_CREATE_INITIAL_NETWORKS is set to False"
+ else
+ create_public_bridge
+ fi
+ fi
+ fi
+}
+
# Start running processes
function start_neutron_service_and_check {
local service_port=$Q_PORT
@@ -575,6 +603,10 @@
function stop_mutnauq {
stop_mutnauq_other
stop_mutnauq_l2_agent
+
+ if [[ $Q_AGENT == "ovn" ]]; then
+ stop_ovn
+ fi
}
# _move_neutron_addresses_route() - Move the primary IP to the OVS bridge
@@ -668,6 +700,10 @@
for ns in $(sudo ip netns list | grep -o -E '(qdhcp|qrouter|fip|snat)-[0-9a-f-]*'); do
sudo ip netns delete ${ns}
done
+
+ if [[ $Q_AGENT == "ovn" ]]; then
+ cleanup_ovn
+ fi
}