TopoMaker

From Grid5000
Jump to navigation Jump to search

TopoMaker is a totally new tool on Grid'5000 (software is still in beta testing for now), which allows to automate all steps of the "Topology setup" part (except the last paragraph about routing).

There is no documentations yet, but we will start from an example, to build the same topology as in the first paragraphs.

TopoMaker takes a Rspec XML file as input. That input is actually inspired by the syntax used in CloudLab (another experimental testbed). Here is the example we will use:

                                                                                                                                                               
<?xml version="1.0" encoding="UTF-8"?>                                                                                                                                                                          
<rspec>                                                                                                                                                                                                         
  <node client_id="node-2">                                                                                                                                                                                     
    <interface client_id="interface-0"/> <!--No IP precised equals to DHCP-->                                                                                                                                   
    <interface client_id="interface-1">                                                                                                                                                                         
      <ip address="192.168.1.3" type="ipv4" netmask="255.255.255.0" />                                                                                                                                          
    </interface>                                                                                                                                                                                                
    <sliver_type name="raw-pc">                                                                                                                                                                                 
      <disk_image name="jessie-x64-min" /> <!--This is just for the example because default OS chosen by topomaker is jessie-x64-min -->                                                                        
    </sliver_type>                                                                                                                                                                                              
    <auto_install>                                                                                                                                                                                              
      <apt name="tcpdump"/>                                                                                                                                                                                     
      <apt name="openvswitch-switch"/>                                                                                                                                                                          
    </auto_install>                                                                                                                                                                                             
  </node>                                                                                                                                                                                                       
  <node client_id="node-1">     <!--Here we will have DHCP on jessie x64 min-->                                                                                                                                 
    <interface client_id="interface-2"/>                                                                                                                                                                        
  </node>                                                                                                                                                                                                       
  <node client_id="node-3">     <!--node 3 is equivalent to our node_nancy here it will be on the same site, as we saw it doesn't matter with global vlan-->                                                    
    <interface client_id="interface-4">                                                                                                                                                                         
      <ip address="192.168.1.1" type="ipv4" netmask="255.255.255.0" />                                                                                                                                          
    </interface>                                                                                                                                                                                                
  </node>                                                                                                                                                                                                       
  <link client_id="link-0">     <!--link are equivalent to VLAN-->                                                                                                                                              
    <interface_ref client_id="interface-0" />                                                                                                                                                                   
    <interface_ref client_id="interface-2" />                                                                                                                                                                   
  </link>                                                                                                                                                                                                       
  <link client_id="link-1">                                                                                                                                                                                     
    <interface_ref client_id="interface-1" />                                                                                                                                                                   
    <interface_ref client_id="interface-4" />                                                                                                                                                                   
  </link>                                                                                                                                                                                                       
</rspec>                                                                                                                                                                                                        
                                    

As you can see, each part of this XML file is totally independent from the nodes you reserved. You can put the name of your choice for nodes and interfaces names. It just have to be relevant between names for interfaces and names for links.

TopoMaker isn't provided as a Grid'5000 tool yet, so we will download the source code and use it directly.

Terminal.png rennes:frontend:
cp ~agarnier/public/TopoMaker.zip ~/ && unzip ~/TopoMaker.zip && cd ~/TopoMaker

TopoMaker is developed in Ruby and requires some gems, which are not installed in the environement. We install them:

Terminal.png rennes:frontend:
gem install --user nokogiri

TopoMaker does not do the reservation for you. You should have a running job and provide its jobid.

The TopoMaker command line is as follows:

Terminal.png rennes:frontend:
ruby TopoMaker.rb -d -f sample_in/sample_tp.xml -j JOB_ID

You can add the "-v" option to show more information about the progress of the execution (the script might look like stuck sometime). In the end, a yaml file is prompted with all the required information, like IP or hostname.

TopoMaker doesn't know about DNS in kavlan-local (and IP are not retrieved), so the rules is the same as in the tutorial if you used DHCP: "hostname-kavlan-ID.rennes.grid5000.fr" from the gateway to connect to the node.

Once the script is done, you can do the same tests as above, and do the modification yourself to use openVSwitch with TopoMaker.

Warning.png Warning

If a node is in a VLAN and you want to run TopoMaker again, you have to keep the "-d" option