geni-lib-single-vm.py 757 Bytes
Newer Older
1 2 3 4 5 6 7 8 9
"""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.)
"""

10 11
# Import the Portal object.
import geni.portal as portal
12
# Import the ProtoGENI library.
13
import geni.rspec.pg as pg
14 15 16

# Create the Portal context.
pc = portal.Context()
17
 
18
# Create a Request object to start building the RSpec.
19 20
rspec = pg.Request()
 
21
# Create a XenVM and add it to the RSpec.
22 23
node = pg.XenVM("node")
rspec.addResource(node)
24

25
# Print the RSpec to the enclosing page.
26
pc.printRequestRSpec(rspec)