geni-lib-local-diskspace.py 1.05 KB
Newer Older
Leigh Stoller's avatar
Leigh Stoller committed
1 2 3 4 5 6 7 8 9
"""This profile demonstrates how to add some extra *local* disk space on your node. In general nodes have much more disk space then what you see with `df` when you log in. That extra space is in unallocated partitions or additional disk drives. An *ephemeral blockstore* is how you ask for some of that space to be allocated and mounted as a **temporary** filesystem (temporary means it will be lost when you terminate your experiment).

Instructions:
Log into your node, your **temporary** file system in mounted at `/mydata`.
"""

# Import the Portal object.
import geni.portal as portal
# Import the ProtoGENI library.
10
import geni.rspec.pg as rspec
Leigh Stoller's avatar
Leigh Stoller committed
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
# Import the emulab extensions library.
import geni.rspec.emulab

# Create a portal context.
pc = portal.Context()

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

# Allocate a node and ask for a 30GB file system mounted at /mydata
node = request.RawPC("node")
bs = node.Blockstore("bs", "/mydata")
bs.size = "30GB"

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