Commit 52a9c335 authored by David Johnson's avatar David Johnson

More changes for role-based configuration.

parent bd37803c
......@@ -84,7 +84,7 @@ pc.defineParameter(
pc.defineParameter(
"clusterCount","Number of OpenStack clusters",
portal.ParameterType.INTEGER,2,advanced=True,
portal.ParameterType.INTEGER,1,advanced=True,
longDescription="You can create multiple OpenStack clusters within a single experiment by setting this parameter > 1. Note that any settings you have chosen will be applied to each cluster, other than those regarding remote blockstore mounting.")
pc.defineParameter(
"clusterChooseSite","Choose Site for each OpenStack cluster",
......
......@@ -255,7 +255,6 @@ fi
# global labels.
#
if [ ! -e $OURDIR/parameters ]; then
touch $OURDIR/parameters
python2 manifest-to-parameters.py $OURDIR/manifests.0.xml > $OURDIR/parameters
fi
. $OURDIR/parameters
......@@ -271,7 +270,7 @@ fi
#
# Figure out which nodes/lans in our cluster are in which roles.
#
if [ ! -f $OURDIR/labels ]; then
if [ ! -f $OURDIR/groupvars ]; then
python2 $DIRNAME/manifest-to-groupvars.py $OURDIR/manifests.0.xml $CLUSTER > $OURDIR/groupvars
fi
. $OURDIR/groupvars
......@@ -337,20 +336,20 @@ OSOCATA=15
OSPIKE=16
OSQUEENS=17
OSROCKY=18
OSSTEIN=19
. /etc/lsb-release
#
# Allow a specific release to trump the image defaults, maybe.
#
if [ ! "x$RELEASE" = "x" ]; then
OSCODENAME="$RELEASE"
if [ $OSCODENAME = "mitaka" ]; then OSVERSION=$OSMITAKA ; fi
if [ $OSCODENAME = "newton" ]; then OSVERSION=$OSNEWTON ; fi
if [ $OSCODENAME = "ocata" ]; then OSVERSION=$OSOCATA ; fi
if [ $OSCODENAME = "pike" ]; then OSVERSION=$OSPIKE ; fi
if [ $OSCODENAME = "queens" ]; then OSVERSION=$OSQUEENS ; fi
if [ $OSCODENAME = "rocky" ]; then OSVERSION=$OSROCKY ; fi
if [ $OSCODENAME = "stein" ]; then OSVERSION=$OSSTEIN ; fi
if [ $RELEASE = "mitaka" ]; then OSVERSION=$OSMITAKA ; fi
if [ $RELEASE = "newton" ]; then OSVERSION=$OSNEWTON ; fi
if [ $RELEASE = "ocata" ]; then OSVERSION=$OSOCATA ; fi
if [ $RELEASE = "pike" ]; then OSVERSION=$OSPIKE ; fi
if [ $RELEASE = "queens" ]; then OSVERSION=$OSQUEENS ; fi
if [ $RELEASE = "rocky" ]; then OSVERSION=$OSROCKY ; fi
if [ $RELEASE = "stein" ]; then OSVERSION=$OSSTEIN ; fi
fi
DISTRIB_MAJOR=`echo $DISTRIB_RELEASE | cut -d. -f1`
......@@ -429,45 +428,17 @@ fi
# an fqdn map. First we tried the GENI way; then the old Emulab way with
# topomap.
#
NODES=`cat $OURDIR/fqdn.map | cut -f1 | xargs`
FQDNS=`cat $OURDIR/fqdn.map | cut -f2 | xargs`
if [ -z "${COMPUTENODES}" ]; then
# Figure out which networkmanager (netmgr) and controller (ctrl) names we have
for node in $NODES
do
if [ "$node" = "networkmanager" ]; then
NETWORKMANAGER="networkmanager"
fi
if [ "$node" = "controller" ]; then
# If we were using the controller as storage and object host, then
# keep using it (just use the old name we've detected).
if [ "$STORAGEHOST" = "$CONTROLLER" ]; then
STORAGEHOST="controller"
fi
if [ "$OBJECTHOST" = "$CONTROLLER" ]; then
OBJECTHOST="controller"
fi
CONTROLLER="controller"
fi
done
# Figure out which ones are the compute nodes
for node in $NODES
do
if [ "$node" != "$CONTROLLER" -a "$node" != "$NETWORKMANAGER" \
-a "$node" != "$STORAGEHOST" -a "$node" != "$OBJECTHOST" ]; then
COMPUTENODES="$COMPUTENODES $node"
fi
done
fi
ALLNODES=`cat $OURDIR/fqdn.map | cut -f1 | xargs`
ALLFQDNS=`cat $OURDIR/fqdn.map | cut -f2 | xargs`
OTHERNODES=""
for node in $NODES
do
[ "$node" = "$NODEID" ] && continue
#
# Create a list of just the nodes in our cluster.
#
NODES="$CONTROLLER $COMPUTE"
OTHERNODES="$OTHERNODES $node"
done
NETWORKMANAGER="$CONTROLLER"
STORAGEHOST="$CONTROLLER"
OBJECTHOST="$CONTROLLER"
# Save the node stuff off to settings
grep CONTROLLER $SETTINGS
......@@ -566,7 +537,7 @@ if [ ! -f $OURDIR/mgmt-hosts ] ; then
| sed -n -e "s/^.* MASK=\([0-9\.]*\) .* LAN=${MGMTLAN}.*$/\1/p" \
> $OURDIR/mgmt-netmask
for lan in $DATAFLATLANS ; do
for lan in $FLATLAN ; do
cat $TOPOMAP | grep -v '^#' | sed -e 's/,/ /' \
| sed -n -e "s/\([a-zA-Z0-9_\-]*\) .*${lan}:\([0-9\.]*\).*\$/\2\t\1/p" \
> $OURDIR/data-hosts.$lan
......@@ -677,7 +648,7 @@ fi
#
# Setup IP configuration for vlan networks
#
for lan in $DATAVLANS ; do
for lan in $VLAN ; do
if [ -f $OURDIR/ipinfo.$lan ]; then
continue
fi
......@@ -728,25 +699,19 @@ if [ ! -e $OURDIR/info.mgmt ]; then
MGMTIP=`grep -E "$NODEID$" $OURDIR/mgmt-hosts | head -1 | sed -n -e 's/^\\([0-9]*\\.[0-9]*\\.[0-9]*\\.[0-9]*\\).*$/\\1/p'`
MGMTNETMASK=`cat $OURDIR/mgmt-netmask`
MGMTPREFIX=`netmask2prefix $MGMTNETMASK`
if [ -z "$MGMTLAN" ] ; then
MGMTVLAN=0
MVMTVLANDEV=
MGMTMAC=""
MGMT_NETWORK_INTERFACE="tun0"
cat ${BOOTDIR}/tmcc/ifconfig | grep "IFACETYPE=vlan" | grep "${MGMTLAN}"
if [ $? = 0 ]; then
MGMTVLAN=1
MGMTMAC=`cat ${BOOTDIR}/tmcc/ifconfig | sed -n -e "s/^.* VMAC=\([0-9a-f:\.]*\) .* LAN=${MGMTLAN}.*\$/\1/p"`
MGMT_NETWORK_INTERFACE=`/usr/local/etc/emulab/findif -m $MGMTMAC`
MGMTVLANDEV=`ip link show ${MGMT_NETWORK_INTERFACE} | sed -n -e "s/^.*${MGMT_NETWORK_INTERFACE}\@\([0-9a-zA-Z_]*\): .*\$/\1/p"`
MGMTVLANTAG=`cat ${BOOTDIR}/tmcc/ifconfig | sed -n -e "s/^.* LAN=${MGMTLAN} VTAG=\([0-9]*\).*\$/\1/p"`
else
cat ${BOOTDIR}/tmcc/ifconfig | grep "IFACETYPE=vlan" | grep "${MGMTLAN}"
if [ $? = 0 ]; then
MGMTVLAN=1
MGMTMAC=`cat ${BOOTDIR}/tmcc/ifconfig | sed -n -e "s/^.* VMAC=\([0-9a-f:\.]*\) .* LAN=${MGMTLAN}.*\$/\1/p"`
MGMT_NETWORK_INTERFACE=`/usr/local/etc/emulab/findif -m $MGMTMAC`
MGMTVLANDEV=`ip link show ${MGMT_NETWORK_INTERFACE} | sed -n -e "s/^.*${MGMT_NETWORK_INTERFACE}\@\([0-9a-zA-Z_]*\): .*\$/\1/p"`
MGMTVLANTAG=`cat ${BOOTDIR}/tmcc/ifconfig | sed -n -e "s/^.* LAN=${MGMTLAN} VTAG=\([0-9]*\).*\$/\1/p"`
else
MGMTVLAN=0
MGMTMAC=`cat ${BOOTDIR}/tmcc/ifconfig | sed -n -e "s/.* MAC=\([0-9a-f:\.]*\) .* LAN=${MGMTLAN}/\1/p"`
MGMT_NETWORK_INTERFACE=`/usr/local/etc/emulab/findif -m $MGMTMAC`
MGMTVLANDEV=
fi
MGMTVLAN=0
MGMTMAC=`cat ${BOOTDIR}/tmcc/ifconfig | sed -n -e "s/.* MAC=\([0-9a-f:\.]*\) .* LAN=${MGMTLAN}/\1/p"`
MGMT_NETWORK_INTERFACE=`/usr/local/etc/emulab/findif -m $MGMTMAC`
MGMTVLANDEV=
fi
echo "MGMTIP='$MGMTIP'" >> $OURDIR/info.mgmt
echo "MGMTNETMASK='$MGMTNETMASK'" >> $OURDIR/info.mgmt
......@@ -764,7 +729,7 @@ fi
# NB: this IP/mask is only valid after data ips have been assigned, because
# they might not be the Emulab ones.
#
for lan in $DATAFLATLANS ; do
for lan in $FLATLAN ; do
if [ -e $OURDIR/info.$lan ] ; then
continue
fi
......@@ -801,7 +766,7 @@ for lan in $DATAFLATLANS ; do
echo "DATADEV=${DATADEV}" >> $OURDIR/info.$lan
done
for lan in $DATAVLANS ; do
for lan in $VLAN ; do
if [ -e $OURDIR/info.$lan ] ; then
continue
fi
......@@ -834,25 +799,25 @@ if [ ! -f $OURDIR/neutron.vars ]; then
#
network_types=""
# NB: we always configure flat, because the external net is flat
#if [ -n "${DATAFLATLANS}" ]; then
#if [ -n "${FLATLAN}" ]; then
if [ -n "${network_types}" ]; then
network_types="${network_types},"
fi
network_types="${network_types}flat"
#fi
if [ -n "${DATAFLATLANS}" -a ${DATATUNNELS} -gt 0 ]; then
if [ -n "${FLATLAN}" -a ${DATATUNNELS} -gt 0 ]; then
if [ -n "${network_types}" ]; then
network_types="${network_types},"
fi
network_types="${network_types}gre"
fi
if [ -n "${DATAVLANS}" ]; then
if [ -n "${VLAN}" ]; then
if [ -n "${network_types}" ]; then
network_types="${network_types},"
fi
network_types="${network_types}vlan"
fi
if [ -n "${DATAVXLANS}" ]; then
if [ -n "${VXLAN}" ]; then
if [ -n "${network_types}" ]; then
network_types="${network_types},"
fi
......@@ -865,7 +830,7 @@ if [ ! -f $OURDIR/neutron.vars ]; then
# What are our flat networks?
#
flat_networks="external"
for lan in $DATAFLATLANS ; do
for lan in $FLATLAN ; do
if [ -n "${flat_networks}" ]; then
flat_networks="${flat_networks},"
fi
......@@ -891,7 +856,7 @@ if [ ! -f $OURDIR/neutron.vars ]; then
if [ "${ML2PLUGIN}" = "linuxbridge" ]; then
extra_mappings="physical_interface_mappings=external:${EXTERNAL_NETWORK_INTERFACE}"
fi
for lan in $DATAFLATLANS ; do
for lan in $FLATLAN ; do
. $OURDIR/info.${lan}
if [ "${ML2PLUGIN}" = "linuxbridge" ]; then
extra_mappings="${extra_mappings},${lan}:${DATADEV}"
......@@ -902,7 +867,7 @@ if [ ! -f $OURDIR/neutron.vars ]; then
bridge_mappings="${bridge_mappings},${lan}:${DATABRIDGE}"
fi
done
for lan in $DATAVLANS ; do
for lan in $VLAN ; do
. $OURDIR/info.${lan}
# NB: neutron doesn't like to see the same map entry multiple times...
echo "$bridge_mappings" | grep -q "${DATAVLANDEV}:"
......@@ -927,7 +892,7 @@ if [ ! -f $OURDIR/neutron.vars ]; then
# Figure out the network_vlan_ranges
#
network_vlan_ranges=""
for lan in $DATAVLANS ; do
for lan in $VLAN ; do
. $OURDIR/info.${lan}
if [ -n "${network_vlan_ranges}" ] ; then
network_vlan_ranges="${network_vlan_ranges},"
......@@ -943,7 +908,7 @@ if [ ! -f $OURDIR/neutron.vars ]; then
gre_local_ip=""
enable_tunneling=""
tunnel_types=""
for lan in $DATAFLATLANS ; do
for lan in $FLATLAN ; do
. $OURDIR/info.$lan
# Just use the first one
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment