wiki:HowTo/ShareALan

Version 23 (modified by sedwards@bbn.com, 9 years ago) (diff)

--

How to Share a VLAN (and How to Unshare A VLAN)

The contents of this page are adapted from an e-mail from Leigh Stoller.

This page describes how to convert a LAN into a Shared LAN without operator intervention.

The general process to share a LAN is:

  1. Reserve resources which contain a LAN.
  2. Run perform operational action with the command geni_sharelan and setting the two options geni_sharelan_lanname and geni_sharelan_token. geni_sharelan_lanname is the client_id of the LAN reserved in the previous step. geni_sharelan_token is the name the new shared VLAN will be known by.
  3. Reserve resources connected to a LAN (probably in another slice). Configure the LAN to be a shared LAN whose name matches the value of geni_sharelan_token in the previous step.
  4. Resources should now be able to communicate with each other using the shared VLAN.

The general process to unshare a LAN is:

  1. Run perform operational action with the command geni_unsharelan and setting the two options geni_sharelan_lanname and geni_sharelan_token set as they were when you originally shared it.
  2. Resources should no longer be able to communicate with each other using the shared VLAN.

Caveats

  1. The LAN being shared must obviously be a real VLAN, not a trivial link (link between two VMs on the same physical host). In other words, the minimal case requires two VMs which each have a different component_id.
    • Stitched VLANs can be shared. Also VLAN that go through an OpenFlow hardware switch can also be shared.
  2. There is no change to idleness or expiration behavior; these resources must be renewed like other resources using the usual mechanisms.
  3. When the shared LAN is unshared, or the slice terminated, all of the other slices that were using that LAN will have the ports yanked out and disabled. However, the resources will remain.
  4. There is currently no way to determine which slice contains the LAN which is shared. You must keep track of this out-of-band.
  5. As of October 2014, this only works at InstaGENI rack and ProtoGENI Utah.

Example of sharing a VLAN

  1. A minimal RSpec to use for reserving resources is:
    <rspec type="request" 
    xsi:schemaLocation="http://www.geni.net/resources/rspec/3 http://www.geni.net/resources/rspec/3/request.xsd"
    xmlns:client="http://www.protogeni.net/resources/rspec/ext/client/1" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns="http://www.geni.net/resources/rspec/3">
      <node client_id="VM_pc423" component_manager_id="urn:publicid:IDN+emulab.net+authority+cm" component_id="urn:publicid:IDN+emulab.net+node+pc423" component_name="pc110" exclusive="false">
        <sliver_type name="emulab-xen"/>
        <interface client_id="VM:if0">
        </interface>
      </node>
      <node client_id="VM" component_manager_id="urn:publicid:IDN+emulab.net+authority+cm" exclusive="false">
        <sliver_type name="emulab-openvz"/>
        <interface client_id="VM-0:if0">
        </interface>
      </node>
      <link client_id="lan0">
        <component_manager name="urn:publicid:IDN+emulab.net+authority+cm"/>
        <interface_ref client_id="VM:if0"/>
        <interface_ref client_id="VM-0:if0"/>
        <property source_id="VM:if0" dest_id="VM-0:if0"/>
        <property source_id="VM-0:if0" dest_id="VM:if0"/>
        <link_type name="lan"/>
      </link>
    </rspec>
    

In the above, we have chosen a xen VM (bound to pc423) and a openVZ container to force the LAN to be non-trivial. The client_id of the LAN is lan0.

  1. Use omni to run performoperationalaction (a.k.a. poa) on your slice.

The general command is:

omni.py -V 3 -a pg-utah3 poa SLICE_NAME geni_sharelan --optionsfile lan_options.json

The contents of lan_options.json should be in the form:

{
 "geni_sharelan_lanname": "LAN_CLIENT_ID",
 "geni_sharelan_token": "STRING_IDENTIFYING_SHARED_LAN"
}

For example:

{
 "geni_sharelan_lanname": "lan0",
 "geni_sharelan_token": "janesSpecialLan"
}

Example output of running performoperationalaction:

