Skip to content. | Skip to navigation

Personal tools

Navigation

You are here: Home / Wiki / Rspecexamples2

Rspecexamples2

RSpec Examples

RSpec Examples

Below are examples of what version 2 RSpecs will look like. We divide the examples up by whether they are advertisements, requests, or manifests.


Advertisement Examples


Request Examples

Unbound Request

<?xml version="1.0" encoding="UTF-8"?>
<rspec xmlns="http://www.protogeni.net/resources/rspec/2"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.protogeni.net/resources/rspec/2 http://www.protogeni.net/resources/rspec/2/request.xsd"
       type="request" >
  <node client_id="my-node"
        exclusive="true">
    <sliver_type name="raw-pc" />
  </node>
</rspec>

Bound Request

<?xml version="1.0" encoding="UTF-8"?>
<rspec xmlns="http://www.protogeni.net/resources/rspec/2"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.protogeni.net/resources/rspec/2 http://www.protogeni.net/resources/rspec/2/request.xsd"
       type="request">
  <node component_id="urn:publicid:IDN+emulab.net+node+pc175"
        component_manager_id="urn:publicid:IDN+emulab.net+authority+cm"
        client_id="pc175"
        exclusive="true">
    <sliver_type name="raw-pc" />
  </node>
</rspec>

Link Request

<?xml version="1.0" encoding="UTF-8"?>
<rspec xmlns="http://www.protogeni.net/resources/rspec/2"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.protogeni.net/resources/rspec/2 http://www.protogeni.net/resources/rspec/2/request.xsd"
       type="request" >
  <node client_id="left"
        exclusive="true">
    <sliver_type name="raw-pc" />
    <interface client_id="left:if0" />
  </node>
  <node client_id="right"
        exclusive="true">
    <sliver_type name="raw-pc" />
    <interface client_id="right:if0" />
  </node>
  <link client_id="center">
    <interface_ref client_id="left:if0" />
    <interface_ref client_id="right:if0" />
  </link>
</rspec>

Tunnel Request

Note that this tunnel uses a simple extension to specify the IP addresses inside the tunnel at either end.

<?xml version="1.0" encoding="UTF-8"?>
<rspec xmlns="http://www.protogeni.net/resources/rspec/2"
       xmlns:tun="http://www.protogeni.net/resources/rspec/ext/gre-tunnel/1"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.protogeni.net/resources/rspec/2
                           http://www.protogeni.net/resources/rspec/2/request.xsd
                           http://www.protogeni.net/resources/rspec/ext/gre-tunnel/1
                           http://www.protogeni.net/resources/rspec/ext/gre-tunnel/1/request.xsd"
       type="request" >
  <node client_id="node-0"
        component_manager_id="urn:publicid:IDN+emulab.net+authority+cm"
        exclusive="true">
    <sliver_type name="raw-pc" />
    <interface client_id="node-0:if0">
      <tun:interface_ip address="192.168.0.1" netmask="255.255.255.0" />
    </interface>
  </node>
  <node client_id="node-1"
        component_manager_id="urn:publicid:IDN+uky.emulab.net+authority+cm"
        exclusive="true">
    <sliver_type name="raw-pc" />
    <interface client_id="node-1:if0">
      <tun:interface_ip address="192.168.0.2" netmask="255.255.255.0" />
    </interface>
  </node>
  <link client_id="link">
    <link_type name="gre-tunnel" />
    <interface_ref client_id="node-0:if0" />
    <interface_ref client_id="node-1:if0" />
  </link>
</rspec>

Manifest Examples

<?xml version="1.0" encoding="UTF-8"?>
<rspec xmlns="http://www.protogeni.net/resources/rspec/2"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.protogeni.net/resources/rspec/2 http://www.protogeni.net/resources/rspec/2/request.xsd"
       type="request" >
<!-- Manifests have completely specified component_ids to let you know which
     component you actually got -->
<!-- Each individual node has its own sliver_id which allows you to restart
     or lookup each one individually using the xmlrpc interface -->
  <node client_id="left"
        exclusive="true"
        component_id="urn:publicid:IDN+emulab.net+node+pc17"
        sliver_id="urn:publicid:IDN+emulab.net+sliver+8673">
<!-- The services tell you what the component manager has set up for you.
     Here, the CM has set up an ssh server using the keys you passed into
     RedeemTicket or CreateSliver using a particular hostname and port -->
    <services>
      <login authentication="ssh-keys" hostname="pc17.emulab.net" port="22" />
    </services>
    <sliver_type name="raw-pc">
<!-- We are currently implementing disk image selection and notification.
     The CM will give you details about what image was loaded on the node -->
      <disk_image
           name="urn:publicid:IDN+emulab.net+image+emulab-ops/FBSD61-STD"
           os="FBSD" version="6.1"
           description="Standard freebsd 6.1 image" />
    </sliver_type>
<!-- The CM binds every interface as well as giving the MAC address of
     that interface -->
    <interface client_id="left:if0"
               component_id="urn:publicid:IDN+emulab.net+interface+pc17:eth1"
               mac_address="13:11:22:33:44:55" />
  </node>
  <node client_id="right"
        exclusive="true"
        component_id="urn:publicid:IDN+emulab.net+node+pc18"
        sliver_id="urn:publicid:IDN+emulab.net+sliver+8674">
    <services>
      <login authentication="ssh-keys" hostname="pc18.emulab.net" port="22" />
    </services>
    <sliver_type name="raw-pc">
      <disk_image
           name="urn:publicid:IDN+emulab.net+image+emulab-ops/FBSD61-STD"
           os="FBSD" version="6.1"
           description="Standard freebsd 6.1 image" />
    </sliver_type>
    <interface client_id="right:if0"
               component_id="urn:publicid:IDN+emulab.net+interface+pc18:eth2"
               mac_address="00:11:22:33:44:55"  />
  </node>
<!-- Links also get sliver_ids -->
  <link client_id="center" sliver_id="urn:publicid:IDN+emulab.net+sliver+8675">
    <interface_ref client_id="left:if0" />
    <interface_ref client_id="right:if0" />
<!-- Link properties are specified so you know what network characteristics
     to expect. Of course, this only applies to dedicated links -->
    <property source_id="left:if0" dest_id="right:if0" capacity="100000"
              latency="1" packet_loss="0.0" />
    <property source_id="right:if0" dest_id="left:if0" capacity="100000"
              latency="1" packet_loss="0.0" />
  </link>
</rspec>