diff --git a/lib/neutron_plugins/ovs_base b/lib/neutron_plugins/ovs_base index f2a35dd340..fb3a154a00 100644 --- a/lib/neutron_plugins/ovs_base +++ b/lib/neutron_plugins/ovs_base @@ -68,9 +68,15 @@ function _neutron_ovs_base_install_ubuntu_dkms { function _neutron_ovs_base_install_agent_packages { if [ "$Q_BUILD_OVS_FROM_GIT" == "True" ]; then remove_ovs_packages - compile_ovs /usr/local /var + compile_ovs /usr/local load_conntrack_gre_module - start_new_ovs + # When OVN is the backend, ovn_agent:_start_ovs handles OVS + # lifecycle with its own DB and rundir. Starting OVS here would + # leave an orphaned ovs-vswitchd holding the kernel datapath, + # preventing the OVN-managed instance from creating bridges. + if ! is_service_enabled ovn-controller ovn-northd; then + start_new_ovs + fi else # Install deps install_package $(get_packages "openvswitch") diff --git a/lib/neutron_plugins/ovs_source b/lib/neutron_plugins/ovs_source index feb8f0acd0..e141b22368 100644 --- a/lib/neutron_plugins/ovs_source +++ b/lib/neutron_plugins/ovs_source @@ -128,7 +128,8 @@ function action_openvswitch { # start_new_ovs() - removes old ovs database, creates a new one and starts ovs function start_new_ovs { - sudo rm -f /etc/openvswitch/conf.db /etc/openvswitch/.conf.db~lock~ + # DB path must match the compiled --prefix=/usr/local sysconfdir + sudo rm -f /usr/local/etc/openvswitch/conf.db /usr/local/etc/openvswitch/.conf.db~lock~ sudo /usr/local/share/openvswitch/scripts/ovs-ctl start }