-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcloudlab.profile
50 lines (39 loc) · 1.4 KB
/
cloudlab.profile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
"""Two 10-core servers connected by ConnectX-4 NIC for running AIFM."""
# Import the Portal object.
import geni.portal as portal
# Import the ProtoGENI library.
import geni.rspec.pg as pg
# Import the Emulab specific extensions.
import geni.rspec.emulab as emulab
# Describe the parameter(s) this profile script can accept.
portal.context.defineParameter( "n", "Number of Machines", portal.ParameterType.INTEGER, 2 )
# Retrieve the values the user specifies during instantiation.
params = portal.context.bindParameters()
# Create a portal object,
pc = portal.Context()
# Create a Request object to start building the RSpec.
request = pc.makeRequestRSpec()
nodes = []
ifaces = []
# nodes.append(node_0)
# ifaces.append(iface0)
for i in range(0, params.n):
n = request.RawPC('node-%d' % i)
n.routable_control_ip = True
n.hardware_type = 'xl170'
n.disk_image = 'urn:publicid:IDN+emulab.net+image+emulab-ops//UBUNTU18-64-STD'
bs = n.Blockstore('bs-%d' % i, "/home")
bs.size = "400GB"
intf = n.addInterface('interface-%d' % i, pg.IPv4Address('192.168.6.%d' % (i + 1),'255.255.255.0'))
nodes.append(n)
ifaces.append(intf)
# Link link-0
link_0 = request.LAN('link-0')
link_0.best_effort = False
link_0.bandwidth = 25000000
link_0.setNoInterSwitchLinks()
link_0.Site('undefined')
for iface in ifaces:
link_0.addInterface(iface)
# Print the generated rspec
pc.printRequestRSpec(request)