DISK_IMAGE = "urn:publicid:IDN+utah.cloudlab.us+image+emulab-ops//UBUNTU16-64-STD"

pc = portal.Context()
rspec = pg.Request()

pc.defineParameter(
    name="node_type",
    description=
    ("Hardware spec of node. <br> Refer to manuals at "
     "<a href=\"http://docs.aptlab.net/hardware.html#%28part._apt-cluster%29\">APT</a> "
     "for more details."),
    typ=portal.ParameterType.NODETYPE,
    defaultValue="r320",
    legalValues=[("r320", "APT r320"), ("c6220", "APT c6220")],
    advanced=False,
    groupId=None)
params = pc.bindParameters()

node = pg.RawPC("host")
node.hardware_type = params.node_type
node.disk_image = DISK_IMAGE
rspec.addResource(node)

instructions = "Use this profile to create a new Etalon disk image with the reTCP kernel patch."
desc = "A very basic profile with a single clean node."
tour = igext.Tour()
tour.Description(type=igext.Tour.TEXT, desc=desc)
tour.Instructions(type=igext.Tour.MARKDOWN, inst=instructions)
rspec.addTour(tour)
pc.printRequestRSpec(rspec)
# Create a portal context.
pc = portal.Context()

# Create a Request object to start building the RSpec.
request = pc.makeRequestRSpec()


tourDescription = \
"""
This profile provides the template for a compute node with Docker installed on Ubuntu 18.04
"""

#
# Setup the Tour info with the above description and instructions.
#  
tour = IG.Tour()
tour.Description(IG.Tour.TEXT,tourDescription)
request.addTour(tour)

prefixForIP = "192.168.1."

link = request.LAN("lan")

for i in range(4):
  if i == 0:
    node = request.RawPC("head")
  else:
    node = request.RawPC("worker-" + str(i))
  node.routable_control_ip = "true"
 
  node.disk_image = "urn:publicid:IDN+emulab.net+image+emulab-ops:UBUNTU16-64-STD"
示例#3
0
#!/usr/bin/env python

import geni.rspec.pg as rspec
import geni.rspec.igext as ig
import geni.portal as portal

pc = portal.Context()
rspec = pc.makeRequestRSpec()

tour = ig.Tour()
tour.Description(ig.Tour.TEXT, "Test description")
tour.Instructions(ig.Tour.TEXT, "Text instructions")

node1 = rspec.XenVM("src")
node2 = rspec.XenVM("dst")
link1 = rspec.Link("thelink", members=[node1, node2])

tour.addStep(ig.Tour.Step(node1, "This is the first node"))
tour.steps.append(ig.Tour.Step(node2, "This is the second node"))
tour.steps.append(ig.Tour.Step(link1, "This is the link"))

rspec.addTour(tour)
pc.printRequestRSpec()