geni.rspec.emulab.emuext

Common set of RSpec extensions supported by many Emulab-based aggregates

class Attribute(key, value)[source]

Added to a node, this Emulab extension becomes a node_attribute.

A bridged link is syntactic sugar used to create two links separated by an Emulab delay (bridge) node. The BridgedLink class will create the following topology:

left-link right-link

node1 =========== bridge ============ node2

The bridge is a special node type (sliver_type=”delay”) that tells the CM to insert an Emulab delay node instead of a plain (router) node. A delay node is a transparent Ethernet bridge between the left and right segments above, but on which the traffic can be shaped wrt. bandwidth, latency, and loss. For example:

# Create the bridged link between the two nodes. link = request.BridgedLink(“link”) # Add two interfaces link.addInterface(iface1) link.addInterface(iface2) # Give the link (bridge) some shaping parameters. link.bandwidth = 10000 link.latency = 15 link.plr = 0.01

addInterface(interface)[source]
property bandwidth
property latency
property plr
class ExperimentFirewall(name, style)[source]

Added to a request this extension will tell Emulab to add a firewall to the control network. You may supply optional rules in iptables syntax.

class Style[source]
BASIC = 'basic'
CLOSED = 'closed'
OPEN = 'open'
addRule(rule)[source]
class InstantiateOn(parent)[source]

Added to a node to specify that it a Xen VM should be bound to (instantiated on) another node in the topology. Argument is the node instance or the client id of another node in the topology.

exception InvalidParent(parent)[source]
class ProgramAgent(name, command, directory=None, onexpstart=False)[source]

Add an Emulab Program Agent, which can be controlled via the Emulab event system. Optional argument ‘directory’ specifies where to invoke the command from. Optional argument ‘onexpstart’ says to invoke the command when the experiment starts (time=0 in event speak). This is different than the Execute service, which runs every time the node boots.

A ShapedLink is a synonym for BridgedLink

class SubNodeOf(parent)[source]
exception InvalidParent(parent)[source]
class Switch(name, component_id=None)[source]
class connectSharedVlan(name)[source]

Added to a Link or LAN object, it connects the new vlan to a shared vlan created by another experiment.

class createSharedVlan(name)[source]

Added to a Link or LAN object, turns the new vlan into a shared vlan that can be shared between independent experiments.

class disableRootKeys[source]

Added to a request this extension will tell Emulab based aggregates to to not install private and/or public ssh keys for root.

class enableSharedVlan[source]

Added to a Link or LAN object, it connects the new vlan to a shared vlan created by another experiment.

class initVNC[source]

Added to a top-level Request object, this extension adds required initialization to run VNC consoles on your nodes.

class installDotFiles(tarfile)[source]

Added to a node this extension will tell Emulab based aggregates to download and unpack a tarfile of your .dot files in your home directory. Your .dot files (and directories if you like) should be at the top level of the tarfile so they can be unpacked directly into your home directory. The tarfile should be on a public web server.

DO NOT PUT SSH/SSL PRIVATE KEYS IN THE TARFILE!

More generally, you should not put a .ssh directory in the tarfile since that can interfere with account setup and make it impossible for you to log in at all.

INSTALL = '(cd /var/tmp &&         (test -e /var/tmp/install-dotfiles.sh ||          wget -O install-dotfiles.sh https://www.emulab.net/downloads/install-dotfiles.sh) &&         /bin/sh /var/tmp/install-dotfiles.sh)'
class installRootKeys(private=True, public=True)[source]

Added to a node this extension will tell Emulab based aggregates to to install private and/or public ssh keys for root so that root can ssh between nodes in your experiment without having to provide a password. By default both the private and public key are installed on each node. Use this extension to restrict where keys are installed in order to customize which nodes are trusted to initiate a root ssh to another node. For example:

# Install a private/public key on node1 node1.installRootKeys(True, True) # Install just the public key on node2 node2.installRootKeys(False, True)

class setCollocateFactor(mfactor)[source]

Added to a top-level Request object, this extension limits the number of VMs from one experiment that Emulab will collocate on each physical host.

class setDelayImage(urn)[source]

Added to a top-level Request object, this extension sets the disk image that will be used for all delay nodes configured for the experiment.

class setFailureAction(action)[source]

Added to a node this extension will tell Emulab based aggregates to ignore errors booting this node when starting an experiment. This allows the experiment to proceed so that the user has time to debug.

class setForceShaping[source]

Added to a Link or LAN object, this extension forces Emulab link shaping to be enabled, even if it is not strictly necessary. This allows the link properties to be changed dynamically via the Emulab event system.

class setJumboFrames[source]

Added to a Link or LAN object, this extension enables jumbo frames on the link (9000 byte MTU). Not all clusters support this option.

class setNoBandwidthShaping[source]

Added to a Link or LAN object, this extension forces Emulab link shaping to be disabled for bandwidth, even if it is necessary. This is ignored if the link must be shaped for other reason (delay, loss).

Added to a Link or LAN object, this extension forces the Emulab mapper to disallow mapping a link in the request topology to an inter-switch link. This allows users to require that specific nodes in their topology be attached to the same switch(es).

class setPackingStrategy(strategy)[source]

Added to a top-level Request object, this extension controls the strategy used for distributing VMs across physical hosts

class setProperties(bandwidth=None, latency=None, plr=None)[source]

Added to a Link or LAN object, this extension tells Emulab based clusters to set the symmetrical properties of the entire link/lan to the desired characteristics (bandwidth, latency, plr). This produces more efficient XML then setting a property on every source/destination pair, especially on a very large lan. Bandwidth is in Kbps, latency in milliseconds, plr a floating point number between 0 and 1. Use keyword based arguments, all arguments are optional:

link.setProperties(bandwidth=100000, latency=10, plr=0.5)

class setRoutingStyle(style)[source]

Added to a top-level Request object, this extension controls the routing that is automatically configured on the experiment (data-plane) side of the network.

class setUseTypeDefaultImage[source]

Added to a node that does not specify a disk image, this extension forces Emulab to use the hardware type default image instead of the standard geni default image. Useful with special hardware that should run a special image.

class skipVlans[source]

Added to a request this extension will tell Emulab based aggregates to to not setup or tear down vlans. You should not use this!

class startVNC(nostart=False)[source]

Added to a node this extension will tell Emulab based aggregates to install and start a VNC server.

STARTVNC = '(cd /var/tmp &&         (test -e /var/tmp/novnc-setup ||          git clone https://gitlab.flux.utah.edu/emulab/novnc-setup.git) &&         /bin/bash /var/tmp/novnc-setup/startvnc.sh)'
class wirelessSite(id, type, urn)[source]

A simple extension to mark a node as being part of a given wireless aggregate.