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]
bandwidth
latency
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 Switch(name, component_id=None)[source]
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 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 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 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!