1 | | Essential reading: [https://wiki.emulab.net/wiki/elabinelab Emulab page on ElabInElab] |
| 1 | == Overview == |
| 2 | The [https://wiki.emulab.net/wiki/elabinelab Emulab page on ElabInElab] makes for very useful background reading. |
| 3 | |
| 4 | The following sections are derived from notes by Keith, expanding on the Emulab docs as they pertain to us: |
| 5 | |
| 6 | |
| 7 | == History == |
| 8 | |
| 9 | The historic behavior is that an emulab-in-emulab would steal an experimental interface and use it as the control interface. Nobody ever does that anymore. We added another ns-commnd to have the inner nodes use the regular control interfaces. This extension doesn't seem to be documented: {{{tb-elabinelab-singlenet}}} |
| 10 | |
| 11 | Some of what they say there may not work here anymore. e.g. we've never tried the stuff that immediately attempts to swap in an experiment once the inner elab finishes building. |
| 12 | |
| 13 | Another important ns command, which is not described in that document, is |
| 14 | |
| 15 | {{{ |
| 16 | namespace eval TBCOMPAT { |
| 17 | # set elabinelab_maxpcs <n> where n is the number of client pc's |
| 18 | set elabinelab_maxpcs 0 |
| 19 | } |
| 20 | }}} |
| 21 | |
| 22 | == Sample NS File == |
| 23 | A complete ns file to create an Emulab-in-Emulab with the operating system FBSD9-ENE with 3 pc's would look like this: |
| 24 | |
| 25 | {{{ |
| 26 | source tb_compat.tcl |
| 27 | set ns [new Simulator] |
| 28 | |
| 29 | tb-elab-in-elab 1 |
| 30 | tb-elabinelab-singlenet |
| 31 | |
| 32 | set os FBSD9-ENE |
| 33 | |
| 34 | namespace eval TBCOMPAT { |
| 35 | set elabinelab_maxpcs 3 |
| 36 | set elabinelab_nodeos("boss") $os |
| 37 | set elabinelab_nodeos("ops") $os |
| 38 | } |
| 39 | |
| 40 | $ns run |
| 41 | }}} |
| 42 | |
| 43 | == Creating the Emulab-In-Emulab == |
| 44 | |
| 45 | So you create an experiment with this as an ns file and swap it in. |
| 46 | |
| 47 | The build may fail; if it fails, it still declares the experiment to be swapped in but you have to do some manual intervention. |
| 48 | |
| 49 | On the real boss run |
| 50 | |
| 51 | {{{os_load -i FBSD9-ENE <whatever the myboss and myops node in your experiment are>}}} |
| 52 | |
| 53 | Wait until both nodes have reloaded and come up so that you can ssh into them. |
| 54 | |
| 55 | Then, on the real boss, run the command |
| 56 | |
| 57 | {{{elabinelab <your PID> <your EID>}}} |
| 58 | |
| 59 | ''Do not interrupt this''. It will take 30-40 minutes, if it works. Shorter if it fails. If it fails try again, including this os_load. |
| 60 | |
| 61 | == Interacting With Your elab-in-elab == |
| 62 | |
| 63 | You should be able to ssh into from users or boss.isi into nodes called myboss and myops in your experiment. The creator is given admin privs on the inside even if the creator doesn't have on the outside. |
| 64 | |
| 65 | You can use firefox with the foxyproxy extension to interact with the web server on the inside as described in: https://trac.deterlab.net/wiki/ElabElabSshProxy |
| 66 | |
| 67 | Even if this all works, there's some stuff that need to be done manually before you can swap an experiment in on the inside |
| 68 | |
| 69 | The partition table starts out empty, so you need to do a sched_reload of all the nodes from the inside boss. |
| 70 | |
| 71 | I agree that I should fix the build scripts to do this, and it probably needs to be the outside boss elabinelab script. |
| 72 | |
| 73 | Another bug that needs to be fixed is that in order to get the nodes on the inside to reload, the inside boss request the outside boss to power cycle them, which, in the case of nodes using the older serial-controlled RPC power controllers fails because the power cycle command won't work if it is already off. |
| 74 | |
| 75 | [the bug is that power cycle on this controllers should always work and this needs to be fixed in {{{boss.isi:/usr/testbed/lib/power_rpc27}}}] |
| 76 | |
| 77 | == How It Works, and Exercising a New Version == |
| 78 | If you've specified the ns-command |
| 79 | {{{ |
| 80 | tb-elab-in-elab 1 |
| 81 | }}} |
| 82 | in your NS file, then, as implied above {{{tbswap}}} runs {{{boss:/usr/testbed/sbin/elabinelab}}} on your behalf. |
| 83 | |
| 84 | This dumps some information from the database into {{{/proj/<YourProj>/exp/<YourId>/dbstate.tar.gz}}} |
| 85 | |
| 86 | It copies {{{boss:/usr/testbed/etc/rc.mkelab}}} to the inside users node and runs it, and then does the same for the boss, which are wrapper scripts that retrieve and install the source. |
| 87 | |
| 88 | If there is a file {{{/proj/<YourProj>/exp/<YourID>/rc.mkelab}}} it will use that one instead, which will allow you to build the next generation version without disrupting the working one. |
| 89 | |
| 90 | The standard version will similarly by default retrieve the source from {{{boss:/usr/testbed/src/emulab-src.tar.gz}}} , but if there is a file {{{/proj/<YourProj>/exp/<YourID>/emulab-src.tar.gz}}} then it will use *that* version instead. |
| 91 | |
| 92 | == Another Note == |
| 93 | The tcl that gets invoked in parsing the nsfile for the encompassing experiment is {{{users:/usr/testbed/lib/ns2ir/elabinelab.ns}}} |