wiki:GENIEducation/HyperNets

Version 16 (modified by shuang@bbn.com, 11 years ago) (diff)

--

All About HyperNet Architecture

What I have achieved so far

  • 1. set up Network Hypervisor server on andor.gpolab.bbn.com
  • 2. run HyperNets and Hypervisor server on difference end system and let them communicate via XML-RPC
  • 3. add support for protoGENI, instaGENI and exoGENI in the HyperNet config file
    • 3.1 user can specify either the AM nickname as defined in omni_config (e.g., eg-gpo, ig-utah, pg-ky), or directly using protoGENI/instaGENI/exoGENI in the "am" field of the config file
    • 3.2 user can further issue whether he/she wants vm or pc from GENI by specifying "vm"/"pc" in the "nodeType" field of the config file
  • 4. users' credential will be copied to the hypervisor on registerHyperNet() API call (including ssl private key, will have to change this when "speaks-for" is available *)
  • 5. build a web page that shows Network Hypervisor server logs: http://andor.gpolab.bbn.com/log/log.html
  • 6. concurrent tests: Sarah and I tried to run the same HyperNet package at the same time, reserving resources from both exoGENI and instaGENI. Network Hypervisor is able to handle the XML-RPC calls simultaneously (one does not have to wait until the other finishes)
  • 7. An example HyperNet tutorial: http://groups.geni.net/geni/wiki/GENIEducation/SampleAssignments/HyperNetRingDemo

To use a HyperNet App

  • 1. What the user needs
    • 1.1 credentials: more precisely, the following files: omni_config, private/public key pairs for GENI (can get from GENI Portal, e.g., geni_key_portal and geni_key_portal.pub in your ~/.ssh/ directory), the ssl certificate for GENI (can get from GENI Portal, i.e., geni_cert_portal.pem in your ~/.ssl/ directory)
    • 1.2 JRE (Java Runtime Environment) - do not know the version requirement yet, assume the default version on your Windows/Ubuntu/Mac would work as long as your PC/Laptop is not 20 years old :-)
  • 2. How to get the files needed above?
    • 2.1 Option A. Get a GENI Portal account, log on your portal account, click "profile", then download public key and private key to ~/.ssh/ directory; SSL certificate to ~/.ssl/ directory, then download and customize a template omni config file and customize it.
    • 2.2 Option B. Get a GENI Portal Account, download a "omni-bundle" script from somewhere, and run it using the following command:
        omni-configure.py
      
  • 3. An example?

To Build a Network Hypervisor Server

For Ubuntu:

  • 1. install apache:
     sudo apt-get install apache2
    
  • 2. add a new user:
     sudo adduser hypernet (password is hypernet)
    
  • 3. install JDK:
     sudo apt-get install openjdk-7-jdk
    
  • 4. copy hypervisor source code as user "hypernet" in "hypernet's" home directory:
     su hypernet
     wget http://www.gpolab.bbn.com/experiment-support/HyperNet/Hypervisor.tar.gz
     tar xzvf Hypervisor.tar.gz
    
  • 5. set environment path: add the following line to ~/.bashrc (as user "hypernet")
     export CLASSPATH=.:~/PVNLibrary/*:$CLASSPATH
    
    then log out and log in again as user "hypernet" (you can do "echo $CLASSPATH" to confirm that the classpath is set properly)
  • 6. install omni following the tutorial here: http://trac.gpolab.bbn.com/gcf/wiki (remember to set the $PATH variable so that the system can call omni.py directory instead of having to use the full path)
  • 7. change corresponding fields in the hypervisor source code to point to the correct directory:
    • 7.1 in "PVNLib.java" change the following so that it points to the default GENI user (unlikely to be called, but just in case)
              //default user credentials
      	private final String defaultUserName = "shuang";                                                  //default hypervisor's username, needs to match with the default omni_config in your ~/.gcf/ directory
                         //on andor the above is shufeng
      	private final String defaultOmniConfigFile = "/Users/shuang/.gcf/omni_config";  //default location for hypervisor's omni_config file
                         //on andor, the above is /home/hypernet/.gcf/omni_config
      	private final String hypervisorRoot = "/Users/shuang/Sites/";                               //default web site location on hypervisor
                         //on andor, the above is /var/www/
      	private final String webRoot = "http://128.89.81.82/~shuang/";                          //default web url for hypervisor service
                         //on andor, the above is http://128.89.91.33/
      
    • 7.2 in "pvnlib/RspecBuilder.java", change the following to point to the correct resource folder:
      public final static String resourceFolder = "/Users/shuang/Sites/resources/";            //default folder to hold physical topology xml files
                       //on andor, the above is /var/www/resources/
      
    • 7.3 in "pvnlib/TopologyMgr/Graph.java", change the following to point to the right omni.py:
      private static String omni = "/Users/shuang/omni/gcf/src/omni.py";                         //path for omni.py
                       //on andor, the above is changed to /home/hypernet/omni/gcf/src/omni.py
      
    • 7.4 recompile the source code, in folder "RPCServer/", do "make clean", then do "make". you might need to install make first.
  • 8. copy "log.html" in RPCServer/ folder to your web directory. In our case, since the web directory is at "/var/www/", we first change the permission on that folder to allow user "hypernet" to write, then put log.html in "/var/www/log/" folder:
    sudo chmod -R 777 /var/www/
    mkdir /var/www/log/
    cp log.html /var/www/log/
    
  • 9. in folder RPCServer/, change runServer.sh accordingly. since the log file is in /var/www/log/ folder, you do not need to change runServer.sh
  • 10. You are all set. In folder RPCServer/, run the hypervisor service by running:
    ./runServer.sh
    
    And you will see the logs from the hypervisor Log page: http://128.89.91.33/log/log.html

HyperNet Config file

  • 1. default config file is myConfig.txt, in the same directory of your HyperNet appliance
  • 2. by default, it uses "~/.gcf/omni_config" as the omni configuration file (mainly to search for credential files. i.e., ssh keys, ssl certificates and keys)
  • 3. by default, it uses pg-utah as the aggregate manager, if users specify to use instaGENI, it uses ig-utah; if users specify to use exoGENI, it uses eg-gpo
  • 4. by default, it uses vm as the nodeType (i.e., emulab-openvz for protoGENI and instaGENI AMs, ox-small for exoGENI AMs); user can specify "pc" for protoGENI AMs; or "Xen" for instaGENI AMs; or "xo-medium"/"xo-large" for exoGENI AMs
  • 5. "HyperNetName" is the name of the HyperNet, we actually pre-pend the username before the HyperNetName to form the name for the slice in GENI. e.g., username is "shufeng", HyperNetName is "Ring", then slice name is "shufeng-Ring"
  • 6. server is the IP address of the Network Hypervisor service hosing node.
  • 7. an example HyperNet config file can be found here: http://www.gpolab.bbn.com/experiment-support/HyperNet/Examples/myConfig.txt

Network Hypervisor API calls

  • Config getConfig(String configFile): get configuration from configFile. e.g.,
     #import pvnlib.*
     ...
     Config myConfig = PVNLib.getConfig("myConfig.txt");
    
  • APIMessage registerPVN(Config myConfig): registers a HyperNet, with configuration specified in myConfig. e.g.,
     #import pvnlib.*
     ...
     private static boolean regPVN(Config myConfig) {
    	APIMessage retValue = myPVN.registerPVN(myConfig);
    	textArea.append(retValue.message + "\n");
    	return retValue.result;
     }