[[PageOutline]] = Creating PlanetLab Request RSpecs from Advertisement RSpecs = In this step by step instructions we are going to use [wiki:RSpecSchema3 GENI v3] RSpecs and also give intuition about how to use ProtoGENI v2 RSpecs. For an overview of RSpecs used in GENI look [wiki:GENIExperimenter/RSpecs here]. You can use any tool that talks the GENI AM API to follow these instructions. For the purpose of this page we are using the [http://trac.gpolab.bbn.com/gcf/wiki/Omni Omni command line tool]. == 1. Download and save the ad RSpec == Use Omni to download and save the advertised RSpec from the aggregate you care about. a. In general the command is: {{{ $ omni.py -a -t GENI 3 -o listresources }}} If the AM you are using supports ProtoGENI v2 RSpecs then the command will look like: {{{ $ omni.py -a -t ProtoGENI 2 -o listresources }}} The main difference between ProtoGENI v2 RSpecs and GENI v3 is the location of the schemas. If you are using ProtoGENI v2 then make sure that you replace this URL: `http://www.geni.net/resources/rspec/3` with this: `http://www.protogeni.net/resources/rspec/2` and vice versa. For example, to get the request RSpec from the MyPLC at the GPO Lab: {{{ $ omni.py -a pl-gpo -t ProtoGENI 2 -o listresources }}} b. The output of this command is: {{{ geni@geni-tutorial:~/Tutorials/Omni/gpousr20$ omni.py -a pl-gpo -t ProtoGENI 2 -o listresources INFO:omni:Loading config file omni_config INFO:omni:Using control framework pgeni INFO:omni:Saving output to a file. INFO:omni:Substituting AM nickname pl-gpo with URL http://myplc.gpolab.bbn.com:12346/, URN unspecified_AM_URN INFO:omni:Listed resources on 1 out of 1 possible aggregates. INFO:omni:Writing to 'rspec-myplc-gpolab-bbn-com-12346-.xml' INFO:omni: ------------------------------------------------------------ INFO:omni: Completed listresources: Options as run: aggregate: pl-gpo framework: pgeni native: True output: True rspectype: ('ProtoGENI', '2') Args: listresources Result Summary: Retrieved resources from 1 aggregates. Wrote rspecs from 1 aggregates to 1 files Saved listResources RSpec at unspecified_AM_URN to file rspec-myplc-gpolab-bbn-com-12346-.xml. . INFO:omni: ============================================================ }}} == 2. Copy and edit the RSpec file. == a. Copy the advertisement RSpec file. The new file will become the request RSpec. In general this would be: {{{ cp }}} The value of {{{}}} appears in the Omni summary. In this case we will generate a request for the node "navis": {{{ cp rspec-myplc-gpolab-bbn-com-12346-.xml pl-gpo-navis.rspec }}} b. Edit the request Rspec file: {{{ emacs pl-gpo-navis.rspec & }}} or {{{ vi pl-gpo-navis.rspec }}} c. Edit the {{{}}} tag. i. In the {{{}}} tag, remove the {{{expires}}} and {{{generated}}} attributes. ii. In the {{{}}} tag, change the {{{type="advertisement"}}} attribute to {{{type="request"}}}. iii. In the {{{}}} tag, change 'ad' to 'request' in the schema location. That is, change this: {{{ xsi:schemaLocation=""http://www.geni.net/resources/rspec/3 "http://www.geni.net/resources/rspec/3/ad.xsd" }}} To this: {{{ xsi:schemaLocation="http://www.geni.net/resources/rspec/3 http://www.geni.net/resources/rspec/3/request.xsd" }}} iv. The {{{}}} tag should now look like this (note that the whitespace has been adjusted for ease of reading): {{{ }}} d. Remove the {{{node}}} tags you do not want to request. i. For example to only reserve the node {{{navis.gpolab.bbn.com}}} remove the following text: {{{ .... .... .... .... }}} ii. At this point the entire file should look like this: {{{ }}} d. Edit the {{{}}} tag you are trying to reserve. i. Remove all {{{}}}, {{{}}}, {{{}}}, and {{{}}} tags which exist from the {{{}}} tag you are trying to reserve. ii. Add the attribute {{{client_id}}} to the {{{}}} tag you are trying to reserve. The value is your choice, so here we will use {{{client_id="navis"}}}. iii. The final request RSpec file should look like this: {{{ }}} e. Save the file. == 3. Run rspeclint == [https://www.protogeni.net/trac/protogeni/wiki/RSpecDebugging rspeclint] is a program that helps you verify the validity of an RSpec document. [http://www.protogeni.net/resources/rspeclint Download rspeclint] and invoke it to validate your rspec. If it works, you should see no errors returned by the call. In general, this is: {{{ rspeclint }}} For this example do: {{{ rspeclint pl-gpo-navis.rspec }}}