Changes between Initial Version and Version 1 of UsingContainers


Ignore:
Timestamp:
Jun 17, 2012 5:13:24 PM (12 years ago)
Author:
Ted Faber
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • UsingContainers

    v1 v1  
     1[[TOC]]
     2
     3= Using Containers =
     4
     5A containerized virtualization system currently runs on the DETER testbed.
     6
     7We support two types of experiments: qemu auto-partitioned and mixed mode. Nodes in a qemu auto-partitioned experiment are realized as either qemu virtual machines or physical nodes. The qemu nodes are automatically packed into physical nodes based on a packing parameter. Nodes in a mixed mode experiment may be qemu virtual nodes, lightweight processes, or physical machines. All non-physical nodes must be embedded manually.
     8
     9== Disclaimer ==
     10
     11Note that this software is currently in a '''beta''' state. We have made every effort to make the system as stable as possible, but it has not been heavily used. Expect to run into bugs.
     12
     13If and when you do encounter a bug you can either [/newticket file a ticket] or email the author directly at mikeryan@ISI.EDU.
     14
     15== How it works ==
     16
     17The container system is built on the legacy DETER functionality. This means that a containerized experiment appears to the DETER testbed and web interface as a typical experiment. The NS file for the host experiment is annotated with a variety of container-related commands.
     18
     19You will interact with your containerized experiment through facilities provided by DETER. The swap in/out process is controlled by the DETER web interface, and you will access your virtual nodes like any other node from {{{users.isi.deterlab.net}}}.
     20
     21== Getting Started ==
     22
     23=== Prerequisites ===
     24
     25Prepare your NS or TopDL file as you would for any other DETER experiment.
     26
     27Before running your experiment you should determine the DETER PID and EID under which you'll run the experiment. The EID should not refer to an existing experiment.
     28
     29=== qemu auto-partitioned experiments ===
     30
     31You will need to specify a parameter called "packing". This parameter describes how many qemu virtual nodes will be embedded on each physical node. The host machines have four cores each, so for compute-bound tasks this value should not be higher than 4. For less CPU-intensive tasks we find a factor of 10 to provide adequate performance. This number can in theory be as high as 10 or 20 (perhaps higher).
     32
     33If you wish for some of your nodes to be realized as physical machines, you must use a TopDL file (not NS) and tag the nodes as physical. Add the attribute {{{benito:node_type = embedded_pnode}}} to any such nodes. See UsingShopdl for documentation on a tool to do this.
     34
     35Once you have determined the parameters described above, you may start an experiment by logging in to {{{users.isi.deterlab.net}}} and running these commands:
     36
     37{{{
     38$ cd /share/benito
     39$ ./qemu_experiment.py <PID> <EID> <ns-or-topdl-file> <packing>
     40}}}
     41
     42=== Mixed mode experiments ===
     43
     44Mixed mode experiments may only be specified using a TopDL file. Each node must be specially annotated to incdicate its embedding. This is done by specifying an attribute on the node called {{{partition}}}.
     45
     46The {{{partition}}} attribute specifies the physical node on which a qemu virtual node is realized. This value must be numeric, though there are no restrictions on what numbers are used.
     47
     48If a node ''lacks'' the {{{partition}}} attribute, it is assumed to be a physical node.
     49
     50You can use the {{{shopdl.py}}} tool in the {{{util}}} subdirectory of the tree in order to ease manipulation of your TopDL file. See UsingShopdl for more information.
     51
     52Once you have annotated your TopDL file, you may start an experiment by logging in to {{{users.isi.deterlab.net}}} and running these commands:
     53
     54{{{
     55$ cd /share/benito
     56$ ./mixed_experiment.py <PID> <EID> <topdl-file>
     57}}}
     58
     59=== Creation ===
     60
     61Upon successful creation, you will be presented with a URL for accessing your experiment via the web interface.
     62
     63It takes 1-2 minutes for DETER to create the experiment. The creation process has successfully completed once DETER reports "Status: swapped".
     64
     65== Swapping ==
     66
     67=== Swapping in ===
     68
     69Swap in the DETER experiment like any other: click the "Swap Experiment In" link on the left side of the experiment page.
     70
     71From DETER's perspective, the swap in process should complete in 3-5 minutes, at which point you will be notified "Experiment successfully swapped in".
     72
     73After this, it takes another 3-5 minutes to set up the physical nodes and launch the virtual nodes. This process is complete when the "Startup Status" for each node is reported as 0 or 1.
     74
     75If the startup status is 1, there was an error setting up the physical node as a virtual host. Please let me know if this happens and I can see what caused the problem. You can always try to swap in and out to see if the problem resolves itself.
     76
     77=== Swapping out ===
     78
     79Swap the experiment out like any other.
     80
     81=== Modifying the experiment ===
     82
     83We do not currently support any form of experiment modification. If you wish to modify your experiment, you must terminate the DETER experiment (not just swap out, but properly terminate) and then start a new containerized experiment using the process outlined above.
     84
     85== Accessing Nodes ==
     86
     87Nodes are accessed similarly to other DETER nodes. When you are on users, you can access a node named 'node-1' in YourPID/SomeEID using SSH:
     88
     89{{{
     90users$ ssh node-1.someeid.yourpid
     91node-1$ echo hello from qemu
     92hello from qemu
     93}}}
     94
     95'''Note:''' This does not yet work with physical nodes in mixed-mode experiments. Sorry!
     96
     97From within the experiment you can communicate with other nodes in the experiment using just the hostname, as in an ordinary DETER experiment:
     98
     99{{{
     100node-1$ ping node-2
     101PING node-2-big-lan (10.0.0.32) 56(84) bytes of data.
     10264 bytes from node-2-big-lan (10.0.0.32): icmp_req=1 ttl=64 time=8.01 ms
     10364 bytes from node-2-big-lan (10.0.0.32): icmp_req=2 ttl=64 time=10.6 ms
     104^C
     105--- node-2-big-lan ping statistics ---
     1062 packets transmitted, 2 received, 0% packet loss, time 1001ms
     107rtt min/avg/max/mdev = 8.015/9.318/10.622/1.307 ms
     108}}}
     109
     110=== Node list ===
     111
     112The {{{node_list}}} command takes an extra flag {{{-e}}} or {{{--extra}}} to list extra nodes from your experiments. Use it like so:
     113
     114{{{
     115users$ node_list --extra
     116YourPID/some-experiment
     117    pnode-0001.some-experiment.YourPID / pc003
     118    pnode-0000.some-experiment.YourPID / pc038
     119  extra nodes:
     120    node-1.some-experiment.YourPID
     121    node-2.some-experiment.YourPID
     122    node-3.some-experiment.YourPID
     123    node-4.some-experiment.YourPID
     124    node-5.some-experiment.YourPID
     125    node-5.some-experiment.YourPID
     126}}}
     127
     128This makes use of the {{{experiment.extra_nodes}}} XML-RPC method. This method takes two arguments: proj and exp, which are PID and EID respectively.
     129
     130=== Start commands ===
     131
     132Start commands are similar to Emulab start commands, with a few notable exceptions:
     133
     134 * start commands inside containers are run at each boot, instead of just once
     135 * there is no way to report the exit status of a start command (yet)
     136
     137You can see the exit status and output of a start command by logging into a node and looking in {{{/var/benito/log/start_command.*}}}. There should be 3 files:
     138
     139 * {{{start_command.log}}}: general info, including exit status
     140 * {{{start_command.out}}}: stdout from the start command
     141 * {{{start_command.err}}}: stderr
     142
     143== Node Status ==
     144
     145There is a line-based RPC mechanism for query node status. A web interface for this is in active development.
     146
     147Commands are in the format: {{{command arg1 [arg2 ...]}}}
     148
     149Replies are in the format: {{{reply_type python-eval'able-string}}}
     150
     151As an example, here is a status request and reply (reply line-wrapped for readability):
     152
     153{{{
     154status_request DeterTest/ratsnest-medium   
     155status_reply {'hv:qemu:pnode-0000': {'cnode17': [None, None], 'cnode20': [None,
     156None], 'cnode8': [None, None]}, 'hv:qemu:pnode-0010': {'lnode6': [None, None],
     157'lnode7': [None, None]}, 'hv:qemu:pnode-0005': {'lnode11': [None, None],
     158'lnode12': [None, None], 'lnode13': [None, None]}, 'hv:qemu:pnode-0004':
     159{'lnode4': [None, None], 'lnode1': [None, None]}, 'hv:qemu:pnode-0007':
     160{'cnode16': [None, None], 'cnode15': [None, None], 'cnode19': [None, None]},
     161'hv:qemu:pnode-0008': {'cnode14': [None, None], 'cnode9': [None, None],
     162'cnode18': [None, None]}}
     163}}}
     164
     165Example Python code for parsing the reply:
     166
     167{{{
     168from ast import literal_eval
     169type, body = line.split(' ', 1)
     170message = literal_eval(body)
     171}}}
     172
     173=== Reply format ===
     174
     175Reply bodies take the form of a dict of dicts. The key of the first level of dicts is the hypervisor name. The key of the second level is node name. Each node name is a two-item array. The first element is boot status and the second element is start command exit code or qemu process exit code (if dead). Both of these will be None if the hv is unreachable.
     176
     177Possible boot status:
     178
     179 * {{{running}}} - qemu has been started but the OS has not booted
     180 * {{{booted}}} - the inner OS has fully booted
     181 * {{{dead}}} - qemu process has died
     182
     183=== Caveat ===
     184
     185'''Note:''' Node status is only available for qemu virtual nodes. If your experiment is mixed mode, there is no status available for pnodes. The only way to query their status is from DETER. If they've booted and their exit code is 0, then they are running.
     186
     187== What's Missing ==
     188
     189The following is a list of missing features that will probably cause you some pain and suffering. Actually implementing these features is my highest priority task at the moment, so please bear with me for the time being.
     190
     191 * Accessing physical nodes via hostname from {{{users}}}
     192 * Ability to choose a different OS than Ubuntu 10.10 (Maverick)
     193 * Ability to install software using apt on Ubuntu (and any other OS)