$ omni.py -V 3 -a pg-utah3 poa sharedlan geni_sharelan --optionsfile lan_options.json 
13:44:25 INFO     omni: Loading agg_nick_cache file '/Users/sedwards/.gcf/agg_nick_cache'
13:44:25 INFO     omni: Loading config file /Users/sedwards/.gcf/omni_config
13:44:25 INFO     omni: Using control framework portal
13:44:25 INFO     omni: Substituting AM nickname pg-utah3 with URL https://www.emulab.net:12369/protogeni/xmlrpc/am/3.0, URN urn:publicid:IDN+emulab.net+authority+cm
13:44:26 INFO     omni: Slice urn:publicid:IDN+ch.geni.net:tutorial+slice+sharedlan expires on 2013-11-14 18:09:29 UTC
13:44:26 INFO     omni: PerformOperationalAction geni_sharelan on slivers in slice urn:publicid:IDN+ch.geni.net:tutorial+slice+sharedlan at https://www.emulab.net:12369/protogeni/xmlrpc/am/3.0
13:44:39 INFO     omni:  (PG log url - look here for details on any failures: https://www.emulab.net/spewlogfile.php3?logfile=7e38b4a9a56d13534834fdee4f64d3d0)
13:44:39 INFO     omni: PerformOperationalAction result for geni_sharelan on slivers in slice urn:publicid:IDN+ch.geni.net:tutorial+slice+sharedlan at AM URL https://www.emulab.net:12369/protogeni/xmlrpc/am/3.0
13:44:39 INFO     omni: 0
13:44:39 INFO     omni:  ------------------------------------------------------
13:44:39 INFO     omni:  Completed poa:
Args: poa sharedlan geni_sharelan

 Result Summary: Slice urn:publicid:IDN+ch.geni.net:tutorial+slice+sharedlan expires on 2013-11-14 18:09:29 UTC
PerformOperationalAction geni_sharelan on slivers in slice urn:publicid:IDN+ch.geni.net:tutorial+slice+sharedlan was successful.

13:44:39 INFO     omni:  ======================================================
  1. In a second slice, reserve resources containing a LAN and one or more compute nodes. Configure the LAN to be a Shared VLAN with name matching STRING_IDENTIFYING_SHARED_LAN (in this case janesSpecialLan). Also be sure to configure the IP addresses on these nodes in a way that makes sense with the IPs used in the first slice.
  2. Test your setup by running ping between compute nodes in the different slices. It should work.

Example of unsharing a VLAN

  1. 2. Use omni to run performoperationalaction (a.k.a. poa) on your slice.

The general command is:

omni.py -V 3 -a pg-utah3 poa SLICE_NAME geni_unsharelan --optionsfile lan_options.json

The contents of lan_options.json match what was used to share the LAN originally and should be in the form:

{
 "geni_sharelan_lanname": "LAN_CLIENT_ID",
 "geni_sharelan_token": "STRING_IDENTIFYING_SHARED_LAN"
}

For example:

{
 "geni_sharelan_lanname": "lan0",
 "geni_sharelan_token": "janesSpecialLan"
}

Example output of running performoperationalaction:

$ omni.py -V 3 -a pg-utah3 poa sharedlan geni_unsharelan --optionsfile lan_options.json  
14:36:29 INFO     omni: Loading agg_nick_cache file '/Users/sedwards/.gcf/agg_nick_cache'
14:36:29 INFO     omni: Loading config file /Users/sedwards/.gcf/omni_config
14:36:29 INFO     omni: Using control framework portal
14:36:29 INFO     omni: Substituting AM nickname pg-utah3 with URL https://www.emulab.net:12369/protogeni/xmlrpc/am/3.0, URN urn:publicid:IDN+emulab.net+authority+cm
14:36:30 INFO     omni: Slice urn:publicid:IDN+ch.geni.net:tutorial+slice+sharedlan expires on 2013-11-14 18:09:29 UTC
14:36:30 INFO     omni: PerformOperationalAction geni_unsharelan on slivers in slice urn:publicid:IDN+ch.geni.net:tutorial+slice+sharedlan at https://www.emulab.net:12369/protogeni/xmlrpc/am/3.0
14:36:47 INFO     omni:  (PG log url - look here for details on any failures: https://www.emulab.net/spewlogfile.php3?logfile=5d4e618722b51f582a1052255f01dc35)
14:36:47 INFO     omni: PerformOperationalAction result for geni_unsharelan on slivers in slice urn:publicid:IDN+ch.geni.net:tutorial+slice+sharedlan at AM URL https://www.emulab.net:12369/protogeni/xmlrpc/am/3.0
14:36:47 INFO     omni: 0
14:36:47 INFO     omni:  ------------------------------------------------------
14:36:47 INFO     omni:  Completed poa:
Args: poa sharedlan geni_unsharelan

 Result Summary: Slice urn:publicid:IDN+ch.geni.net:tutorial+slice+sharedlan expires on 2013-11-14 18:09:29 UTC
PerformOperationalAction geni_unsharelan on slivers in slice urn:publicid:IDN+ch.geni.net:tutorial+slice+sharedlan was successful.

14:36:47 INFO     omni:  ======================================================
  1. Test your setup by running ping between compute nodes in the different slices. It should NOT work.