Changes between Initial Version and Version 1 of OnTimeMeasureTutorial


Ignore:
Timestamp:
02/09/12 16:53:00 (12 years ago)
Author:
Prasad Calyam
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • OnTimeMeasureTutorial

    v1 v1  
     1= Tutorial on !OnTimeMeasure Capabilities for Experimenters =
     2'''Yingxiao Xu, Prasad Calyam'''[[BR]]
     3'''January 31, 2012'''
     4
     5''Software License:'' [http://www.geni.net/wp-content/uploads/2009/02/geniprojlic.pdf ''GENI Project License (GPL)'']
     6 
     7[[PageOutline]]
     8
     9This tutorial provides step-by-step instructions for GENI experimenters to learn about the main I&M capabilities of !OnTimeMeasure software/service that can be used in an integrated manner with  Flack/ProtoGENI, INSTOOLS, Gush, OMNI and !PlanetLab.
     10
     11The tutorial organization is shown in below Figure.
     12
     13[[Image(image0.png,50%)]]
     14
     15Section 1 describes the pre-work for the tutorial. In Section 2, we will create an experiment slice with slivers and will install !OnTimeMeasure in ProtoGENI/Emulab using the Flack tool. Next in Sections 3 and 4, we will configure, control and query the measurement results using !OnTimeMeasure command-line tools and web-portal, respectively. In Section 5, we will integrate a custom metric of an experiment into the !OnTimeMeasure framework. In Section 6, we will query measurement results so that they can be displayed within the INSTOOLS web-portal. In Section 7, we will use GUSH to create new a slice with nodes, and configure it to run measurements across the two slices. Finally in Section 8, we use the OMNI tool to add !PlanetLab nodes to the first slice.
     16
     17The general duration of the tutorial is expected to take about 1 hour.
     18
     19== 1. Pre-work ==
     20
     21=== 1.1 Get !OnTimeMeasure and Emulab User Accounts ===
     22Please register user accounts in the [http://ontime.oar.net OnTimeMeasure Researcher Web-portal] and [http://www.emulab.net Emulab Network Testbed]
     23
     24For more details regarding getting an Emulab User Account, please see - https://www.protogeni.net/trac/protogeni/wiki/Tutorial#GetanEmulabAccount
     25
     26=== 1.2 Upload Emulab SSH Keys ===
     27SSH login to {{{users.emulab.net}}} with your Emulab user account and password.  Check whether the files {{{id_rsa}}} and {{{id_rsa.pub}}} exist in your .ssh folder. 
     28If they do not exist, create a pair using {{{ssh-keygen}}} tool. You can download the files from users.emulab.net using SCP onto your PC.
     29
     30Next, upload your public key (id_rsa.pub)to Emulab. For this, first visit http://www.emulab.net/ and login, then click "Edit SSH Keys" link as shown in the following UI.
     31
     32[[Image(image1.1.png)]]
     33
     34You will get the following UI.
     35
     36[[Image(image1.2.png)]]
     37
     38Browse to your public key file, enter password of your Emulab user account.  Click the "Add New Keys" button to upload your public key.
     39
     40For more details on uploading SSH Keys in Emulab, please see - https://www.protogeni.net/trac/protogeni/wiki/Tutorial#UploadingSSHKeys
     41
     42=== 1.3 Generate SSL Certificate ===
     43
     44If you do not have an SSL certificate in Emulab, you can generate one by clicking "Generate SSL Cert" as shown in the UI below.
     45
     46[[Image(image1.3.png)]]
     47
     48You will get the following UI.
     49
     50[[Image(image1.4.png)]]
     51
     52The !PassPhrase[2] you set here will be used to login into Flack
     53
     54The Emulab Password[4] is the password associated with your Emulab user account.
     55
     56For more details on generating SSL certificates in Emulab, please see - http://www.protogeni.net/trac/protogeni/wiki/Tutorial#SSLCertificate
     57
     58== 2. Install !OnTimeMeasure with Flack ==
     59
     60=== 2.1 Login into Flack ===
     61
     62Visit - http://protogeni.net/flack
     63
     64[[Image(image2.1.png)]]
     65
     66Click "Log in" button. Click "Allow" if the following dialog appears.
     67
     68[[Image(image2.2.png)]]
     69
     70In the UI below, click "Select authority" and choose "emulab.net”
     71
     72[[Image(image2.3.jpg)]]
     73
     74Click "Download" button. Your credentials will be downloaded and displayed.
     75
     76If you get prompt for "You must be logged in on the authority's website", click "yes" to bring up a login page of www.emulab.net in a new tab, then login to the website with your Emulab password.
     77
     78Return back to Flack tab and press "Download" again. You credentials will be displayed. Enter the !PassPhrase you set earlier.
     79
     80[[Image(image2.4.jpg)]]
     81
     82Click "OK" button.  If the following dialog appears, click the "Allow" button.
     83
     84[[Image(image2.5.png)]]
     85
     86You will get the UI to create slice.
     87
     88[[Image(image2.6.jpg)]]
     89
     90=== 2.2 Create Slice using Flack ===
     91
     92Create new slice by entering an unique slice name  (i.e. "OTCDemo") to replace the text "Create slice..." in the text-box.
     93
     94Press enter/return to create the slice.
     95
     96[[Image(image2.7.png)]]
     97
     98A slice window will appear with the new slice name.
     99
     100[[Image(image2.8.jpg)]]
     101
     102=== 2.3 Create Sliver using Flack ===
     103
     104To create sliver, you can follow either "Create Sliver by Importing RSpec file" in Section 2.3.1 below or "Create Sliver from Scratch" in Section 2.3.2 below.
     105
     106==== 2.3.1 Create Sliver by Importing RSpec file ====
     107
     108To create sliver by importing RSpec file, download - http://ontime.oar.net/INSTALL/OTCDemo.rspec
     109
     110Save it to your local file system.
     111
     112Click import button, select  "import from file"
     113
     114[[Image(image2.9.png)]]
     115
     116Choose the file OTCDemo.rspec you downloaded.
     117
     118The following UI will appear.
     119
     120[[Image(image2.10.jpg)]]
     121
     122Click "Submit" button. Click "Yes" when the following dialog appears.
     123
     124[[Image(image2.11.jpg)]]
     125
     126You can skip the "2.3.2 Create Sliver from Scratch" if you use the above import steps, and jump to "2.4 Confirmation" section.
     127
     128==== 2.3.2 Create Sliver from Scratch ====
     129If you do not choose to use the import option, slivers can also be added to the slice by dragging from the aggregate where you want to create the sliver.
     130
     131[[Image(image2.12.jpg)]]
     132
     133NOTE1: To install !OnTimeMeasure, make sure you have at least three nodes in your slice.
     134
     135NOTE2: You can choose nodes in utahemulab.cm if you can't find the needed disk image in section 2.3.2.1 and 2.3.2.2
     136
     137===== 2.3.2.1 Set Root Beacon =====
     138
     139Choose one node as Root Beacon by clicking the "I" icon to edit the node.
     140
     141 [[Image(image2.13.png)]]
     142
     143A UI will appear to set the node. Set the name(i.e. "ROOT"). Choose "Update to FEDORA8-64-OVZ-STD " for Disk image
     144
     145  [[Image(image2.14.jpg)]]
     146
     147Click "Add Install Service" button.
     148
     149
     150In text field of {{{Install}}}, input
     151{{{
     152http://ontime.oar.net/INSTALL/OTCRootInstall.tgz
     153}}}
     154
     155In text field of {{{in}}},  input
     156
     157{{{
     158/tmp
     159}}}
     160
     161Click "Add Exceute Service" button,
     162
     163In text field of {{{Execute}}},  input 
     164{{{
     165      "sudo sh /tmp/ontime_software_install.sh otm_slice_password"
     166}}}
     167
     168(You can replace "otm_slice_password" with your own password.  It will be needed to use OnTimeMeasure later in this tutorial.)
     169 
     170[[Image(image2.15.jpg)]]
     171Click "Apply" button.
     172
     173
     174===== 2.3.2.2 Set Node Beacons =====
     175
     176Choose other nodes as Node Beacons.
     177
     178Click the "I" icon to edit each node.
     179
     180Each time a UI appear to set the node, set the name (i.e., "NODE1", you should choose different name for each node) and Choose "Ubuntu 10 32-bit" for Disk image
     181 
     182[[Image(image2.16.jpg)]]
     183
     184Click "Add Install Service" button.
     185
     186In text field of {{{Install}}},  input 
     187
     188{{{
     189   http://ontime.oar.net/INSTALL/OTCNodeInstall.tgz
     190}}}
     191
     192In text field of {{{in}}},  input 
     193
     194{{{
     195/tmp
     196
     197}}}
     198
     199Click "Add Exceute Service" button,
     200
     201In text field of {{{Execute}}},  input
     202{{{
     203    "sudo sh /tmp/ontime_software_install.sh"
     204}}}
     205 
     206[[Image(image2.17.jpg)]]
     207
     208Click "Apply" button.
     209
     210Repeat the above steps till all the nodes are configured.
     211
     212[[Image(image2.18.jpg)]]
     213
     214==== 2.3.2.3 Submit ====
     215
     216Click "Submit" button. Click "Yes" when the following dialog appears.
     217
     218[[Image(image2.19.jpg)]]
     219
     220=== 2.4 Confirmation ===
     221
     222!OnTimeMeasure will begin to install when nodes turn green. You will see the domain name of each nodes. You can use Ping or NSlookup tools in any machine to get IP address of each node.
     223
     224In this example, the ROOT (Root Beacon) is pc355.emulab.net (155.98.39.155), the NODE1 (Node Beacon 1) is pc337.emulab.net (155.98.39.137). The NODE2 is pc262.emulab.net (155.98.39.62)
     225
     226[[Image(image2.20.jpg)]]
     227
     228Please wait about 5 minutes for the installation of the Root Beacon. You can also jump to "Configure !OnTimeControl" section and confirm the Root Beacon installation later.
     229
     230Confirm the installation of Root Beacon (NOTE: use port number 17291 in the web-browser URL)
     231
     232[[Image(image2.21.jpg)]]
     233
     234Confirm the installation of Node Beacons (NOTE: use port number 17291 in the web-browser URL of each Node Beacon).
     235
     236[[Image(image2.22.jpg)]]
     237
     238== 3. Configure, Control, Query !OnTimeMeasure using Command-line  ==
     239
     240For overview and details of the !OnTimeControl tool of !OnTimeMeasure, please see - http://groups.geni.net/geni/wiki/OTM-Control
     241
     242=== 3.1 Config IP address and password ===
     243
     244Use SSH to Login to the Root Beacon.
     245
     246Enter !OnTimeControl folder by typing the following command
     247
     248{{{
     249cd /opt/OnTimeMeasure/OnTimeControl
     250cp config_example.yaml config.yaml
     251
     252}}}
     253
     254Change config.yaml with the IP addresses of your Root Beacon and Node Beacons.
     255
     256A sample configuration is:
     257
     258{{{
     259root_beacon: 155.98.39.155
     260db_user: collector
     261db_pwd: otm_slice_password
     262
     263nodes:
     264- name: node1
     265  IP: 155.98.39.137
     266
     267- name: node2
     268  IP: 155.98.39.62
     269
     270}}}
     271
     272
     273=== 3.2 Check Measurement Service Status ===
     274
     275Run command "service_status.py" to verify whether all the components of the measurement service are functioning correctly.
     276
     277{{{
     278python service_status.py
     279 
     280}}}
     281[[Image(image3.1.jpg)]]
     282
     283=== 3.3 Manage Measurement Tasks ===
     284
     285"task_manage.py" manages the measurement tasks (i.e., requests). Edit measurement.yaml to configure tasks.
     286
     287NOTE: You may need to modify the node names if you are not using node1, node2, etc. as node names)
     288
     289Run the "task_manage.py" with parameter "-c <measurement_config_file.yaml>".   
     290
     291{{{
     292python task_manage.py -c measurement.yaml
     293}}}
     294
     295[[Image(image3.2.png)]]
     296 
     297=== 3.4 Measurement Service Control ===
     298
     299"service_control.py" controls the measurement service. Each time you change the  measurement.yaml file, you need to restart the measurement service.
     300{{{
     301python service_control.py restart
     302}}}
     303[[Image(image3.3.png)]]
     304 
     305=== 3.5 Check Measurement Service Status ===
     306
     307{{{
     308python service_status.py
     309}}}
     310
     311[[Image(image3.4.jpg)]]
     312 
     313=== 3.6 Query Measurement Results ===
     314
     315You may need to wait a while for measurement data to start appearing in the Root Beacon database for query. The wait time depends on how you configure the measurement schedules in the measurement.yaml file.
     316
     317You can access Root Beacon through port 17280 in your web-browser (i.e., http://pc355.emulab.net:17280/) to check all the measurement data generated already. 
     318
     319To query using !OnTimeControl command-line tool, enter the following command (you may need to change the start-and-end dates in the query option).
     320
     321{{{
     322python query.py -f "2012-01-24 18:00:00" -t "2012-01-27 20:00:00" -s node2 -d node1 -m Throughput -r TimeSeries
     323
     324}}}
     325
     326Measurement results are automatically downloaded into your local folder.
     327
     328[[Image(image3.5.jpg)]]
     329
     330In this example, two file 20120126164952_IperfTcp_Throughput.txt and 20120126164952_IperfTcp_Throughput.png were created in "results" subfolder to display the result in text and graph plots. The result can also be accessed from browser with the URL listed in the output.
     331
     332 
     333== 4. Configure, Control, Query !OnTimeMeasure using Web-portal ==
     334
     335You can also use the  web-portal at http://ontime.oar.net to setup resources (i.e., provide RSpec information) and control Node/Root Beacons within slice in an interactive manner.
     336
     337For videos to navigate the Researcher Web-portal of !OnTimeMeasure, please see - http://ontime.oar.net/demo
     338
     339=== 4.1 Researcher Web-portal Login ===
     340
     341 [[Image(image058.jpg)]]
     342
     343 [[Image(image059.jpg)]]
     344
     345=== 4.2 Configuration ===
     346Click "Setup Resources" button. NOTE: The database password you need to enter is same as the otm_slice_password.
     347 
     348 [[Image(image060.jpg)]]
     349
     350Click the "Specify Request" button, you will be directed to a "Measurement Request Specification" page. The measurement tasks you set using !OnTimeControl before will be displayed here automatically. You can modify it if necessary.
     351
     352 [[Image(image061.jpg)]]
     353 
     354Click "Review Request" button, you will be directed to "Measurement Request Submission" page.
     355
     356  [[Image(image062.jpg)]]
     357
     358Click "Submit Request" button.
     359
     360
     361=== 4.3 Control ===
     362
     363Next, you will be directed to the "Service Control" page. If you have modified measurement tasks in previous page, you need to click "Stop" button to stop measurement collection in your slice. Next, click "Start" button to restart measurement collection in your slice.
     364 
     365 [[Image(image063.jpg)]]
     366
     367
     368=== 4.4 Query ===
     369Click the "Query Data" button. You can select query options.
     370
     371  [[Image(image064.jpg)]]
     372
     373Click the "Submit Query" button, you will see the query result.
     374 
     375 [[Image(image065.jpg)]]
     376
     377Click the "View Result" link, you will be prompt to download query result.
     378
     379 [[Image(image066.png)]]
     380
     381
     382== 5 Integrate Custom Metric of Experiment with !OnTimeMeasure ==
     383For overview and details of the custom metric integration feature of OnTimeMeasure, please see - http://groups.geni.net/geni/wiki/OTM-CustomMetric
     384
     385=== 5.1 Compose custom file for custom metric specifications and a parser file for the custom metric ===
     386
     387For demo, you can download a sample from http://ontime.oar.net/INSTALL/metric/CPU.tgz by typing the following command
     388{{{
     389wget http://ontime.oar.net/INSTALL/metric/CPU.tgz
     390tar xzf CPU.tgz
     391}}}
     392
     393You will get custom metric specification file CPUSpecs.yaml and parser file CPUParser.pm
     394
     395The sample CPUSpecs.yaml file:
     396{{{
     397
     398Metrics:
     399  Mycpu:
     400     description: CPU Load
     401     tool: Mycpuinfo
     402     metrictype: host
     403Tools:
     404  Mycpuinfo:
     405    command:  top -b -n 3 | grep Cpu
     406    runat: <SRC>
     407    dbtable:
     408          - field: [MycpuinfoDt,HostAddress,mycpu]
     409            type:  [timestamp, varchar(25), double]
     410    graphite:
     411         - send: [mycpu,HostAddress.mycpu]
     412    time: 10
     413    duration: 2
     414    conflict: []
     415
     416}}}
     417
     418=== 5.2 Add custom metric specifications file and parser file into !OnTimeMeasure framework ===
     419
     420Run command "add_metric.py" to add the custom metric specifications file and parser file into !OnTimeMeasure framework
     421{{{
     422 python add_metric.py  -c CPUSpecs.yaml -p CPUParser.pm
     423}}}
     424 
     425[[Image(image4.1.jpg)]]
     426
     427=== 5.3 Configure Tasks of Custom Metric Measurement ===
     428
     429Change the measurement.yaml file
     430{{{
     431- source: node1
     432  metric: [MemFree]
     433- source: node2
     434  metric: [MemFree]
     435}}}
     436
     437to
     438{{{
     439- source: node1
     440  metric: [MemFree,Mycpu]
     441- source: node2
     442  metric: [MemFree,Mycpu]
     443}}}
     444
     445NOTE: Mycpu is the metric name configured in CPUSpecs.yaml
     446
     4475.4 Manage Measurement Tasks with Custom Metric Measurement and Restart the Measurement
     448
     449Run command "task_manage.py" to manage the measurement tasks with custom metric (i.e., requests), which are configured in the measurement.yaml file.
     450
     451{{{
     452python task_manage.py -c measurement.yaml
     453python service_control.py restart
     454}}}
     455
     456== 6. View !OnTimeMeasure Measurement Results in INSTOOLS web-portal ==
     457
     458=== 6.1 Install INSTOOLS ===
     459
     460In Flack, click Plugins tab, you will get INSTOOLS UI as follows.
     461
     462Click "Instrumentize" button .
     463
     464
     465[[Image(image043.jpg,40%)]]
     466 
     467You will be prompted to visit the INSTOOLS portal.
     468
     469 
     470[[Image(image044.png)]]
     471
     472
     473Click "Yes"
     474
     475
     476[[Image(image045.jpg,40%)]]
     477 
     478
     479Click on the MC icon,and click "Main Page" button. You will be directed to the "Live View" page for the measurement controller of INSTOOLS.
     480
     481[[Image(image046.jpg)]]
     482 
     483
     484=== 6.2 Create Page to display measurement result of !OnTimeMeasure ===
     485
     486Click the Create Content/Page link. Enter the title and body.
     487
     488In the body, enter the following text (NOTE: You need to change the pc355.emulab.net to host name of your Root Beacon ):
     489
     490{{{
     491
     492<img src= "http://pc355.emulab.net:17280/render?height=300&width=500&&from=-3d&until=now&target=Graphite.node1_node2.RoundTripDelay&uniq='+new Date().getTime();" align ="middle" alt = "round-trip delay graph"/>
     493<!-- This is for link named node1_node2 in graphite and returns Round-trip Delay for last 3 days, for link node2 to node1, change "node1_node2" -->
     494
     495}}}
     496
     497[[Image(image047.jpg,50%)]]
     498
     499Click "Menu settings" button, enter Menu link title (e.g., Round-Trip Delay). Choose a Parent item (i.e., Graph under Node1)
     500
     501[[Image(image048.jpg,40%)]]
     502 
     503Scroll down the page, click "Input format" link, choose "Full HTML".
     504
     505 [[Image(image049.png,30%)]]
     506
     507Click the "Save" button.
     508
     509
     510=== 6.3 View Results ===
     511
     512You will get the measurement results by clicking the menu link title under the parent item you set.
     513
     514[[Image(image050.jpg)]]
     515
     516== 7. Install and Use !OnTimeMeasure with Gush  ==
     517
     518For overview and details of the Gush integration within !OnTimeMeasure, please see - http://groups.geni.net/geni/wiki/OTM-Gush
     519
     520
     521Till now, we have slice OTCDemo with Root Beacon (155.98.39.155), Node Beacon 1 (155.98.39.137) and Node Beacon 2 (155.98.39.62) created by Flack.
     522In this section, we will use Gush to create a new slice OTMGushDemo with Node Beacon 3 and will configure it to run measurements to Node Beacons 1 and 2 in the OTCDemo slice.
     523
     524=== 7.1 Install and Configure GUSH ===
     525
     526==== 7.1.1 Install Gush ====
     527For details on Gush installation procedure, see - http://gush.cs.williams.edu/trac/gush/wiki/UsingGush
     528
     529Follow the below steps to install Gush in Ubuntu 10.04 Desktop.
     530
     531{{{
     532
     533sudo  apt-get update
     534sudo apt-get install  -y  openssh-server subversion keychain g++-4.1 autoconf2.59 makedepend emacs23
     535sudo ln -s /usr/bin/g++-4.1 /usr/bin/g++
     536sudo apt-get install  -y  curl libcurl3 libcurl4-openssl-dev libboost-dev xutils-dev flex bison libreadline-dev
     537sudo apt-get install -y python-m2crypto python-dateutil python-pyopenssl libxmlsec1 xmlsec1 libxmlsec1-openssl libxmlsec1-dev
     538wget http://gush.cs.williams.edu/xmlrpc-c-1.16.34.tgz
     539tar xzf xmlrpc-c-1.16.34.tgz
     540cd xmlrpc-c-1.16.34
     541./configure
     542make
     543sudo make install
     544 
     545cd ..
     546wget  http://gush.cs.williams.edu/gush-bin-32bit.tgz
     547tar xzf gush-bin-32bit.tgz
     548
     549
     550}}}
     551
     552==== 7.1.2 Create Clear Text Certificate ====
     553
     554In .ssl folder, find your certificate with passphrase. i.e.,  file encrypted.pem
     555Generate clear text certificate i.e., file keyout.pem by invoking
     556
     557{{{
     558openssl rsa -in encrypted.pem -out keyout.pem
     559openssl x509 -in encrypted.pem >> keyout.pem
     560}}}
     561
     562You may be prompt to enter pass phrase you set in section 1.4
     563
     564The file keyout.pem will be used in the configuration of omni_config file
     565
     566==== 7.1.3 Configure Gush ====
     567
     568Modify  omni_config file below.
     569
     570A sample config file
     571
     572{{{
     573
     574[omni]
     575default_cf = pg
     576users = xyx
     577
     578[pg]
     579type=pg
     580ch = https://www.emulab.net:443/protogeni/xmlrpc/ch
     581sa = https://www.emulab.net:443/protogeni/xmlrpc/sa
     582cert = ~/.ssl/keyout.pem
     583key = ~/.ssl/keyout.pem
     584
     585
     586[xyx]
     587urn = urn:publicid:IDN+emulab.net+user+xyx
     588keys=~/.ssh/id_rsa.pub
     589
     590}}}
     591
     592copy it to .gcf folder.
     593
     594Modify gush.prefs as follows:
     595{{{
     596<preferences>
     597    <pref key="ClientPath">/opt/OnTimeMeasure/OnTimeControl/</pref>
     598    <pref key="ClientPrefix">./</pref>
     599    <pref key="UsePlanetLab">true</pref>
     600</preferences>
     601}}}
     602
     603=== 7.2 Create a RSpec File ===
     604
     605    A sample file OTMGushDemo.rspec is given below. You can use it directly.
     606
     607{{{
     608<?xml version="1.0" encoding="UTF-8"?>
     609<rspec type="request" xsi:schemaLocation="http://www.protogeni.net/resources/rspec/2
     610                                          http://www.protogeni.net/resources/rspec/2/request.xsd"
     611       xmlns:flack="http://www.protogeni.net/resources/rspec/ext/flack/1"
     612       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     613       xmlns="http://www.protogeni.net/resources/rspec/2">
     614 
     615  <node client_id="node3" component_manager_id="urn:publicid:IDN+emulab.net+authority+cm" exclusive="true">
     616    <sliver_type name="raw-pc">
     617    <disk_image name="urn:publicid:IDN+emulab.net+image+emulab-ops//UBUNTU10-STD" />
     618    </sliver_type>
     619    <services>
     620      <install url="http://ontime.oar.net/INSTALL/OTCNodeInstall.tgz" install_path="/tmp"/>
     621      <execute shell="sh" command="sudo sh /tmp/ontime_software_install.sh"/>
     622   </services>
     623  </node>
     624 
     625 
     626</rspec>
     627
     628}}}
     629
     630=== 7.3 Create Slice and Sliver ===
     631
     632In helper-scripts folder under Gush installation folder, invoke the following command to create a new slice and sliver
     633
     634{{{
     635./handle-geni.py -f pg -a https://www.emulab.net/protogeni/xmlrpc/am createslice OTMGushDemo
     636
     637./handle-geni.py -n -f pg -a https://www.emulab.net/protogeni/xmlrpc/am createsliver OTMGushDemo OTMGushDemo.rspec
     638
     639}}}
     640
     641The output
     642
     643{{{
     644root:~/gush2/helper-scripts> ./handle-geni.py -f pg -a https://www.emulab.net/protogeni/xmlrpc/am createslice OTMGushDemo
     645INFO:omni:Loading config file /users/xyx/.gcf/omni_config
     646INFO:omni:Using control framework pg
     647Enter PEM pass phrase:
     648Enter PEM pass phrase:
     649Enter PEM pass phrase:
     650Created slice with Name OTMGushDemo, URN urn:publicid:IDN+emulab.net+slice+OTMGushDemo
     651
     652pc230:~/gush2/helper-scripts> ./handle-geni.py -n -f pg -a https://www.emulab.net/protogeni/xmlrpc/am createsliver OTMGushDemo OTMGushDemo.rspec
     653INFO:omni:Loading config file /users/xyx/.gcf/omni_config
     654INFO:omni:Using control framework pg
     655Asked https://www.emulab.net/protogeni/xmlrpc/am to reserve resources. Result:
     656<?xml version="1.0" ?><rspec type="manifest" xmlns="http://www.protogeni.net/resources/rspec/2" xmlns:flack="http://www.protogeni.net/resources/rspec/ext/flack/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/manifest.xsd">
     657    <node client_id="node3" component_id="urn:publicid:IDN+emulab.net+node+pc513" component_manager_id="urn:publicid:IDN+emulab.net+authority+cm" exclusive="true" sliver_id="urn:publicid:IDN+emulab.net+sliver+72081">
     658        <sliver_type name="raw-pc">
     659          <disk_image name="urn:publicid:IDN+emulab.net+image+emulab-ops//UBUNTU10-STD"/>
     660        </sliver_type>
     661        <services>
     662            <install install_path="/tmp" url="http://ontime.oar.net/INSTALL/OTCNodeInstall.tgz"/>
     663            <execute command="sudo sh /tmp/ontime_software_install.sh" shell="sh"/>
     664         <login authentication="ssh-keys" hostname="pc513.emulab.net" port="22" username="xyx"/>    </services>
     665      <rs:vnode name="pc513" xmlns:rs="http://www.protogeni.net/resources/rspec/ext/emulab/1"/>    <host name="node3.OTMGushDemo.emulab-net.emulab.net"/>  </node>
     666
     667</rspec>
     668}}}
     669
     670From the output, you can get the hostname of new created node. Ping the node to get IP address
     671{{{
     672Node3: pc513.emulab.net(155.98.38.113)
     673}}}
     674
     675This would be used in Section 7.6 "Use Gush to Configure !OnTimeMeasure" below.
     676
     677
     678=== 7.4 Edit directory.xml file of Gush ===
     679
     680A sample directory.xml file is provided with Gush. 
     681
     682Modify your slice name appropriately in the directory.xml file.
     683
     684{{{
     685<?xml version="1.0" encoding="UTF-8"?>
     686<gush>
     687    <resource_manager type="geni-pg">
     688      <port_map slice="OTMGushDemo" port="61600"/>
     689    </resource_manager>
     690    <resource_manager type="geni-pg">
     691      <port_map slice="OTCDemo" port="61601"/>
     692    </resource_manager>
     693
     694</gush>
     695
     696}}}
     697
     698=== 7.5 Start Gush ===
     699In gush folder,  invoke the following command to start gush and show nodes information.
     700{{{
     701 ./gush -P 15888
     702 info nodes
     703}}}
     704
     705
     706The output
     707{{{
     708pc230:~/gush2> ./gush -P 15888
     709gush> Gush has learned about the slice OTMGushDemo.
     710Gush has learned about the slice OTCDemo.
     711Updated information on the slice OTMGushDemo is available.
     712Updated information on the slice OTCDemo is available.
     713
     714
     715gush> info nodes
     716There are 4 known nodes:
     717[ P         ] xyx@pc513.emulab.net:61600(pref=0) (Disconnected.)
     718[ P         ] xyx@pc355.emulab.net:61601(pref=0) (Disconnected.)
     719[ P         ] xyx@pc337.emulab.net:61601(pref=0) (Disconnected.)
     720[ P         ] xyx@pc262.emulab.net:61601(pref=0) (Disconnected.)
     721
     722}}}
     723
     724
     725=== 7.6 Use Gush to Configure !OnTimeMeasure ===
     726
     727In section 2.4, we got
     728{{{
     729  Root Beacon   - pc355.emulab.net (155.98.39.155)
     730  Node Beacon 1 - pc337.emulab.net (155.98.39.137)
     731  Node Beacon 2 - pc262.emulab.net (155.98.39.62)
     732}}}
     733
     734In section 7.3, we got
     735{{{
     736  Node Beacon 3 - pc513.emulab.net(155.98.38.113)
     737}}}
     738
     739Now we will configure the Node Beacon 3 (155.98.38.113) to run measurements with other Node Beacons 1 and 2 in the in the OTCDemo slice.
     740
     741Invoke the following Gush command to configure !OnTimeMeasure.
     742
     743(You need to change the IP address according to your related slice configuration in the following command)
     744
     745{{{
     746connect connect pc355.emulab.net:61601
     747shell "cp config_example.yaml config.yaml"
     748shell "sed -i 's/192.168.1.1/155.98.39.155/g'   config.yaml"
     749shell "sed -i 's/db_pwd: collector/db_pwd: authenpasswd/g'  config.yaml"
     750shell "sed -i 's/IP: 192.168.1.2/IP: 155.98.39.137/g'   config.yaml"
     751shell "sed -i 's/IP: 192.168.1.3/IP: 155.98.39.62\n\n- name: node3\n  IP: 155.98.38.113\n\n/g'   config.yaml"
     752shell "python task_manage.py -c measurement.yaml"
     753
     754}}}
     755
     756NOTE: 192.168.1.1, 192.168.1.2 and 192.168.1.3 are pre-defined IP address in config_example.yaml
     757
     758The output:
     759{{{
     760
     761gush> connect pc355.emulab.net:61601
     762Connecting to host xyx@pc355.emulab.net:61601.
     763gush> xyx@root.otcdemo.emulab-net.emulab.net:61601 has joined the mesh.
     764
     765gush> shell "cp config_example.yaml config.yaml"
     766gush> shell "sed -i 's/192.168.1.1/155.98.39.155/g'   config.yaml"
     767gush> shell "sed -i 's/db_pwd: collector/db_pwd: authenpasswd/g'  config.yaml"
     768gush> shell "sed -i 's/IP: 192.168.1.2/IP: 155.98.39.137/g'   config.yaml"
     769gush> shell "sed -i 's/IP: 192.168.1.3/IP: 155.98.39.62\n\n- name: node3\n  IP: 155.98.38.113\n\n/g'   config.yaml"
     770gush> shell "python task_manage.py -c measurement.yaml"
     771gush> xyx@root.otcdemo.emulab-net.emulab.net:61601,31357: configuring http://155.98.39.137:17248 OK
     772configuring http://155.98.39.62:17248 OK
     773configuring http://155.98.38.113:17248 OK
     774Configuration finished
     775All old tasks cleared
     776node1
     777node2
     778node2
     779node1
     780node1
     781node1
     782node2
     783node2
     78410 new tasks added
     785You have to restart the measurement service to put them into effort
     786
     787}}}
     788
     789=== 7.7 Use Gush to Control and Query !OnTimeMeasure ===
     790
     791Invoke the following Gush command:
     792{{{
     793shell "python service_control.py restart"
     794shell "python service_status.py"
     795shell "python query.py -f '2012-01-30 18:00:00' -t '2012-01-31 20:00:00' -s node2 -d node1 -m RoundTripTime -r TimeSeries"
     796
     797}}}
     798
     799You may change the query start-and-end times to obtain results.
     800
     801The output:
     802{{{
     803gush> shell "python service_control.py restart"
     804gush> xyx@root.otcdemo.emulab-net.emulab.net:61601,31379: stopped
     805running
     806
     807
     808gush> shell "python service_status.py"
     809gush> xyx@root.otcdemo.emulab-net.emulab.net:61601,31398: {'root_scheduler': 'OK', 'graphite': 'OK', 'file_server': 'OK', 'collector': 'OK'}
     810
     811
     812gush> shell "python query.py -f '2012-01-30 18:00:00' -t '2012-02-09 20:00:00' -s node2 -d node1 -m Throughput -r TimeSeries"
     813
     814
     815gush> xyx@root.otcdemo.emulab-net.emulab.net:61601,23395: http://155.98.38.103:17290/20120131173719_IperfTcp_Throughput.txt
     816Downloaded to local folder: /opt/OnTimeMeasure/OnTimeControl/results/20120131173719_IperfTcp_Throughput.txt
     817
     818http://155.98.38.103:17280/render?height=300&width=500&from=18%3A00%2001/30/2012&until=20%3A00%2001/31/2012&target=Graphite.node2_node1.Throughput
     819Downloaded to local folder: /opt/OnTimeMeasure/OnTimeControl/results/20120131173719_IperfTcp_Throughput.png
     820
     821
     822}}}
     823
     824
     825You can access the query result in a web-browser or on the local file system of the Root Beacon.
     826
     827
     828=== 7.8 Further Operation ===
     829
     830You can further follow the instructions in Sections 3-to-6 above to see measurement results for the newly added Node Beacon 3.
     831NOTE: For Section 6 part, you need to manually install INSTOOLS as described at - http://groups.geni.net/geni/wiki/InstrumentationTools
     832
     833== 8. Use of OMNI to add !PlanetLab Nodes for !OnTimeMeasure slice measurements ==
     834
     835=== 8.1 Install OMNI ===
     836For details on OMNI installation procedure, see -  http://trac.gpolab.bbn.com/gcf/wiki/QuickStart
     837
     838For details on how to use OMNI , see -   http://groups.geni.net/geni/wiki/HowToUseOmni
     839
     840Follow the instruction in http://groups.geni.net/geni/wiki/HowToUseOmni to install and configure OMNI
     841
     842Follow the below steps to install OMNI in Ubuntu Desktop.
     843{{{
     844sudo apt-get install python-m2crypto python-dateutil \
     845                     python-pyopenssl libxmlsec1 xmlsec1 \
     846                     libxmlsec1-openssl libxmlsec1-dev  python-lxml
     847
     848}}}
     849
     850You can modify the default omni_config file with the same information of omni_config file used in Section 7.1.3 "Configure Gush" above.
     851
     852
     853=== 8.2 Create a RSpec File ===
     854
     855Use the following RSpec file to create a node in !PlanetLab.
     856
     857File OTMOmniDemo.rspec
     858
     859{{{
     860
     861<?xml version="1.0" ?>
     862<!-- Resources at AM:
     863        URN: unspecified_AM_URN
     864        URL: http://www.planet-lab.org:12346
     865 -->
     866<rspec type="request"
     867       xmlns="http://www.protogeni.net/resources/rspec/2"
     868       xmlns:emulab="http://www.protogeni.net/resources/rspec/ext/emulab/1"
     869       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     870       xsi:schemaLocation="http://www.protogeni.net/resources/rspec/2
     871       http://www.protogeni.net/resources/rspec/2/request.xsd
     872       http://www.protogeni.net/resources/rspec/ext/emulab/1
     873       http://www.protogeni.net/resources/rspec/ext/emulab/1/ptop_extension.xsd">
     874  <node
     875       component_id="urn:publicid:IDN+plc:williams+node+planetlab3.williams.edu"
     876    component_manager_id="urn:publicid:IDN+plc+authority+am"
     877    component_name="planetlab3.williams.edu" exclusive="false"
     878    client_id="williamspl3">
     879      <hardware_type name="plab-pc"/>
     880      <hardware_type name="pc"/>
     881      <location country="us" latitude="43.0844" longitude="-77.6799"/>
     882      <sliver_type name="plab-vnode" />
     883  </node>
     884
     885</rspec>
     886
     887}}}
     888
     889
     890=== 8.3 Create !PlanetLab Sliver ===
     891Invoke the following command to create !PlanetLab sliver in existing slice.
     892{{{
     893src/omni.py --api-version 2  -a http://www.planet-lab.org:12346 -o createsliver OTCDemo  OTMOmniDemo.rspec
     894}}}
     895
     896The output:
     897
     898{{{
     899pc230:~/omni/gcf-1.5.1> src/omni.py --api-version 2 -a http://www.planet-lab.org:12346 -o createsliver OTCDemo OTMOmniDemo.rspec
     900INFO:omni:Loading config file /users/xyx/.gcf/omni_config
     901INFO:omni:Using control framework pg
     902INFO:omni:Slice urn:publicid:IDN+emulab.net+slice+OTCDemo expires within 1 day on 2012-02-08 05:06:13 UTC
     903INFO:omni:Creating sliver(s) from rspec file OTMOmniDemo.rspec for slice urn:publicid:IDN+emulab.net+slice+OTCDemo
     904INFO:omni:Writing result of createsliver for slice: OTCDemo at AM: http://www.planet-lab.org:12346 to file OTCDemo-manifest-rspec-www-planet-lab-org.xml
     905INFO:omni:Writing to 'OTCDemo-manifest-rspec-www-planet-lab-org.xml'
     906INFO:omni: ------------------------------------------------------------
     907INFO:omni: Completed createsliver:
     908
     909  Options as run:
     910                aggregate: http://www.planet-lab.org:12346
     911                api_version: 2
     912                framework: pg
     913                native: True
     914                output: True
     915
     916  Args: createsliver OTCDemo OTMOmniDemo.rspec
     917
     918  Result Summary: Slice urn:publicid:IDN+emulab.net+slice+OTCDemo expires within 1 day(s) on 2012-02-08 05:06:13 UTC
     919Reserved resources on http://www.planet-lab.org:12346.
     920   Saved createsliver results to OTCDemo-manifest-rspec-www-planet-lab-org.xml.
     921INFO:omni: ============================================================
     922
     923}}}
     924
     925=== 8.4 Get Node Information ===
     926
     927Invoke the following command to check the sliver status
     928{{{
     929 src/omni.py --api-version 2 -a http://www.planet-lab.org:12346 -o sliverstatus OTCDemo
     930}}}
     931
     932The output:
     933{{{
     934root:~/omni/gcf-1.5.1> src/omni.py --api-version 2 -a http://www.planet-lab.org:12346 -o sliverstatus OTCDemo
     935INFO:omni:Loading config file /users/xyx/.gcf/omni_config
     936INFO:omni:Using control framework pg
     937INFO:omni:Slice urn:publicid:IDN+emulab.net+slice+OTCDemo expires within 1 day on 2012-02-08 05:06:13 UTC
     938INFO:omni:Status of Slice urn:publicid:IDN+emulab.net+slice+OTCDemo:
     939INFO:omni:Writing to 'OTCDemo-sliverstatus-www-planet-lab-org.json'
     940INFO:omni:Sliver status for Slice urn:publicid:IDN+emulab.net+slice+OTCDemo at AM URL http://www.planet-lab.org:12346
     941INFO:omni: ------------------------------------------------------------
     942INFO:omni: Completed sliverstatus:
     943
     944  Options as run:
     945                aggregate: http://www.planet-lab.org:12346
     946                api_version: 2
     947                framework: pg
     948                native: True
     949                output: True
     950
     951  Args: sliverstatus OTCDemo
     952
     953  Result Summary: Slice urn:publicid:IDN+emulab.net+slice+OTCDemo expires within 1 day(s) on 2012-02-08 05:06:13 UTC
     954Saved sliverstatus on OTCDemo at AM http://www.planet-lab.org:12346 to file OTCDemo-sliverstatus-www-planet-lab-org.json.
     955Returned status of slivers on 1 of 1 possible aggregates.
     956INFO:omni: ============================================================
     957
     958}}}
     959
     960Check the output file OTCDemo-sliverstatus-www-planet-lab-org.json
     961{{{
     962
     963{'geni_resources': [{'geni_error': '',
     964                     'geni_status': 'ready',
     965                     'geni_urn': 'urn:publicid:IDN+emulab.net+OTCDemo:23388:1086
     9660:0',
     967                     'pl_boot_state': 'boot',
     968                     'pl_hostname': 'planetlab3.williams.edu',
     969                     'pl_last_contact': '2012-02-07T18:06:22Z'}],
     970 'geni_status': 'ready',
     971 'geni_urn': 'urn:publicid:IDN+emulab.net+OTCDemo',
     972 'pl_expires': '2012-02-20T12:38:46Z',
     973 'pl_login': 'emulabnet_OTCDemo'}
     974
     975}}}
     976
     977In the file above, you can see whether your !PlanetLab node reservation was successful, and also see the login name and host name of the reserved node (emulabnet_OTCDemo and planetlab3.williams.edu, in this case).
     978
     979=== 8.5 Install !NodeBeacon ===
     980
     981Login into the reserved node by typing the following command(Planetlab may need 30 minutes make the sliver ready before you login into the node).
     982{{{
     983ssh emulabnet_OTCDemo@planetlab3.williams.edu
     984}}}
     985
     986NOTE: You need to modify login name and host name according to information you got in section 8.4)
     987
     988Invoke the following command to install the node beacon.
     989{{{
     990wget http://ontime.oar.net/download/OnTimeMeasure_latest.php
     991tar xzf *.gz
     992tar xzf NodeBeacon.tar.gz
     993cd NodeBeacon/InstallScript
     994./ontime_software_install.sh
     995}}}
     996
     997=== 8.6 Further Operation ===
     998You can further follow the instructions in Sections 3-to-7 above to see measurement results for the newly added !PlanetLab node.
     999NOTE: For Section 6 part, you need to manually install INSTOOLS as described at - http://groups.geni.net/geni/wiki/InstrumentationTools
     1000
     1001