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

08/16/13 09:04:59 (6 years ago)



  • GENIEducation/SampleAssignments/UnderstandAMAPI/Procedure/DesignSetupXen

    v1 v1  
     1= [ Understanding the AM API] =
     6<div style="text-align:center; width:495px; margin-left:auto; margin-right:auto;">
     7<img id="Image-Maps_5201305222028436" src="" 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="" alt="Image Map" title="Image Map" />
     14<!-- Image map text links - End - -->
     21== 1.  Design the Experiment ==
     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>
     35== 2.  Establish the Environment ==
     39=== 2.1  Pre-work: Create a GENI account ===
     42<table border="0">
     44      <tr>
     46       <td >
     47         <ol>
     48            <li> Go to <a href=""> </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/>
     52<table id="Table_03" border="0" cellpadding="5" cellspacing="0">
     53        <tr>
     54                <td>
     55                        <img src="" 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>
     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>
     69        <a href="">
     70        <!--img border="0" src="" alt="Login to GENI"  height="120" title="Use GENI" />  </a>
     72        <br/--><img border="0" src="" 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>
     80Congratulations, you have successfully created a GENI account.
     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. 
     88<table border="0">
     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="" 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="">GENI account</a> and join a project.
     101               </td>
     102        </tr>
     107          </ol>
     108       </td>
     110    </tr>
     111 </table>
     114=== 2.3 Pre-work: Generate and Download SSH Keypair ===
     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.)
     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>
     127          </ol>
     128       </td>
     129        <td>
     130        <img src="" 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="" 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:
     153$ mv ~/Downloads/id_geni_ssh_rsa ~/.ssh/.
     154$ chmod 0600 ~/.ssh/id_geni_ssh_rsa
     155$ ssh-add ~/.ssh/id_geni_ssh_rsa
     157Later in the tutorial, this will allow you to log into your nodes securely without a password. </li>
     159          </ol>
     160       </td>
     161        <td>
     162        <img border="0" src="" 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>
     167    </tr>
     168 </table>
     172=== 2.4 Configure Omni ===
     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=''>Configure: omni</a>.</li>
     181<li>Now look for "Option 1: Automatic omni configuration".<br />
     182<img width=400 src="" />
     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="" 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="" />
     191<li>Open a terminal window and type:<pre class="wiki"></pre>The cert and key files you need will be installed in the appropriate folders.</li>
     195== 3.  Obtain Resources ==
     197Now that you are a member of a project, you can create a slice and reserve resources.
     199=== 3.1 Create a slice ===
     203<table border="0">
     205      <tr>
     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>
     215          </ol>
     216       </td>
     217       <td>
     219        <img border="0" src="" 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>
     229Now that you are a member of a project, you can create a slice and reserve resources.
     231== 3.2. Import a simple experiment ==
     235<p>For this exercise, we will start with a prepared rspec file.</p>
     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="" width="75" height="75" /><b> InstaGENI</b></p>
     244      <pre class="wiki"></pre>
     245      <p><img src="" width="75" height="75" /><b> ExoGENI</b></p>
     246      <pre class="wiki"></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>
     257<td><img src="" /></td>
     261== 3.3. Modify the experiment to automatically install and execute network test software ==
     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="" /></td>
     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>
     282<p>3. One of the things you can set at this time is the image for the VM.
     283      <p><img src="" width="75" height="75" /><b> InstaGENI</b></p>
     284      <pre class="wiki">Ubuntu 12.04 LTS</pre>
     285      <p><img src="" width="75" height="75" /><b> ExoGENI</b></p>
     286      <pre class="wiki">Use the default image</pre>
     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="" width="75" height="75" /><b> InstaGENI</b></p>
     295      <pre class="wiki"></pre>
     296      <p><img src="" width="75" height="75" /><b> ExoGENI</b></p>
     297      <pre class="wiki"></pre>
     298and ask for this to be installed in:
     299<pre class="wiki">
     303<p>5. Similarly, please use the "<tt>+ Add Execute Service</tt>" button to request
     304that the appropriate command:
     305      <p><img src="" width="75" height="75" /><b> InstaGENI</b></p>
     306      <pre class="wiki">sudo /local/</pre>
     307      <p><img src="" width="75" height="75" /><b> ExoGENI</b></p>
     308      <p><pre class="wiki">/local/</pre>(client node only)
     309      <pre class="wiki">/local/</pre>(server node only)</p>
     310be executed using
     311<pre class="wiki">
     315<table border="0" cellpadding="0" cellspacing="0"><tr><td><img src="" /></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>
     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>
     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></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>
     325<td><img src="" /></td>
     329== 3.4. Export the modified request RSpec ==
     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>
     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>
     352<td><img src="" /></td>
     356== 3.5. Instantiate the new experiment using Omni ==
     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:
     361$ -a AM_NICKNAME createsliver SLICENAME RSPEC_FILE
     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.
     367If all is well, Omni should give you a number of informational messages, such as:
     369INFO:omni:Loading config file /home/geni/.gcf/omni_config
     372It should quickly proceed to the point where it makes the request to the remote manager:
     374INFO:omni:Creating sliver(s) from rspec file /home/geni/Downloads/experiments.rspec for slice ...
     377This step can sometimes be time-consuming, so please be patient.  If it succeeds, within a few minutes Omni should report:
     379INFO:omni: Completed createsliver:
     382and your sliver is complete!
     386= [wiki:GENIEducation/SampleAssignments/UnderstandAMAPI/Procedure Introduction] =
     387= [wiki:GENIEducation/SampleAssignments/UnderstandAMAPI/Procedure/Execute Next:  Execute] =