Commit acfd8238 authored by David Johnson's avatar David Johnson

Add shaping and virtualization options.

parent fd060981
......@@ -240,6 +240,10 @@ pc.defineParameter(
"aggregateSubnetBitSize","Aggregate Subnet Bit Size",
portal.ParameterType.INTEGER,29,
longDescription="Aggregate subnet bit size.")
pc.defineParameter(
"virtualizeAllFixedNodes","Virtualize all Fixed Nodes",
portal.ParameterType.BOOLEAN,False,
longDescription="If this is set, the con, fw, mboss, wifi, and mobile fixed nodes will be virtualized, in addition to the mops and inet fixed nodes. You only want to select this option if you don't care about performance testing; it isn't a good idea for any nodes on the high-bandwidth paths to be VMs for that, obviously.")
pc.defineParameter(
"doAllNucs","Add All Compute NUCs to Aggregates",
portal.ParameterType.BOOLEAN,False,
......@@ -272,15 +276,24 @@ pc.defineParameter(
longDescription="Maybe use trivial links.")
pc.defineParameter(
"linkSpeed","LAN/Link Speed",portal.ParameterType.INTEGER,1000000,
"fixedLinkSpeed","Core High-bandwidth Link Speed",
portal.ParameterType.INTEGER,0,
[(0,"Default"),(100000,"100Mb/s"),(1000000,"1Gb/s"),(10000000,"10Gb/s")],
longDescription="A specific link speed to use for the high-bandwidth paths (mboss<>fw, fw<>con. Other fixed node links are 1Gbps. If you force all fixed nodes to be VMs, the default value for this is 1Gbps; else, 10Gbps.")
pc.defineParameter(
"wifiLinkSpeed","WiFi Uplink Speed",portal.ParameterType.INTEGER,1000000,
[(0,"Any"),(100000,"100Mb/s"),(1000000,"1Gb/s"),(10000000,"10Gb/s")],
longDescription="A specific link speed to use for the wifi uplink. This value defaults to 1Gbps.")
pc.defineParameter(
"wifiLinkLatency","WiFi Uplink Latency",portal.ParameterType.LATENCY,0,
longDescription="A specific latency to use for the wifi uplink.")
pc.defineParameter(
"mobileLinkSpeed","Mobile Uplink Speed",portal.ParameterType.INTEGER,1000000,
[(0,"Any"),(100000,"100Mb/s"),(1000000,"1Gb/s"),(10000000,"10Gb/s")],
longDescription="A specific link speed to use for each LAN and link.")
longDescription="A specific link speed to use for the mobile uplink. This value defaults to 1Gbps.")
pc.defineParameter(
"linkLatency","LAN/Link Latency",portal.ParameterType.LATENCY,0,
longDescription="A specific latency to use for each LAN and link.")
#pc.defineParameter(
# "linkLoss","LAN/Link Loss",portal.ParameterType.FLOAT,0.0,
# longDescription="A specific loss rate to use for each LAN and link.")
"mobileLinkLatency","Mobile Uplink Latency",portal.ParameterType.LATENCY,0,
longDescription="A specific latency to use for the mobile uplink.")
params = pc.bindParameters()
......@@ -335,7 +348,7 @@ aggNodes = {}
disableTestbedRootKeys = True
TBCMD = "sudo mkdir -p /local/setup && sudo -H /local/repository/bin/setup-driver.sh 2>&1 | sudo tee /local/setup/setup-driver.log"
def applyGenericVhostSettings(node):
def applyGenericVirtNodeSettings(node):
node.exclusive = True
node.addService(pg.Execute(shell="sh",command=TBCMD))
if disableTestbedRootKeys:
......@@ -345,6 +358,8 @@ def applyGenericVhostSettings(node):
if params.hostImage:
node.disk_image = params.hostImage
applyGenericPhysNodeSettings = applyGenericVirtNodeSettings
def applyGenericVnodeSettings(node):
node.exclusive = True
node.addService(pg.Execute(shell="sh",command=TBCMD))
......@@ -357,14 +372,26 @@ def applyGenericVnodeSettings(node):
if params.ramPerVM:
node.ram = params.ramPerVM
if params.virtualizeAllFixedNodes:
virtFixedNodes = ["fw","mboss","mops","con","inet","wifi","mobile"]
physFixedNodes = []
else:
virtFixedNodes = ["mops","inet"]
physFixedNodes = ["fw","mboss","con","wifi","mobile"]
#
# First, create the fixed infrastructure.
#
for name in physFixedNodes:
node = pg.RawPC(name)
applyGenericPhysNodeSettings(node)
nodes[node.client_id] = node
pass
fixedVhost = pg.RawPC("fixedhost")
applyGenericVhostSettings(fixedVhost)
for name in ["fw","mboss","mops","con","inet","wifi","mobile"]:
applyGenericVirtNodeSettings(fixedVhost)
for name in virtFixedNodes:
node = ig.XenVM(name)
applyGenericVnodeSettings(node)
applyGenericVirtNodeSettings(node)
node.InstantiateOn(fixedVhost.client_id)
nodes[node.client_id] = node
clientvars.addVariable("%s_HOST" % (name),fixedVhost.client_id)
......@@ -382,7 +409,7 @@ for i in range(1,params.numAggregates+1):
if (i - 1) % params.aggregatesPerHost == 0:
vcount += 1
vhost = pg.RawPC("ctlnuc%d" % (vcount))
applyGenericVhostSettings(vhost)
applyGenericVirtNodeSettings(vhost)
agghosts[vhost.client_id] = vhost
vhostToAggMap[vhost.client_id] = []
aggName = "agg%d" % (i)
......@@ -437,11 +464,20 @@ def nextIfaceNum(node):
#
# Create the non-aggregate networks.
#
if params.fixedLinkSpeed == 0:
if params.virtualizeAllFixedNodes:
params.fixedLinkSpeed = 1000000
else:
params.fixedLinkSpeed = 10000000
for (mlist,name,shaping) in [
(["fw","con"],"conlink",[],),
(["con","mboss","mops"],"mlan",[]),
(["fw","mobile"],"mobileuplink",[]),
(["fw","wifi"],"wifiuplink",[]),
(["fw","con"],"conlink",
[params.fixedLinkSpeed,0]),
(["fw","mboss","mops"],"mlan",
[params.fixedLinkSpeed,0]),
(["fw","mobile"],"mobileuplink",
[params.wifiLinkSpeed,params.wifiLinkLatency]),
(["fw","wifi"],"wifiuplink",
[params.mobileLinkSpeed,params.mobileLinkLatency]),
(["fw","inet"],"inetuplink",[]) ]:
if len(mlist) == 2:
if not name:
......@@ -452,6 +488,11 @@ for (mlist,name,shaping) in [
name = "%s-lan" % (mlist[0])
lanlink = pg.LAN(name)
applyGenericNetworkSettings(lanlink)
if len(shaping) == 2:
if shaping[0]:
lanlink.bandwidth = int(shaping[0])
if shaping[1]:
lanlink.latency = int(shaping[1])
ifaces = map(lambda x: nodes[x].addInterface("if%d" % (nextIfaceNum(x))),
mlist)
map(lambda x: lanlink.addInterface(x),ifaces)
......
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