Changes between Version 3 and Version 4 of GENIExperimenter/Tutorials/GENI-SAVI/Execute


Ignore:
Timestamp:
05/26/15 12:00:33 (9 years ago)
Author:
rick@mcgeer.com
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GENIExperimenter/Tutorials/GENI-SAVI/Execute

    v3 v4  
    2626'''Your goal in this tutorial is to fetch a parameterized URL on each node of your slicelet:'''
    2727
    28  '''!http://www.lively-web.org/nodejs/GEETutorial/helloWorld?slice=<slice name>&name=<container name>&ip=<IP of host>&local=<IP of  container>&lat=<latitude of host>&lng=<longitude of container>'''
     28 '''!http://www.lively-web.org/nodejs/GEETutorial/helloWorld?slice=<slice name>&name=<container name>&ip=<IP of host>&lat=<latitude of host>&lng=<longitude of container>'''
    2929
    3030'''This page will log each of your queries, and you can check that all your nodes were successfully able to run the query.'''
     
    4646  tasks:
    4747
    48   ### (a): Get the container's FQDN ###
    49   - name: Dump container FQDN
    50     debug: # INSERT ARGUMENTS HERE
     48 
    5149
    52 
    53   ### (b):  Get the container IP address ###
    54   - name: Dump container IP address
    55     debug: # INSERT ARGUMENTS HERE
    56 
    57 
    58   ### (c): Get the control host name ###
     50  ### (a): Get the control host name ###
    5951  - name: Dump control host name
    6052    debug: # INSERT ARGUMENTS HERE
    6153
    6254
    63   ### (d): Get the host's public IP address ###
     55  ### (b): Get the host's public IP address ###
    6456  - name: Get my public IP using 'dig +short'
    6557    shell: # INSERT ARGUMENTS HERE
     
    7062
    7163
    72   ### (e): Get the latitude and longitude for each node ###
     64  ### (c): Get the latitude and longitude for each node ###
    7365  - name: Download GeoLiteCity DB
    7466    get_url: # INSERT ARGUMENTS HERE
     
    9284
    9385
    94   ### (f): Fetch the parameterized URL ###
     86  ### (d): Fetch the parameterized URL ###
    9587  - name: Dump the full URL, to make sure it looks OK
    9688    debug: msg="http://www.lively-web.org/nodejs/GEETutorial/helloWorld?slice=# INSERT ARGUMENTS HERE"
     
    10294The following subsections provide further guidance on how to complete each step.
    10395
    104 === (a) Get the container's FQDN ===
    10596
    106 Look at the variables collected by Ansible's '''setup''' module.  Find one that holds the container's fully-qualified domain name (e.g., slice347.pcvm1-1.instageni.iu.edu) and dump it using a '''debug''' task. 
    107 
    108 === (b) Get the container IP address ===
    109 
    110 Look at the variables collected by Ansible's '''setup''' module.  Find one that holds the container IP address and dump it using a '''debug''' task.
    111 
    112 === (c) Get the control host name ===
     97=== (a) Get the control host name ===
    11398
    11499Look at the variables collected by Ansible's '''setup''' module.  Find one that holds the control host's FQDN (HINT: it begins with ''pcvm'') and dump it using a '''debug''' task.  You'll need this for the next step.
    115100
    116 === (d) Get the host's public IP address ===
     101=== (b) Get the host's public IP address ===
    117102
    118103The IP address visible inside the slicelet (as reported in the variable ''ansible_eth0.ipv4.address'') is a private address -- it is not the control address of the host.  To discover the ''public'' IP address of the node, run '''dig +short <control host name>'''.
     
    134119|| [[Image(wiki:GENIExperimenter/Tutorials/Graphics:tip.png, nolink, 50px, bottom)]] || '''Pro Tip:''' When you run an Ansible command in a playbook, you can save the output into a new variable using '''register: varname'''  Then you can retrieve the value later in the playbook using ''{{ varname }}'' or, for shell command output, ''{{ varname.stdout }}''.  You can see an example of how to register a variable in [https://github.com/ansible/ansible-examples/blob/master/language_features/register_logic.yml this playbook]. ||
    135120
    136 === (e) Get the latitude and longitude for each node ===
     121=== (c) Get the latitude and longitude for each node ===
    137122
    138123To map the host's control IP address obtained in the previous step to the latitude and longitude for each node, use the '''geoiplookup''' tool, provided by package '''geoip-bin'''.
     
    148133|| [[Image(wiki:GENIExperimenter/Tutorials/Graphics:tip.png, nolink, 50px, bottom)]] || '''Pro Tip:''' You can also use the Ansible '''script''' module to run arbitrary scripts in your slicelet, if that helps.  See: http://docs.ansible.com/script_module.html ||
    149134
    150 === (f) Fetch the parameterized URL ===
     135=== (d) Fetch the parameterized URL ===
    151136
    152137At this point, you should have enough information to fetch the parameterized URL in the playbook.  You should first use a '''debug''' task to print out the URL to make sure that it's formatted correctly.
     
    160145== 2. Run the playbook ==
    161146
    162 Once you have finished with Step 1, run your playbook against all the nodes in your slicelet
     147Once you have finished with Step 1, run your playbook against all the nodes in your slice
    163148
    164149----