Skip to content

Commit e7f071b

Browse files
salv-orlandosdague
authored andcommitted
Remove no_wait ovs flag from vmw_nsx 3rd party lib
The no_wait flag can trigger a race conditon with ip addr flush if the public bridge is not yet up. Due to this race condition the local route for the external subnet might not be added. The patch also renames br-ex to $PUBLIC_BRIDGE in some places Change-Id: I11335c99dba580e7ca26b0b15b0df8dead367fdc
1 parent ce1f133 commit e7f071b

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

lib/neutron_thirdparty/vmware_nsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# * enable_service vmware_nsx --> to execute this third-party addition
99
# * PUBLIC_BRIDGE --> bridge used for external connectivity, typically br-ex
1010
# * NSX_GATEWAY_NETWORK_INTERFACE --> interface used to communicate with the NSX Gateway
11-
# * NSX_GATEWAY_NETWORK_CIDR --> CIDR to configure br-ex, e.g. 172.24.4.211/24
11+
# * NSX_GATEWAY_NETWORK_CIDR --> CIDR to configure $PUBLIC_BRIDGE, e.g. 172.24.4.211/24
1212

1313
# Save trace setting
1414
NSX3_XTRACE=$(set +o | grep xtrace)
@@ -29,7 +29,7 @@ function configure_vmware_nsx {
2929
function init_vmware_nsx {
3030
if ! is_set NSX_GATEWAY_NETWORK_CIDR; then
3131
NSX_GATEWAY_NETWORK_CIDR=$PUBLIC_NETWORK_GATEWAY/${FLOATING_RANGE#*/}
32-
echo "The IP address to set on br-ex was not specified. "
32+
echo "The IP address to set on $PUBLIC_BRIDGE was not specified. "
3333
echo "Defaulting to "$NSX_GATEWAY_NETWORK_CIDR
3434
fi
3535
# Make sure the interface is up, but not configured
@@ -42,14 +42,15 @@ function init_vmware_nsx {
4242
# only with mac learning enabled, portsecurity and security profiles disabled
4343
# The public bridge might not exist for the NSX plugin if Q_USE_DEBUG_COMMAND is off
4444
# Try to create it anyway
45-
sudo ovs-vsctl --no-wait -- --may-exist add-br $PUBLIC_BRIDGE
46-
sudo ovs-vsctl -- --may-exist add-port $PUBLIC_BRIDGE $NSX_GATEWAY_NETWORK_INTERFACE
45+
sudo ovs-vsctl --may-exist add-br $PUBLIC_BRIDGE
46+
sudo ovs-vsctl --may-exist add-port $PUBLIC_BRIDGE $NSX_GATEWAY_NETWORK_INTERFACE
4747
nsx_gw_net_if_mac=$(ip link show $NSX_GATEWAY_NETWORK_INTERFACE | awk '/ether/ {print $2}')
4848
sudo ip link set address $nsx_gw_net_if_mac dev $PUBLIC_BRIDGE
4949
for address in $addresses; do
5050
sudo ip addr add dev $PUBLIC_BRIDGE $address
5151
done
5252
sudo ip addr add dev $PUBLIC_BRIDGE $NSX_GATEWAY_NETWORK_CIDR
53+
sudo ip link set $PUBLIC_BRIDGE up
5354
}
5455

5556
function install_vmware_nsx {
@@ -63,7 +64,7 @@ function start_vmware_nsx {
6364
function stop_vmware_nsx {
6465
if ! is_set NSX_GATEWAY_NETWORK_CIDR; then
6566
NSX_GATEWAY_NETWORK_CIDR=$PUBLIC_NETWORK_GATEWAY/${FLOATING_RANGE#*/}
66-
echo "The IP address expected on br-ex was not specified. "
67+
echo "The IP address expected on $PUBLIC_BRIDGE was not specified. "
6768
echo "Defaulting to "$NSX_GATEWAY_NETWORK_CIDR
6869
fi
6970
sudo ip addr del $NSX_GATEWAY_NETWORK_CIDR dev $PUBLIC_BRIDGE

0 commit comments

Comments
 (0)