setup-ovs.sh 1.15 KB
Newer Older
1 2 3
#!/bin/sh

#
4 5 6 7
# For a neutron setup, we have to move the external interface into
# br-ex, and copy its config to br-ex; move the data lan (ethX) into br-int,
# and copy its config to br-int .  For now, we assume the default route of
# the machine is associated with eth0/br-ex .
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
#

set -x

# Gotta know the rules!
if [ $EUID -ne 0 ] ; then
    echo "This script must be run as root" 1>&2
    exit 1
fi

DIRNAME=`dirname $0`

# Grab our libs
. "$DIRNAME/setup-lib.sh"

if [ "$HOSTNAME" != "$NETWORKMANAGER" ]; then
    exit 0;
fi

27 28
logtstart "ovs"

29 30 31 32 33
maybe_install_packages pssh
PSSH='/usr/bin/parallel-ssh -t 0 -O StrictHostKeyChecking=no '
PHOSTS=""
mkdir -p $OURDIR/pssh.setup-ovs-node.stdout $OURDIR/pssh.setup-ovs-node.stderr

34
# Do the network manager node first, no ssh
35
echo "*** Setting up OpenVSwitch on $HOSTNAME"
36 37
$DIRNAME/setup-ovs-node.sh

38
for node in $NODES
39
do
40 41
    [ "$node" = "$NETWORKMANAGER" ] && continue

David Johnson's avatar
David Johnson committed
42
    fqdn=`getfqdn $node`
43
    PHOSTS="$PHOSTS -H $fqdn"
44 45
done

46 47 48 49
echo "*** Setting up OpenVSwitch via pssh: $PHOSTS"
$PSSH -o $OURDIR/pssh.setup-ovs-node.stdout -e $OURDIR/pssh.setup-ovs-node.stderr \
    $PHOSTS $DIRNAME/setup-ovs-node.sh

50 51
logtend "ovs"

52
exit 0