From 41fcfe612c89af5e078ea632c8d9bb084ff0a40b Mon Sep 17 00:00:00 2001 From: vmud213 Date: Tue, 7 Mar 2017 09:37:22 +0000 Subject: [PATCH] Connect brbm-inspector and brbm when needed Ensure that brbm-inspector is connected to brbm only when IRONIC_IS_HARDWARE=False and IRONIC_BAREMETAL_BASIC_OPS=True. Otherwise bridge brbm does not exist and stack.sh exits with error. Change-Id: I8c255a0140ec6b33f801d13ca10a2bb19e7469f6 Closes-Bug: #1670595 --- devstack/plugin.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 5fcf196bd..795b41d83 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -34,6 +34,7 @@ IRONIC_INSPECTOR_INTERNAL_IP_WITH_NET="$IRONIC_INSPECTOR_INTERNAL_IP/$IRONIC_INS # Whether DevStack will be setup for bare metal or VMs IRONIC_IS_HARDWARE=$(trueorfalse False IRONIC_IS_HARDWARE) IRONIC_INSPECTOR_NODE_NOT_FOUND_HOOK=${IRONIC_INSPECTOR_NODE_NOT_FOUND_HOOK:-""} +IRONIC_INSPECTOR_OVS_PORT=${IRONIC_INSPECTOR_OVS_PORT:-brbm-inspector} GITDIR["python-ironic-inspector-client"]=$DEST/python-ironic-inspector-client GITREPO["python-ironic-inspector-client"]=${IRONIC_INSPECTOR_CLIENT_REPO:-${GIT_BASE}/openstack/python-ironic-inspector-client.git} @@ -253,11 +254,11 @@ function prepare_environment { prepare_tftp create_ironic_inspector_cache_dir - if [[ "$IRONIC_IS_HARDWARE" == "False" ]]; then - sudo ip link add brbm-inspector type veth peer name $IRONIC_INSPECTOR_INTERFACE - sudo ip link set dev brbm-inspector up - sudo ip link set dev brbm-inspector mtu $PUBLIC_BRIDGE_MTU - sudo ovs-vsctl add-port $IRONIC_VM_NETWORK_BRIDGE brbm-inspector + if [[ "$IRONIC_BAREMETAL_BASIC_OPS" == "True" && "$IRONIC_IS_HARDWARE" == "False" ]]; then + sudo ip link add $IRONIC_INSPECTOR_OVS_PORT type veth peer name $IRONIC_INSPECTOR_INTERFACE + sudo ip link set dev $IRONIC_INSPECTOR_OVS_PORT up + sudo ip link set dev $IRONIC_INSPECTOR_OVS_PORT mtu $PUBLIC_BRIDGE_MTU + sudo ovs-vsctl add-port $IRONIC_VM_NETWORK_BRIDGE $IRONIC_INSPECTOR_OVS_PORT fi sudo ip link set dev $IRONIC_INSPECTOR_INTERFACE up sudo ip link set dev $IRONIC_INSPECTOR_INTERFACE mtu $PUBLIC_BRIDGE_MTU @@ -302,8 +303,8 @@ function cleanup_inspector { if [[ $IRONIC_INSPECTOR_INTERFACE != $OVS_PHYSICAL_BRIDGE && "$IRONIC_INSPECTOR_INTERFACE_PHYSICAL" == "False" ]]; then sudo ip link show $IRONIC_INSPECTOR_INTERFACE && sudo ip link delete $IRONIC_INSPECTOR_INTERFACE fi - sudo ip link show brbm-inspector && sudo ip link delete brbm-inspector - sudo ovs-vsctl --if-exists del-port brbm-inspector + sudo ip link show $IRONIC_INSPECTOR_OVS_PORT && sudo ip link delete $IRONIC_INSPECTOR_OVS_PORT + sudo ovs-vsctl --if-exists del-port $IRONIC_INSPECTOR_OVS_PORT } function sync_inspector_database {