Delete virtual interface "ovs-system" before load openvswitch module

When openvswitch module is loaded by modprobe in [1], if  virtual
interface "ovs-system" exists, it causes the error " modprobe:
FATAL: Module openvswitch is in use."

This patch will check "ovs-system" exists or not, then delete it
before load openvswitch module.

[1] https://github.com/openstack/neutron/blob/master/devstack/lib/ovs#L92

Change-Id: I750bd74d1d07a73b57924b84f3d8506e6063936c
This commit is contained in:
Cong Phuoc Hoang 2019-01-24 01:48:43 +09:00
parent 53bfd949bd
commit 529f645883
1 changed files with 4 additions and 0 deletions

View File

@ -88,6 +88,10 @@ function prepare_for_compilation {
# reload_kernel_modules() - reload openvswitch kernel module
function reload_kernel_modules {
local ovs_system=$(sudo ovs-dpctl dump-dps | grep ovs-system)
if [ -n "$ovs_system" ]; then
sudo ovs-dpctl del-dp ovs-system
fi
sudo modprobe -r vport_geneve
sudo modprobe -r openvswitch
load_module openvswitch