98 | | we have chosen values for all parameters. The vm-name should be your geni-username |
99 | | {{{ |
100 | | $ ./tutorial.sh createvm savi <tenant_name> toronto ubuntu-14-04-64 small savi_tutorial <geni_username> |
101 | | $ ./tutorial.sh createvm savi <tenant_name> victoria ubuntu-14-04-64 small savi_tutorial <geni_username> |
102 | | }}} |
103 | | |
104 | | We now have VMs at Cornell, Utah, Toronto, and Victoria. |
105 | | |
106 | | {{{ |
107 | | $ ssh -i id_rsa -F ssh-config slice338.pcvm3-1.instageni.metrodatacenter.com |
108 | | }}} |
109 | | |
110 | | Type '''ifconfig eth0'''. You should see an eth0 interface with an IP address in the 10.0.0.0/8 range, a ''private'' IP address. |
111 | | |
112 | | {{{ |
113 | | root@slice347:~# ifconfig eth0 |
114 | | eth0 Link encap:Ethernet HWaddr a6:24:c1:df:c7:09 |
115 | | inet addr:10.20.0.243 Bcast:0.0.0.0 Mask:255.255.0.0 |
116 | | inet6 addr: fe80::a424:c1ff:fedf:c709/64 Scope:Link |
117 | | UP BROADCAST RUNNING MTU:1500 Metric:1 |
118 | | RX packets:56555 errors:0 dropped:2 overruns:0 frame:0 |
119 | | TX packets:49525 errors:0 dropped:0 overruns:0 carrier:0 |
120 | | collisions:0 txqueuelen:1000 |
121 | | RX bytes:93890170 (93.8 MB) TX bytes:8052865 (8.0 MB) |
122 | | }}} |
123 | | |
124 | | This IP address is behind a NAT and not directly reachable from outside (i.e., from the Internet). However all nodes in your slicelet can contact each other using the private addresses. |
125 | | |
126 | | The nodes in your '''ssh-config''' file are Docker containers running on (virtual) hosts. These hosts have ''public'' IP addresses that are routable from the Internet, that's why you can login to the Docker containers of your slicelet. A port on the public IP address (e.g., 49155) is forwarded to the SSH port (22) on the container's private IP address. The '''ssh-config''' file contains the names of the virtual hosts and the port forwarding information. |
127 | | |
128 | | When you run a server on a node in your slicelet, it will listen on the private address, because that is the only one it can see. By default it will only be visible to other nodes in your slicelet. Docker provides facilities for exposing ports to the public Internet, but this topic is outside the scope of this tutorial. |
129 | | |
130 | | ''Note that later on you will need to find both the ''public'' and ''private'' IP addresses for each node in the slicelet.'' |
131 | | |
132 | | ---- |
133 | | |
134 | | == 3. Configure the Ansible controller for your slicelet == |
135 | | |
136 | | If you already have Ansible installed on your laptop, then you can use it as the controller for this experiment. Otherwise, you will use one of the nodes in your slicelet as the Ansible controller. Pick one, log into it, and install ansible using apt-get: |
137 | | |
138 | | {{{ |
139 | | $ apt-get update |
140 | | $ apt-get install ansible |
141 | | }}} |
142 | | |
143 | | Then upload your slicelet helper files to that node. {{{scp}}} can be used for this; in the directory where you unzipped the files, run a command like the following: |
144 | | |
145 | | {{{ |
146 | | $ scp -F ssh-config * ansible-hosts slice323.pcvm3-1.instageni.metrodatacenter.com: |
147 | | }}} |
148 | | |
149 | | || [[Image(wiki:GENIExperimenter/Tutorials/Graphics:tip.png, nolink, 50px, bottom)]] || '''Pro Tip:''' remove your controller node from the '''ansible_hosts''' file after you’ve uploaded. || |
150 | | |
151 | | ---- |
| 98 | we have chosen values for all parameters. The vm-name should be your geni-username, followed by the sitename. E.g., for rickmcg, the name at Toronto will be rickmcg-toronto |
| 99 | {{{ |
| 100 | $ ./tutorial.sh createvm savi <tenant_name> toronto ubuntu-14-04-64 small savi_tutorial <geni_username>-toronto |
| 101 | $ ./tutorial.sh createvm savi <tenant_name> victoria ubuntu-14-04-64 small savi_tutorial <geni-username>-victoria |
| 102 | }}} |
| 103 | |
| 104 | We now have VMs at Cornell, Utah, Toronto, and Victoria. Check the status of your resources on both GENI and SAVI |
| 105 | |
| 106 | {{{ |
| 107 | $ ./tutorial.sh listinstance geni |
| 108 | $ ./tutorial.sh listinstance savi |
| 109 | }}} |
| 110 | |
| 111 | Notice that access to the SAVI machines are by IP address |
202 | | === (c) The setup module === |
203 | | |
204 | | The '''setup''' module gathers a bunch of information about each node and saves it in variables that you can reference in your Ansible playbooks. This will be really useful to do the tutorial! Try it out on a node to see what it collects (replace `<your-slicelet>` with your slicelet’s name): |
205 | | |
206 | | {{{ |
207 | | $ ansible <your-slicelet>.pcvm1-1.instageni.wisc.edu -i ansible-hosts -m setup |
208 | | }}} |
209 | | |
210 | | === (d) A simple playbook === |
| 176 | === (d) The setup module === |
| 177 | |
| 178 | The '''setup''' module gathers a bunch of information about each node and saves it in variables that you can reference in your Ansible playbooks. This will be really useful to do the tutorial! Try it out on a node to see what it collects (replace `<your-vm>` with your hostname): |
| 179 | |
| 180 | {{{ |
| 181 | $ ansible <yourvm>.utahddc.geniracks.net -i ansible-hosts -m setup |
| 182 | }}} |
| 183 | |
| 184 | === (e) A simple playbook === |