Fix installation with OVN backend and compilation

This patch fixes several issues related to the installation with
OVN backend with the OVS/OVN compilation enabled.

The OVS/OVN local directories prefix, when both services are compiled,
is now "/usr/local".

The "ovn_agent._run_process" function is calling "ovs-appctl" to
configure the logging settings of several services. Instead of
using the service name, the ctl socket file is used instead. That
is more robust and does not fail in systems with previous
installations.

Closes-Bug: #1960514

Change-Id: I69de5333393957593db6e05495f0c3c758efefdf
This commit is contained in:
Rodolfo Alonso Hernandez 2022-02-09 18:01:46 +00:00
parent 62d6ffa6b3
commit 8c6710326e
3 changed files with 9 additions and 4 deletions

View File

@ -253,7 +253,12 @@ function _run_process {
local testcmd="test -e $OVS_RUNDIR/$service.pid" local testcmd="test -e $OVS_RUNDIR/$service.pid"
test_with_retry "$testcmd" "$service did not start" $SERVICE_TIMEOUT 1 test_with_retry "$testcmd" "$service did not start" $SERVICE_TIMEOUT 1
sudo ovs-appctl -t $service vlog/set console:off syslog:info file:info local service_ctl_file
service_ctl_file=$(ls $OVS_RUNDIR | grep $service | grep ctl)
if [ -z "$service_ctl_file" ]; then
die $LINENO "ctl file for service $service is not present."
fi
sudo ovs-appctl -t $OVS_RUNDIR/$service_ctl_file vlog/set console:off syslog:info file:info
} }
function clone_repository { function clone_repository {

View File

@ -68,7 +68,7 @@ function _neutron_ovs_base_install_ubuntu_dkms {
function _neutron_ovs_base_install_agent_packages { function _neutron_ovs_base_install_agent_packages {
if [ "$Q_BUILD_OVS_FROM_GIT" == "True" ]; then if [ "$Q_BUILD_OVS_FROM_GIT" == "True" ]; then
remove_ovs_packages remove_ovs_packages
compile_ovs False /usr /var compile_ovs False /usr/local /var
load_conntrack_gre_module load_conntrack_gre_module
start_new_ovs start_new_ovs
else else

View File

@ -188,12 +188,12 @@ function action_openvswitch {
# start_new_ovs() - removes old ovs database, creates a new one and starts ovs # start_new_ovs() - removes old ovs database, creates a new one and starts ovs
function start_new_ovs { function start_new_ovs {
sudo rm -f /etc/openvswitch/conf.db /etc/openvswitch/.conf.db~lock~ sudo rm -f /etc/openvswitch/conf.db /etc/openvswitch/.conf.db~lock~
sudo /usr/share/openvswitch/scripts/ovs-ctl start sudo /usr/local/share/openvswitch/scripts/ovs-ctl start
} }
# stop_new_ovs() - stops ovs # stop_new_ovs() - stops ovs
function stop_new_ovs { function stop_new_ovs {
local ovs_ctl='/usr/share/openvswitch/scripts/ovs-ctl' local ovs_ctl='/usr/local/share/openvswitch/scripts/ovs-ctl'
if [ -x $ovs_ctl ] ; then if [ -x $ovs_ctl ] ; then
sudo $ovs_ctl stop sudo $ovs_ctl stop