Home | About Gush | Using Gush | Gush Examples | Gush Tutorial at GEC 11 | GENI Summer Camp
Using Emulab Resources in Gush
This example illustrates how to add Emulab resources (in particular, nodes) into Gush. We assume that you are already familiar with the basic configurations of Emulab and Gush experiments. We also assume that the working directory of Gush is ~/gush.
Configuring Emulab for Gush
Set up an Emulab experiment as you normally would. Ensure that the experiment is swapped in because Gush does not do this automatically. This example uses two Emulab nodes. The NS file is as follows:
source tb_compat.tcl set ns [new Simulator] set devbox0 [$ns node] tb-set-hardware $devbox0 pc tb-set-node-os $devbox0 "PLAB-DEVBOX-v42" set devbox1 [$ns node] tb-set-hardware $devbox1 pc tb-set-node-os $devbox1 "PLAB-DEVBOX-v42" $ns run
Next we need to set up the SSL Certificate which enables Gush to authenticate with Emulab. In the Emulab web interface, go to "My Emulab". In the "Profile" section, click on "Generate SSL Cert". Supply the necessary information and download the SSL Certificate. Save the file as emulab.pem in the directory ~/gush/emulab/.ssl. Create one if the directory does not exist.
This SSL Certificate consists of two sections: the RSA private key and the certificate. The private key is encrypted with a pass phrase. We need to remove the pass phrase so that it may work correctly in Gush. Refer to this step-by-step guide on the removal of the PEM pass phrase.
Configuring Gush for Emulab
Add the following section to ~/gush/directory.xml:
<resource_manager type="emulab">
<user>yh1</user>
<port>15888</port>
<EmulabProjectID>Gush</EmulabProjectID>
<EmulabExperimentID>gush</EmulabExperimentID>
</resource_manager>
Running the experiment
Start Gush. If the above is configured correctly, Gush should say that it has learned about the Emulab resources. To verify that the Emulab nodes have indeed been added to the resource pool, do the following:
gush> info nodes There are 10 known nodes: [ P ] williams_gush@planetlab1.ucsd.edu:15001(pref=0) (Disconnected.) [ P ] williams_gush@planetlab5.williams.edu:15001(pref=0) (Disconnected.) [ U ] yh1@devbox0.gush.Gush.emulab.net:15888(pref=0) (Disconnected.) [ U ] yh1@devbox1.gush.Gush.emulab.net:15888(pref=0) (Disconnected.)
Try connecting to the Emulab nodes:
gush> connect pat emulab 2 Initiated connections to 2 of 2 hosts. gush> yh1@devbox1.gush.gush.emulab.net:15888 has joined the mesh. yh1@devbox0.gush.gush.emulab.net:15888 has joined the mesh.
And run a very simple experiment:
gush> shell 'hostname' gush> yh1@devbox0.gush.gush.emulab.net:15888,15413: devbox0.gush.gush.emulab.net yh1@devbox1.gush.gush.emulab.net:15888,15314: devbox1.gush.gush.emulab.net
