geni-lib-two-arm-lan.py 841 Bytes
Newer Older
1 2 3 4 5 6 7
"""An example of constructing a profile with two ARM64 nodes connected by a LAN.

Instructions:
Wait for the profile instance to start, and then log in to either host via the
ssh ports specified below.
"""

8
import geni.portal as portal
9
import geni.rspec.pg as rspec
10

11
request = portal.context.makeRequestRSpec()
12 13

# Create two raw "PC" nodes
14 15
node1 = request.RawPC("node1")
node2 = request.RawPC("node2")
16 17 18 19 20 21 22 23 24

# Set each of the two to specifically request "m400" nodes, which in CloudLab, are ARM
node1.hardware_type = "m400"
node2.hardware_type = "m400"

# Create interfaces for each node.
iface1 = node1.addInterface("if1")
iface2 = node2.addInterface("if2")

25 26
# Create a link with type LAN.
link = request.LAN("lan")
27 28 29 30 31

# Add both node interfaces to the link.
link.addInterface(iface1)
link.addInterface(iface2)

32
portal.context.printRequestRSpec()