-#!/bin/sh -ex
+#!/bin/bash -ex
##############################################################################
# All rights reserved. This program and the accompanying materials
nova keypair-add --pub-key ~/.ssh/id_rsa.pub ubuntu-keypair
# configure external network
-neutron net-create ext-net --router:external --provider:physical_network external --provider:network_type flat
+neutron net-create ext-net --shared --router:external --provider:physical_network external --provider:network_type flat
##
## Parse Network config
##
EXTERNAL_NETWORK=`grep floating-ip-range deployconfig.yaml | cut -d ' ' -f 4 `
+
# split EXTERNAL_NETWORK=first ip;last ip; gateway;network
-IFS=',' read -r -a EXTNET <<< "$EXTERNAL_NETWORK"
+
+EXTNET=(${EXTERNAL_NETWORK//,/ })
EXTNET_FIP=${EXTNET[0]}
EXTNET_LIP=${EXTNET[1]}
# create pool of floating ips
i=0
-while [ $i -ne 10 ]; do
+while [ $i -ne 5 ]; do
neutron floatingip-create ext-net
i=$((i + 1))
done