Changes between Initial Version and Version 1 of GENIEducation/SampleAssignments/UnderstandAMAPI/Procedure/DesignSetupXen


Ignore:
Timestamp:
08/16/13 09:04:59 (11 years ago)
Author:
sedwards@bbn.com
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GENIEducation/SampleAssignments/UnderstandAMAPI/Procedure/DesignSetupXen

    v1 v1  
     1= [http://groups.geni.net/geni/wiki/GENIEducation/SampleAssignments/UnderstandAMAPI/Procedure Understanding the AM API] =
     2{{{
     3#!html
     4
     5
     6<div style="text-align:center; width:495px; margin-left:auto; margin-right:auto;">
     7<img id="Image-Maps_5201305222028436" src="http://groups.geni.net/geni/attachment/wiki/GENIExperimenter/Tutorials/Graphics/Setup.jpg?format=raw" usemap="#Image-Maps_5201305222028436" border="0" width="495" height="138" alt="" />
     8<map id="_Image-Maps_5201305222028436" name="Image-Maps_5201305222028436">
     9<area shape="rect" coords="18,18,135,110" href="./DesignSetup" alt="" title=""    />
     10<area shape="rect" coords="180,18,297,111" href="./Execute" alt="" title=""    />
     11<area shape="rect" coords="344,17,460,110" href="./Finish" alt="" title=""    />
     12<area shape="rect" coords="493,136,495,138" href="http://www.image-maps.com/index.php?aff=mapped_users_5201305222028436" alt="Image Map" title="Image Map" />
     13</map>
     14<!-- Image map text links - End - -->
     15
     16</div>
     17}}}
     18
     19
     20
     21== 1.  Design the Experiment ==
     22 
     23{{{
     24#!html
     25<table border="0">
     26   <tr>
     27     <td >
     28        <ol><li>In today's experiment you will use resources at the aggregate listed on the worksheet.</li>
     29        </ol>
     30     </td>
     31   </tr>
     32</table>
     33}}}
     34
     35== 2.  Establish the Environment ==
     36
     37
     38
     39=== 2.1  Pre-work: Create a GENI account ===
     40{{{
     41#!html
     42<table border="0">
     43   
     44      <tr>
     45
     46       <td >
     47         <ol>
     48            <li> Go to <a href="https://portal.geni.net"> https://portal.geni.net </a> and press the <b> Use GENI </b> button</li>
     49            <li> From the Drop Down menu select your institution. If you got an account through the GENI Identity Provider, please select <b>GENI Project Office</b>.
     50                  <br/>
     51
     52<table id="Table_03" border="0" cellpadding="5" cellspacing="0">
     53        <tr>
     54                <td>
     55                        <img src="http://groups.geni.net/geni/attachment/wiki/GENIExperimenter/Tutorials/Graphics/Symbols-Tips-icon.png?format=raw" width="50" height="50" alt="Tip">
     56               </td>
     57               <td>
     58                    Start typing the name of your institution and see the list become smaller.
     59        </tr>
     60</table>
     61            </li>
     62            <li> You will be transferred to the Login Page of your institution. Fill in your username and password. </li>
     63            <li> <FONT COLOR="black">Complete the form that appears after you have successfully logged in and press <b>Continue</b>.</font></li>
     64            <li> <FONT COLOR="black">You will be transferred to an <b>Activation Page</b>. Make sure both checkboxes are checked and then press <b>Activate</b></font>. </li>
     65          </ol>
     66       </td>
     67         <td>
     68
     69        <a href="https://portal.geni.net">
     70        <!--img border="0" src="http://groups.geni.net/geni/attachment/wiki/GENIExperimenter/Tutorials/PortalSimpleLayer2Example/Graphics/login.png?format=raw" alt="Login to GENI"  height="120" title="Use GENI" />  </a>
     71
     72        <br/--><img border="0" src="http://groups.geni.net/geni/attachment/wiki/GENIExperimenter/Tutorials/PortalSimpleLayer2Example/Graphics/portal_login.png?format=raw" alt="Use GENI"  height="200" title="Login to GENI" /> </a>
     73<br />
     74         <b>Figure 2-1</b> <i>Logging into the GENI Experimenter Portal.</i>
     75       </td>
     76    </tr>
     77 </table>
     78}}}
     79
     80Congratulations, you have successfully created a GENI account.
     81
     82
     83=== 2.2 Pre-work: Project lead adds you to a project ===
     84In order to use the portal to reserve resources, you must join a project.  We have created a project for this tutorial. 
     85
     86{{{
     87#!html
     88<table border="0">
     89   
     90      <tr>
     91       <td >
     92         <ol>
     93            <li> The tutorial organizers should have added you to the project for this tutorial.  On the home page, you should see that you are a member of at least one project. 
     94<table id="Table_03" border="0" cellpadding="5" cellspacing="0">
     95        <tr>
     96                <td>
     97                        <img src="http://groups.geni.net/geni/attachment/wiki/GENIExperimenter/Tutorials/Graphics/Symbols-Tips-icon.png?format=raw" width="50" height="50" alt="Tip">
     98               </td>
     99               <td>
     100                    If you are not doing this exercise as part of an in-person tutorial please sign up for a <a target="_blank" href="http://groups.geni.net/geni/wiki/SignMeUpPortal">GENI account</a> and join a project.
     101               </td>
     102        </tr>
     103</table>
     104
     105
     106</li>
     107          </ol>
     108       </td>
     109       
     110    </tr>
     111 </table>
     112}}}
     113
     114=== 2.3 Pre-work: Generate and Download SSH Keypair ===
     115
     116Access to compute resources in GENI is provided through ssh key pairs and thus the portal needs a public key to upload to compute resources. For the purposes of the tutorial we will have the portal create an SSH key pair for you. (However, if you prefer to use your personal public key you can choose to upload it.)
     117
     118{{{
     119#!html
     120<table border="0">
     121      <tr>
     122       <td >
     123         <ol>
     124            <li>Once you are logged in, click on the <i>Profile</i> page.</li>
     125            <li>On the <i>Profile</i> page in the <i>SSH Keys</i> section, select <b>generate and download an SSH keypair</b> button.</li>
     126
     127          </ol>
     128       </td>
     129        <td>
     130        <img src="http://groups.geni.net/geni/attachment/wiki/GENIEducation/SampleAssignments/LabZero/Graphics/profile_sshkeys_3_v4.png?format=raw" alt="Generate an SSH Key Pair"  width="600" title="Generate an SSH Key Pair" /> </a>
     131         <br/>
     132         <b>Figure 2-2</b> <i>On the </i>Profile<i> page, select the "generate and download an SSH keypair" button.</i>
     133       </td>
     134      </tr>
     135      <tr>
     136       <td >
     137         <ol start='3'>
     138            <li>Enter the same passphrase twice, then press <b>Generate SSH private key</b>.</li>
     139          </ol>
     140       </td>
     141        <td>
     142        <img border="0" src="http://groups.geni.net/geni/attachment/wiki/GENIEducation/SampleAssignments/LabZero/Graphics/generate_sshkeys_1_v2.png?format=raw" alt="Generate an SSH Key Pair"  width="600" title="Generate an SSH Key Pair" /> </a>
     143         <br/>
     144         <b>Figure 2-3</b> <i>Enter passphrase twice, then generate SSH private key.</i>
     145       </td>
     146      </tr>
     147      <tr>
     148       <td >
     149         <ol start='4'>
     150            <li>Now, press the <b>Download Private Key</b> button</li>
     151            <li>Open a terminal and execute:
     152<pre>
     153$ mv ~/Downloads/id_geni_ssh_rsa ~/.ssh/.
     154$ chmod 0600 ~/.ssh/id_geni_ssh_rsa
     155$ ssh-add ~/.ssh/id_geni_ssh_rsa
     156</pre>
     157Later in the tutorial, this will allow you to log into your nodes securely without a password. </li>
     158
     159          </ol>
     160       </td>
     161        <td>
     162        <img border="0" src="http://groups.geni.net/geni/attachment/wiki/GENIEducation/SampleAssignments/LabZero/Graphics/download_sshkeys_1_v2.png?format=raw" alt="Download an SSH Key Pair"  width="600" title="Download an SSH Key Pair" /> </a>
     163         <br/>
     164         <b>Figure 2-4</b> <i>Download an SSH Key Pair.</i>
     165       </td>
     166       
     167    </tr>
     168 </table>
     169}}}
     170
     171
     172=== 2.4 Configure Omni ===
     173
     174
     175{{{
     176#!html
     177<ol>
     178<li>Go to your browser tab with the GENI Portal page.</li>
     179<li>On that page, select the tab labeled "Profile".  This is on the upper right of the page.</li>
     180<li>Now select the section labeled <a href='https://portal.geni.net/secure/profile.php#omni'>Configure: omni</a>.</li>
     181<li>Now look for "Option 1: Automatic omni configuration".<br />
     182<img width=400 src="http://trac.gpolab.bbn.com/gcf/raw-attachment/wiki/OmniConfigure/Automatic/omni-config-portal.png" />
     183</li>
     184<li>Click on "customized configuration data" in Step 2 of this section.</li>
     185<li>Generate a GENI certificate.  The easiest choice is to have the portal generate a combined certificate and key file:<br />
     186<img src="http://trac.gpolab.bbn.com/gcf/raw-attachment/wiki/OmniConfigure/Automatic/generate-portal-cert.png" width="428" height="109" /></li>
     187<li>Make sure your default project matches what is on your worksheet.  If not, make that your default.</li>
     188<li>Click "Download omni bundle" and "save" the file.  The file is saved in your Downloads folder.<br />
     189<img width=400 src="http://trac.gpolab.bbn.com/gcf/raw-attachment/wiki/OmniConfigure/Automatic/download-omni-portal.png" />
     190</li>
     191<li>Open a terminal window and type:<pre class="wiki">omni-configure.py</pre>The cert and key files you need will be installed in the appropriate folders.</li>
     192</ol>
     193}}}
     194
     195== 3.  Obtain Resources ==
     196
     197Now that you are a member of a project, you can create a slice and reserve resources.
     198
     199=== 3.1 Create a slice ===
     200
     201{{{
     202#!html
     203<table border="0">
     204   
     205      <tr>
     206
     207       <td >
     208         <ol>
     209            <li> Go to the <i>Home</i> tab. </li>
     210           <li> Press the <b>Create Slice</b> button for this project.</li>
     211            <li> <FONT COLOR="black">As a slice name use the slice name on your worksheet, you can leave the description empty and press <b>Create Slice</b></font>
     212            </li>
     213 
     214
     215          </ol>
     216       </td>
     217       <td>
     218
     219        <img border="0" src="http://groups.geni.net/geni/attachment/wiki/GENIEducation/SampleAssignments/LabZero/Graphics/createslice_3_v2.png?format=raw" alt="Create a GENI Slice"  width="600" title="Create a GENI Slice" />
     220<br />
     221         <b>Figure 3-1</b> <i>Create a new slice.</i>
     222       </td>
     223    </tr>
     224 </table>
     225}}}
     226
     227
     228
     229Now that you are a member of a project, you can create a slice and reserve resources.
     230
     231== 3.2. Import a simple experiment ==
     232
     233{{{
     234#!html
     235<p>For this exercise, we will start with a prepared rspec file.</p>
     236
     237<table><tr>
     238<td>
     239  <p>You should load this topology into Flack:</p>
     240  <ol>
     241    <li>From the "Import" menu (see figure), select the "Import from the web" item.</li>
     242    <li>Enter the URL corresponding to the rack type you are using and open it:
     243      <p><img src="http://groups.geni.net/geni/attachment/wiki/GENIExperimenter/Tutorials/Graphics/instageni-logo.png?format=raw" width="75" height="75" /><b> InstaGENI</b></p>
     244      <pre class="wiki">http://www.gpolab.bbn.com/experiment-support/UnderstandAMAPI/ig/understandAMAPI_ig.rspec</pre>
     245      <p><img src="http://groups.geni.net/geni/attachment/wiki/GENIExperimenter/Tutorials/Graphics/exogeni-logo.png?format=raw" width="75" height="75" /><b> ExoGENI</b></p>
     246      <pre class="wiki">http://www.gpolab.bbn.com/experiment-support/UnderstandAMAPI/eg/understandAMAPI_eg.rspec</pre>
     247    </li>
     248    <li>Because this file contains a generic description of resources and does
     249    not specify any particular aggregate manager, Flack will report
     250    "There were resources detected without a manager selected, please select which manager you would like to use."
     251    Select "OK", and then choose the manager listed on your worksheet from the
     252    list.  Then select "Accept", and a network topology (which might look
     253    familiar if you have completed earlier tutorials) should appear
     254    on the canvas.</li>
     255  </ol>
     256</td>
     257<td><img src="http://groups.geni.net/geni/attachment/wiki/GENIExperimenter/Tutorials/PortalOmniExample/ObtainResources/flack-import-small.png?format=raw" /></td>
     258</tr></table>
     259}}}
     260
     261== 3.3. Modify the experiment to automatically install and execute network test software ==
     262
     263{{{
     264#!html
     265
     266<table><tr>
     267<td><p>1. For this sample experiment, we'd like some additional software
     268(<tt>Apache</tt>, <tt>iperf</tt>, and a couple of custom scripts) loaded
     269onto the VMs to perform traffic measurements.  In Flack, you can manipulate
     270the details of the request for a node or link with the "<tt>i</tt>" button
     271on the relevant component on the canvas (see figure).  Do this now on the
     272client node.</p></td>
     273<td><img src="http://groups.geni.net/geni/attachment/wiki/GENIExperimenter/Tutorials/PortalOmniExample/ObtainResources/flack-node-info-small.png?format=raw" /></td>
     274</tr></table>
     275
     276<table><tr>
     277<td><p>2. When you open the node information, you should see options like those
     278in the figure.  The controls available to you will vary depending on the
     279types of the aggregate manager and the component, but many features are
     280widely available throughout GENI.</p>
     281
     282<p>3. One of the things you can set at this time is the image for the VM.
     283      <p><img src="http://groups.geni.net/geni/attachment/wiki/GENIExperimenter/Tutorials/Graphics/instageni-logo.png?format=raw" width="75" height="75" /><b> InstaGENI</b></p>
     284      <pre class="wiki">Ubuntu 12.04 LTS</pre>
     285      <p><img src="http://groups.geni.net/geni/attachment/wiki/GENIExperimenter/Tutorials/Graphics/exogeni-logo.png?format=raw" width="75" height="75" /><b> ExoGENI</b></p>
     286      <pre class="wiki">Use the default image</pre>
     287</p>
     288
     289<p>4. The way we will request installation of the proper software and execution
     290of our experiment is to add <i>install</i> and <i>execute</i> services.
     291First, select "<tt>+ Add Install Service</tt>" as shown.  Flack will now
     292prompt you for an "Archive URL" and a location for installation.  For this
     293experiment, please enter the appropriate URL:
     294      <p><img src="http://groups.geni.net/geni/attachment/wiki/GENIExperimenter/Tutorials/Graphics/instageni-logo.png?format=raw" width="75" height="75" /><b> InstaGENI</b></p>
     295      <pre class="wiki">http://www.gpolab.bbn.com/experiment-support/UnderstandAMAPI/ig/underAMAPI_ig.tar.gz</pre>
     296      <p><img src="http://groups.geni.net/geni/attachment/wiki/GENIExperimenter/Tutorials/Graphics/exogeni-logo.png?format=raw" width="75" height="75" /><b> ExoGENI</b></p>
     297      <pre class="wiki">http://www.gpolab.bbn.com/experiment-support/UnderstandAMAPI/eg/underAMAPI_eg.tar.gz</pre>
     298and ask for this to be installed in:
     299<pre class="wiki">
     300/local
     301</pre></p>
     302
     303<p>5. Similarly, please use the "<tt>+ Add Execute Service</tt>" button to request
     304that the appropriate command:
     305      <p><img src="http://groups.geni.net/geni/attachment/wiki/GENIExperimenter/Tutorials/Graphics/instageni-logo.png?format=raw" width="75" height="75" /><b> InstaGENI</b></p>
     306      <pre class="wiki">sudo /local/install-script.sh</pre>
     307      <p><img src="http://groups.geni.net/geni/attachment/wiki/GENIExperimenter/Tutorials/Graphics/exogeni-logo.png?format=raw" width="75" height="75" /><b> ExoGENI</b></p>
     308      <p><pre class="wiki">/local/install-client.sh</pre>(client node only)
     309      <pre class="wiki">/local/install-server.sh</pre>(server node only)</p>
     310be executed using
     311<pre class="wiki">
     312sh
     313</pre></p>
     314
     315<table border="0" cellpadding="0" cellspacing="0"><tr><td><img src="http://groups.geni.net/geni/attachment/wiki/GENIExperimenter/Tutorials/Graphics/warning-icon-hi.png?format=raw" /></td><td>Be very careful when entering this information -- these commands will not
     316be executed yet, so it will be some time before you will see any relevant
     317error messages if there is a mistake here.</td></tr></table>
     318
     319<p>6. Once both the "install" and "execute" services are specified, please
     320choose "Apply".  Then repeat the procedure to add the same "install" and
     321"execute" services on the server node.</p>
     322
     323<p>If you have time, it would be instructive to download the "<tt>gec17tut2.tar.gz</tt>" file yourself, and inspect the contents.  You will see the <tt>install-script.sh</tt> file referred to in the execute service, and this is a good example of how you can ask for GENI components to perform tasks for you without any manual intervention.  This is a very useful facility for large experiments!</p>
     324</td>
     325<td><img src="http://groups.geni.net/geni/attachment/wiki/GENIExperimenter/Tutorials/PortalOmniExample/ObtainResources/flack-services-small.png?format=raw" /></td>
     326</tr></table>
     327}}}
     328
     329== 3.4. Export the modified request RSpec ==
     330{{{
     331#!html
     332<p>Now we will pull back some of the covers and inspect exactly what Flack has been doing for us when preparing the rspecs for the experiments we design.  Each node and link has a corresponding element in the rspec, and the details of the component configuration (such as the install and execute services we requested above) are specified with attributes, or sometimes child elements, within those portions of the document.</p>
     333
     334<table><tr>
     335<td>
     336<ol>
     337<li>From the "View" menu (see figure), select the "Preview
     338request document(s)" item.  This will bring up a window showing the
     339current rspec -- please take a moment to inspect it.  The XML elements
     340under the "<tt>flack</tt>" namespace were added for Flack's internal
     341use (containing information about the canvas layout, editing history, etc.),
     342and are ignored by aggregate managers.  The "node" and "link" elements
     343contain the specification for the components we will request, and if you
     344look closely, you will be able to see the install and execute service
     345elements you added earlier.</li>
     346<li>Use the "Save to file" button (in the upper left) to
     347make a local copy of your rspec.  We'll use this in the next step to
     348demonstrate how other client tools also use rspec files to communicate
     349requests to aggregate managers.</li>
     350</ol>
     351</td>
     352<td><img src="http://groups.geni.net/geni/attachment/wiki/GENIExperimenter/Tutorials/PortalOmniExample/ObtainResources/flack-view-small.png?format=raw" /></td>
     353</tr></table>
     354}}}
     355
     356== 3.5. Instantiate the new experiment using Omni ==
     357
     358For this step, we'll change the approach a bit and switch to a new client tool: the command line Omni client.  From a terminal, please enter the command:
     359
     360{{{
     361$ omni.py -a AM_NICKNAME createsliver SLICENAME RSPEC_FILE
     362}}}
     363
     364where {{{AM_NICKNAME}}} is the nickname for your assigned aggregate manager and {{{SLICENAME}}} is the name of the slice you created at the portal (both of these are given on your worksheet).  {{{RSPEC_FILE}}} should be replaced with the filename of the rspec you saved in step 4.
     365
     366
     367If all is well, Omni should give you a number of informational messages, such as:
     368{{{
     369INFO:omni:Loading config file /home/geni/.gcf/omni_config
     370}}}
     371
     372It should quickly proceed to the point where it makes the request to the remote manager:
     373{{{
     374INFO:omni:Creating sliver(s) from rspec file /home/geni/Downloads/experiments.rspec for slice ...
     375}}}
     376
     377This step can sometimes be time-consuming, so please be patient.  If it succeeds, within a few minutes Omni should report:
     378{{{
     379INFO:omni: Completed createsliver:
     380}}}
     381
     382and your sliver is complete!
     383
     384
     385----
     386= [wiki:GENIEducation/SampleAssignments/UnderstandAMAPI/Procedure Introduction] =
     387= [wiki:GENIEducation/SampleAssignments/UnderstandAMAPI/Procedure/Execute Next:  Execute] =