diff --git a/labs/config/openstack b/labs/config/openstack index 55caddec..40367931 100644 --- a/labs/config/openstack +++ b/labs/config/openstack @@ -8,5 +8,14 @@ : ${MGMT_NET:=10.10.10.1} : ${DATA_NET:=10.20.20.1} : ${API_NET:=192.168.100.1} +# FIXME API_NET and EXT_NET should be different networks as soon as our +# setup allows it. +: ${EXT_NET:=192.168.100.1} + +# EXT_NET +: ${FLOATING_IP_START:=192.168.100.101} +: ${FLOATING_IP_END:=192.168.100.200} +: ${EXTERNAL_NETWORK_GATEWAY:=192.168.100.1} +: ${EXTERNAL_NETWORK_CIDR:=192.168.100.0/24} # vim: set ai ts=4 sw=4 et ft=sh: diff --git a/labs/config/scripts.controller b/labs/config/scripts.controller index 5988f705..513bfc62 100644 --- a/labs/config/scripts.controller +++ b/labs/config/scripts.controller @@ -8,6 +8,7 @@ scripts setup_neutron_controller.sh scripts setup_cinder_controller.sh scripts setup_cinder_volumes.sh scripts setup_horizon.sh +scripts config_external_network.sh scripts shutdown.sh boot wait_for_shutdown diff --git a/labs/scripts/config_external_network.sh b/labs/scripts/config_external_network.sh new file mode 100755 index 00000000..7f52bd7e --- /dev/null +++ b/labs/scripts/config_external_network.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash +TOP_DIR=$(cd $(dirname "$0")/.. && pwd) +source "$TOP_DIR/config/paths" +source "$CONFIG_DIR/credentials" +source "$LIB_DIR/functions.guest" +source "$CONFIG_DIR/admin-openstackrc.sh" +exec_logfile + +indicate_current_auto + +#------------------------------------------------------------------------------ +# Create the external network and a subnet on it. +#------------------------------------------------------------------------------ + +echo "Creating the external network." +neutron net-create ext-net --shared --router:external=True + +echo "Creating a subnet on the external network." +neutron subnet-create ext-net \ + --name ext-subnet \ + --allocation-pool start="$FLOATING_IP_START,end=$FLOATING_IP_END" \ + --disable-dhcp \ + --gateway "$EXTERNAL_NETWORK_GATEWAY" \ + "$EXTERNAL_NETWORK_CIDR"