Merge "Always add OVS port in _move_neutron_addresses_route"
This commit is contained in:
@ -795,7 +795,8 @@ function stop_neutron {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# _move_neutron_addresses_route() - Move the primary IP to the OVS bridge
|
# _move_neutron_addresses_route() - Move the primary IP to the OVS bridge
|
||||||
# on startup, or back to the public interface on cleanup
|
# on startup, or back to the public interface on cleanup. If no IP is
|
||||||
|
# configured on the interface, just add it as a port to the OVS bridge.
|
||||||
function _move_neutron_addresses_route {
|
function _move_neutron_addresses_route {
|
||||||
local from_intf=$1
|
local from_intf=$1
|
||||||
local to_intf=$2
|
local to_intf=$2
|
||||||
@ -808,7 +809,8 @@ function _move_neutron_addresses_route {
|
|||||||
# on configure we will also add $from_intf as a port on $to_intf,
|
# on configure we will also add $from_intf as a port on $to_intf,
|
||||||
# assuming it is an OVS bridge.
|
# assuming it is an OVS bridge.
|
||||||
|
|
||||||
local IP_BRD=$(ip -f $af a s dev $from_intf | awk '/inet/ { print $2, $3, $4; exit }')
|
local IP_ADD=""
|
||||||
|
local IP_DEL=""
|
||||||
local DEFAULT_ROUTE_GW=$(ip r | awk "/default.+$from_intf/ { print \$3; exit }")
|
local DEFAULT_ROUTE_GW=$(ip r | awk "/default.+$from_intf/ { print \$3; exit }")
|
||||||
local ADD_OVS_PORT=""
|
local ADD_OVS_PORT=""
|
||||||
|
|
||||||
@ -828,7 +830,12 @@ function _move_neutron_addresses_route {
|
|||||||
ADD_OVS_PORT="sudo ovs-vsctl --may-exist add-port $to_intf $from_intf"
|
ADD_OVS_PORT="sudo ovs-vsctl --may-exist add-port $to_intf $from_intf"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sudo ip addr del $IP_BRD dev $from_intf; sudo ip addr add $IP_BRD dev $to_intf; $ADD_OVS_PORT; $ADD_DEFAULT_ROUTE
|
if [[ "$IP_BRD" != "" ]]; then
|
||||||
|
IP_ADD="sudo ip addr del $IP_BRD dev $from_intf"
|
||||||
|
IP_DEL="sudo ip addr add $IP_BRD dev $to_intf"
|
||||||
|
fi
|
||||||
|
|
||||||
|
$IP_ADD; $IP_DEL; $ADD_OVS_PORT; $ADD_DEFAULT_ROUTE
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -836,9 +843,7 @@ function _move_neutron_addresses_route {
|
|||||||
# runs that a clean run would need to clean up
|
# runs that a clean run would need to clean up
|
||||||
function cleanup_neutron {
|
function cleanup_neutron {
|
||||||
|
|
||||||
if [[ $(ip -f inet a s dev "$OVS_PHYSICAL_BRIDGE" | grep -c 'global') != 0 ]]; then
|
_move_neutron_addresses_route "$OVS_PHYSICAL_BRIDGE" "$PUBLIC_INTERFACE" False "inet"
|
||||||
_move_neutron_addresses_route "$OVS_PHYSICAL_BRIDGE" "$PUBLIC_INTERFACE" False "inet"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $(ip -f inet6 a s dev "$OVS_PHYSICAL_BRIDGE" | grep -c 'global') != 0 ]]; then
|
if [[ $(ip -f inet6 a s dev "$OVS_PHYSICAL_BRIDGE" | grep -c 'global') != 0 ]]; then
|
||||||
_move_neutron_addresses_route "$OVS_PHYSICAL_BRIDGE" "$PUBLIC_INTERFACE" False "inet6"
|
_move_neutron_addresses_route "$OVS_PHYSICAL_BRIDGE" "$PUBLIC_INTERFACE" False "inet6"
|
||||||
@ -1023,9 +1028,7 @@ function _configure_neutron_l3_agent {
|
|||||||
|
|
||||||
neutron_plugin_configure_l3_agent
|
neutron_plugin_configure_l3_agent
|
||||||
|
|
||||||
if [[ $(ip -f inet a s dev "$PUBLIC_INTERFACE" | grep -c 'global') != 0 ]]; then
|
_move_neutron_addresses_route "$PUBLIC_INTERFACE" "$OVS_PHYSICAL_BRIDGE" True "inet"
|
||||||
_move_neutron_addresses_route "$PUBLIC_INTERFACE" "$OVS_PHYSICAL_BRIDGE" True "inet"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $(ip -f inet6 a s dev "$PUBLIC_INTERFACE" | grep -c 'global') != 0 ]]; then
|
if [[ $(ip -f inet6 a s dev "$PUBLIC_INTERFACE" | grep -c 'global') != 0 ]]; then
|
||||||
_move_neutron_addresses_route "$PUBLIC_INTERFACE" "$OVS_PHYSICAL_BRIDGE" False "inet6"
|
_move_neutron_addresses_route "$PUBLIC_INTERFACE" "$OVS_PHYSICAL_BRIDGE" False "inet6"
|
||||||
|
Reference in New Issue
Block a user