Commit be5b5483 authored by Robert Ricci's avatar Robert Ricci

More move examples to the portal

parent acc955d0
Pipeline #2182 passed with stages
in 2 minutes and 57 seconds
"""An example of constructing a profile with a single Xen VM.
Instructions:
Wait for the profile instance to start, and then log in to the VM via the
ssh port specified below. (Note that in this case, you will need to access
the VM through a high port on the physical host, since we have not requested
a public IP address for the VM itself.)
"""
import geni.portal as portal
import geni.rspec.pg as rspec
# Create a Request object to start building the RSpec.
request = portal.context.makeRequestRSpec()
# Create a XenVM
node = request.XenVM("node")
# Ask for two cores
node.cores = 2
# Ask for 2GB of ram
node.ram = 2048
# Add an extra 8GB virtual disk.
node.disk = 8
# Print the RSpec to the enclosing page.
portal.context.printRequestRSpec()
"""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.
"""
import geni.portal as portal
import geni.rspec.pg as rspec
request = portal.context.makeRequestRSpec()
# Create two raw "PC" nodes
node1 = request.RawPC("node1")
node2 = request.RawPC("node2")
# Set each of the two to specifically request "m400" nodes, which in CloudLab, are ARM
node1.hardware_type = "m400"
node2.hardware_type = "m400"
# Create a link between them
link1 = request.Link(members = [node1, node2])
portal.context.printRequestRSpec()
......@@ -119,12 +119,11 @@ is created.
@section[#:tag "geni-lib-example-two-arm-lan"]{Two ARM64 servers in a LAN}
@code-sample["geni-lib-two-arm-lan.py"]
@profile-code-sample["PortalProfiles" "two-arm-lan"]
We now come to demonstrate requesting particular properties of nodes---until
now, all nodes had been either @geni-lib["rspec.igext.XenVM" 'id]s or @geni-lib["rspec.pg.RawPC" 'id]s and (although
they might have had @seclink["geni-lib-example-two-vm-lan"]{interfaces added})
nothing further was said about them. @(geni-lib) allows the user to
now, all nodes had been either @geni-lib["rspec.igext.XenVM" 'id]s or @geni-lib["rspec.pg.RawPC" 'id]s and nothing further was said about them.
@(geni-lib) allows the user to
specify various details about the nodes, and this example makes use
of the @tt{hardware_type} property. The @tt{hardware_type} can be set
to a string describing the type of physical machine onto which the logical
......@@ -139,7 +138,7 @@ trial and error.
@section[#:tag "geni-lib-example-single-vm-sized"]{A VM with a custom size}
@code-sample["geni-lib-single-vm-sized.py"]
@profile-code-sample["PortalProfiles" "single-vm-sized"]
The earlier examples requesting VMs used the default number of cores, quantity
of RAM, and disk size. It's also possible to customize these value, as this
......
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