Commit a5a80096 authored by David Johnson's avatar David Johnson

Support attaching a blockstore to one of the nodes.

parent 470ced12
......@@ -41,7 +41,6 @@ pc.defineParameter("osLinkSpeed", "Experiment Link Speed of all nodes",
[(0,"Any"),(1000000,"1Gb/s"),(10000000,"10Gb/s")],
longDescription="A specific link speed to use for each node. All experiment network interfaces will request this speed.")
pc.defineParameter("doAptUpgrade","Upgrade OpenStack packages and dependencies to the latest versions",
portal.ParameterType.BOOLEAN, False,advanced=True,
longDescription="The default images this profile uses have OpenStack and dependent packages preloaded. To guarantee that these scripts always work, we no longer upgrade to the latest packages by default, to avoid changes. If you want to ensure you have the latest packages, you should enable this option -- but if there are setup failures, we can't guarantee support. NOTE: selecting this option requires that you also select the option to update the Apt package cache!")
......@@ -81,6 +80,16 @@ pc.defineParameter("computeNodeCountSite2", "Number of compute nodes at Site 2",
portal.ParameterType.INTEGER, 0,advanced=True,
longDescription="You can add additional compute nodes from other CloudLab clusters, allowing you to experiment with remote VMs controlled from the central controller at the first site.")
pc.defineParameter("blockstoreURN", "Remote Block Store URN",
portal.ParameterType.STRING, "",advanced=True,
longDescription="The URN of a remote block store that already exists that you want attached to the node you specified (defaults to the ctl node). The block store must exist at the cluster at which you instantiate the profile!")
pc.defineParameter("blockstoreMountNode", "Remote Block Store Mount Node",
portal.ParameterType.STRING, "ctl",advanced=True,
longDescription="The node on which you want your remote block store mounted; defaults to the controller node.")
pc.defineParameter("blockstoreMountPoint", "Remote Block Store Mount Point",
portal.ParameterType.STRING, "/storage",advanced=True,
longDescription="The mount point at which you want your remote block store mounted.")
pc.defineParameter("ipAllocationStrategy","IP Addressing",
portal.ParameterType.STRING,"script",[("cloudlab","CloudLab"),("script","This Script")],
longDescription="Either let CloudLab auto-generate IP addresses for the nodes in your OpenStack networks, or let this script generate them. If you include nodes at multiple sites, you must choose this script! The default is this script, because the subnets CloudLab generates for flat networks are sized according to the number of physical nodes in your topology. However, when the profile sets up your flat OpenStack networks, it tries to enable your VMs and physical nodes to talk to each other---so they all must be on the same subnet. Thus, you may not have many IPs left for VMs. However, if the script IP address generation is buggy or otherwise insufficient, you can fall back to CloudLab and see if that improves things.",
......@@ -476,10 +485,13 @@ else:
image_tag_cp = 'OSCP'
pass
nodes = dict({})
#
# Add the controller node.
#
controller = RSpec.RawPC(params.controllerHost)
nodes[params.controllerHost] = controller
if params.osNodeType:
controller.hardware_type = params.osNodeType
pass
......@@ -505,12 +517,12 @@ if mgmtlan:
pass
controller.addService(RSpec.Install(url=TBURL, path="/tmp"))
controller.addService(RSpec.Execute(shell="sh",command=TBCMD))
rspec.addResource(controller)
#
# Add the network manager (neutron) node.
#
networkManager = RSpec.RawPC(params.networkManagerHost)
nodes[params.networkManagerHost] = networkManager
if params.osNodeType:
networkManager.hardware_type = params.osNodeType
pass
......@@ -536,7 +548,6 @@ if mgmtlan:
pass
networkManager.addService(RSpec.Install(url=TBURL, path="/tmp"))
networkManager.addService(RSpec.Execute(shell="sh",command=TBCMD))
rspec.addResource(networkManager)
#
# Add the compute nodes. First we generate names for each node at each site;
......@@ -562,6 +573,7 @@ for i in range(1,params.computeNodeCountSite2 + 1):
for (siteNumber,cpnameList) in computeNodeNamesBySite.iteritems():
for cpname in cpnameList:
cpnode = RSpec.RawPC(cpname)
nodes[cpname] = cpnode
if params.osNodeType:
cpnode.hardware_type = params.osNodeType
pass
......@@ -587,15 +599,53 @@ for (siteNumber,cpnameList) in computeNodeNamesBySite.iteritems():
pass
cpnode.addService(RSpec.Install(url=TBURL, path="/tmp"))
cpnode.addService(RSpec.Execute(shell="sh",command=TBCMD))
rspec.addResource(cpnode)
computeNodeList += cpname + ' '
pass
pass
#
# Add the blockstore, if requested.
#
bsnode = None
bslink = None
if params.blockstoreURN != "":
if not nodes.has_key(params.blockstoreMountNode):
#
# This is a very late time to generate a warning, but that's ok!
#
perr = portal.ParameterError("The node on which you mount your block store must exist, and does not!",
['blockstoreMountNode'])
pc.reportError(perr)
pc.verifyParameters()
pass
rbsn = nodes[params.blockstoreMountNode]
myintf = rbsn.addInterface("ifbs0")
bsnode = IG.RemoteBlockstore("bsnode",params.blockstoreMountPoint)
bsnode.Site("1")
bsintf = bsnode.interface
bsnode.dataset = params.blockstoreURN
#bsnode.size = params.N
bslink = RSpec.Link("bslink")
bslink.addInterface(myintf)
bslink.addInterface(bsintf)
# Special blockstore attributes for this link.
bslink.best_effort = True
bslink.vlan_tagging = True
pass
for nname in nodes.keys():
rspec.addResource(nodes[nname])
if bsnode:
rspec.addResource(bsnode)
for datalan in alllans:
rspec.addResource(datalan)
if mgmtlan:
rspec.addResource(mgmtlan)
if bslink:
rspec.addResource(bslink)
pass
#
......
......@@ -54,6 +54,7 @@ DISABLE_SECURITY_GROUPS=0
DEFAULT_SECGROUP_ENABLE_SSH_ICMP=1
VERBOSE_LOGGING="False"
DEBUG_LOGGING="False"
SUPPORT_DYNAMIC_NODES=1
KEYSTONEAPIVERSION=""
TOKENTIMEOUT=14400
SESSIONTIMEOUT=14400
......@@ -312,6 +313,11 @@ if [ ! -f $TOPOMAP -o $UPDATING -ne 0 ]; then
cp -p $TOPOMAP $TOPOMAP.old
fi
$TMCC topomap | gunzip > $TOPOMAP
# Filter out blockstore nodes
cat $TOPOMAP | grep -v '^bsnode,' > $TOPOMAP.no.bsnode
mv $TOPOMAP.no.bsnode $TOPOMAP
cat $TOPOMAP | grep -v '^bslink,' > $TOPOMAP.no.bslink
mv $TOPOMAP.no.bslink $TOPOMAP
if [ -f $TOPOMAP.old ]; then
diff -u $TOPOMAP.old $TOPOMAP > $TOPOMAP.diff
#
......@@ -349,17 +355,37 @@ if [ \( -s $OURDIR/manifests.xml \) -a \( ! \( -s $OURDIR/fqdn.map \) \) ]; then
if [ -s $OURDIR/fqdn.map ]; then
echo '' >> $OURDIR/fqdn.map
fi
# Filter out any blockstore nodes
# XXX: this strategy doesn't work, because only the NM node makes
# the fqdn.map file. So, just look for bsnode for now.
#BSNODES=`cat /var/emulab/boot/tmcc/storageconfig | sed -n -e 's/^.* HOSTID=\([^ \t]*\) .*$/\1/p' | xargs`
#for bs in $BSNODES ; do
# cat $OURDIR/fqdn.map | grep -v "^${bs}"$'\t' > $OURDIR/fqdn.map.tmp
# mv $OURDIR/fqdn.map.tmp $OURDIR/fqdn.map
#done
# XXX: why doesn't the tab grep work here, sigh...
#cat $OURDIR/fqdn.map | grep -v '^bsnode'$'\t' > $OURDIR/fqdn.map.tmp
cat $OURDIR/fqdn.map | grep -v '^bsnode' > $OURDIR/fqdn.map.tmp
mv $OURDIR/fqdn.map.tmp $OURDIR/fqdn.map
fi
#
# Setup the fqdn map the non-geni way if necessary!
#
if [ ! -s $OURDIR/fqdn.map ]; then
NODES=`cat $TOPOMAP | grep -v '^#' | sed -n -e 's/^\([a-zA-Z0-9\-]*\),.*:.*$/\1/p' | xargs`
TNODES=`cat $TOPOMAP | grep -v '^#' | sed -n -e 's/^\([a-zA-Z0-9\-]*\),.*:.*$/\1/p' | xargs`
FQDNS=""
for n in $NODES ; do
NODES=""
for n in $TNODES ; do
# Filter out any blockstore nodes
grep -q "HOSTID=$n " /var/emulab/boot/tmcc/storageconfig
if [ $? -eq 0 ] ; then
continue
fi
fqdn="$n.$EEID.$EPID.$OURDOMAIN"
FQDNS="${FQDNS} $fqdn"
NODES="${NODES} $n"
/bin/echo -e "$n\t$fqdn" >> $OURDIR/fqdn.map
done
......
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