wiki:GENIEducation/SampleAssignments/Template/ExerciseLayout/DesignSetup

Version 1 (modified by nriga@bbn.com, 12 years ago) (diff)

--

<EXERCISE TITLE>

Hello GENI index Hello GENI index Hello GENI index

Configure and Initialize Services:Configure Omni

Omni Client
   
Omni is a tool that will help you reserve resources in GENI, using your GENI credentials. The first step is to load into Omni your information. Omni uses a configuration file, and there is a script that will automatically generate the file with some default options and place it in the default place of `~/.gcf/`.
   
Follow these steps:
  1. In the GENI Portal, go to the `Profile` Tab.
  2. Scroll all the way to the end of the page, to the section titled ''Configure omni''
  3. Click on the ''customized configuration data'' link
  4. If this is the first time you do this:
    1. Press the generate an SSL Cert link
    2. Make sure you choose the first option
  5. In the next page, make sure you choose as your project, the project you just joined and click the ''Download omni bundle'' button, and select to save it.
  6. Open a terminal window
  • Run:
    • omni-configure.py -f portal
  •    
    Generate SSL cert
       

    The output should look like:

    geni@GEC16-Tutorials:~$ omni-configure.py -f portal
    {'portal_bundle': '~/Downloads/omni-bundle.zip', 'verbose': False, 'cert': '~/.ssl/geni_cert', 'framework': 'portal', '
    configfile': '~/.gcf/omni_config', 'plkey': '~/.ssh/geni_pl_key', 'prkey': '~/.ssh/geni_key', 'pick_project': False}
    INFO:omniconfig:Using configfile: /home/geni/.gcf/omni_config
    INFO:omniconfig:Using portal bundle /home/geni/Downloads/omni-bundle.zip
    INFO:omniconfig:Private key stored at: /home/geni/.ssh/geni_key
    INFO:omniconfig:Wrote omni configuration file at: /home/geni/.gcf/omni_config
    geni@GEC16-Tutorials:~$ omni-configure.py -f portal
    

    Look around the omni_config file

    Open the file ~/.gcf/omni_config using either vim or emacs. Close to the top of the file you will see two parameters called default_cf and users. Your username should be at least listed in the user section. Look for the sections in the file that are named [pgch] and [<username>].

    In the [<username>] section, the information need for logging-in to reserved compute resources are provided. It includes your unique user URN and a public key that would be uploaded to the hosts that you reserve.

    In the [pgch] section you configure Omni to use your personal information. The cert and the key attribute point to files that we have manually downloaded from the portal.

    Another interesting section to look at is the [aggregate-nicknames] sections. Flack already knows the URL for all the AMs and present you a list of AMs to choose from using a short, descriptive name. In Omni a user is required to pass the URL for each call to the GENI AM API. In this section the user gets a chance to provide short descriptive names to the URLs that are easier to memorize and use.

    Test Omni setup

    In order to test that our configuration is correct, you can issue a getversion command. For this step we have used ProtoGENI's AM, but you can use any Aggregate Manager(AM).

    1. In the terminal type:
      omni.py getversion -a ig-gpo
      
      In GENI each AM can be contacted using a specific URL. In order to make it easier to talk to AMs, Omni uses nicknames; i.e. it maps each URL into an easy to remember nickname. Nicknames are defined in each user's omni_config file.

    For the rest of the tutorial we are going to use aggregate nicknames.

    Obtain Resources

    In this step we are going to setup a sample GENI experiment, in order to get familiarized with most of the Omni commands.

    Create and renew a slice

    The first thing to do when preparing to run a GENI experiment is to create a slice.

    1. To create a slice type, use as <slicename> omniXXX, where XXX are your initials. :
      omni.py createslice <slicename>
      
    2. To verify that your slice has been created and in general to keep track of your slices, use the listmyslices. You can figure out your username under the Profile tab. Type:
      omni.py listmyslices <username>
      
    3. Renew your slice. To extend the lifetime of your slice type:
      omni.py renewslice <slicename> YYYYMMDD
      

    Reserve resources, a.k.a create a sliver

    The next step in a GENI experiment is to actually reserve resources. For this experiment we are going to use the Aggregate manager of ProtoGENI in Utah.

    1. In Omni in order to see what each AM offers you can use the listresources command. Type:
       omni.py listresources -a pg-utah -o
      
      The -o option will save the output to a file. The filename is chosen by Omni and printed as part of the output. The output will look like :
      geni@GEC16-Tutorials:~$ omni.py listresources -a pg-utah -o
      INFO:omni:Loading config file /home/geni/.gcf/omni_config
      INFO:omni:Using control framework portal
      INFO:omni:Substituting AM nickname pg-utah with URL https://www.emulab.net:12369/protogeni/xmlrpc/am/2.0, URN unspecified_AM_URN
      INFO:omni:Saving output to a file.
      INFO:omni:Substituting AM nickname pg-utah with URL https://www.emulab.net:12369/protogeni/xmlrpc/am/2.0, URN unspecified_AM_URN
      INFO:omni:Listed advertised resources at 1 out of 1 possible aggregates.
      INFO:omni:Substituting AM nickname pg-utah with URL https://www.emulab.net:12369/protogeni/xmlrpc/am/2.0, URN unspecified_AM_URN
      INFO:omni: (PG log url - look here for details on any failures: https://www.emulab.net/spewlogfile.php3?logfile=4f418118189f457f2b1e0cbd2c304584)
      INFO:omni:Writing to 'rspec-www-emulab-net-protogeniv2.xml'
      INFO:omni: ------------------------------------------------------------
      INFO:omni: Completed listresources:
      
        Options as run:
      		aggregate: ['pg-utah']
      		framework: portal
      		output: True
      		project: SampleClass
      
        Args: listresources
      
        Result Summary: Queried resources from 1 of 1 aggregate(s).
      Wrote rspecs from 1 aggregate(s) to 1 file(s)
      Saved listresources RSpec at 'unspecified_AM_URN' (url 'https://www.emulab.net:12369/protogeni/xmlrpc/am/2.0') to file rspec-www-emulab-net-protogeniv2.xml;  (PG log url - look here for details on any failures: https://www.emulab.net/spewlogfile.php3?logfile=4f418118189f457f2b1e0cbd2c304584) 
      INFO:omni: ============================================================
      
      In the last line of the output Omni will tell you the name of the file that output is saved at. In the example above this would be rspec-www-emulab-net-protogeniv2.xml. Open the file that Omni saved and just take a look to see how an advertisement RSpec looks like. In order to see only available resources type
      omni.py listresources -a pg-utah --available -o
      
    2. To be able to reserve resources you will need to craft a request rspec. For this example we have created the rspec for you, use this rspec URL :

    http://www.gpolab.bbn.com/experiment-support/HelloGENI/hellogeni.rspec . Type :

    omni.py createsliver -a pg-utah <slicename> <rspec_url>
    

    1. Look at your reserved resources. Type:
      omni.py listresources -a pg-utah <slicename>
      
    2. Extend the lifetime of your sliver:
      omni.py renewsliver -a pg-utah <slicename> YYYYMMDD
      
    3. Check the status of your resources. Type:
      omni.py sliverstatus -a pg-utah <slicename>
      
      The sliverstatus command reports the status of your overall GENI slice. When the status is ready we are ready to continue to the next step.

    Next: Run Experiment