| 130 | |
| 131 | When realizing the experiment, the testbed uses the containers API to configure and control the hardware and software that create the environment. |
| 132 | |
| 133 | == The Containers API == |
| 134 | |
| 135 | The containers API is responsible for allocating resources to an experiment and configuring that hardware in ways appropriate for the user's goals - realizing it. |
| 136 | |
| 137 | The key abstraction for realizing an experiment is the '''container'''. A container holds some of a physical resource's computational and networking power and uses it to create part of the experiment at a level of realism appropriate to the researcher's goals. A researcher who is interested in end-system behavior will not put very much computational power into realizing the routers that forward packets, but a lot into realizing end systems. |
| 138 | |
| 139 | The containers API coordinates: |
| 140 | |
| 141 | * Allocating the resources from the testbed's pool of resources |
| 142 | * Configuring the physcial resources to realize the experiment |
| 143 | * Partitioning the computational and networking power of each resource into appropriate realizations |
| 144 | |
| 145 | This API supports communication between the testbed control system and the containers that make up an experiment being realized (and after it is realized). |
| 146 | |
| 147 | === General Containers === |
| 148 | |
| 149 | A clear kind of container is a computer running a virtual machine monitor that partitions its CPU resources between virtual machines. This is a very useful kind of container, but not the only one. The containers interface is intended to support new forms of computer virtualization, efficient network simulation, or new kinds of physical hardware that can be part of testbeds. |
| 150 | |
| 151 | To support these goals operations that the testbed can perform on a container are ''simple'' and ''can be specialized''. In particular, the operations guaranteed to work on any container are: |
| 152 | |
| 153 | Start:: |
| 154 | Begin operating as an experiment element. (For a computer, boot; for a flux capacitor, begin travelling in time) |
| 155 | Stop:: |
| 156 | Become quiescent. Only containers API requests will work on a stopped container |
| 157 | Describe:: |
| 158 | Tell the testbed what the container's state is, extended operations the container supports, the configuration format to use, and resources allocated to it |
| 159 | Configure:: |
| 160 | Set up the container's internal state. (For a computer, establish accounts and mount filesystems; for a flux capacitor, set travel rate and destination date) |
| 161 | Clean:: |
| 162 | Undo the effects of any Configure commands |
| 163 | |
| 164 | A container can be in the following states: |
| 165 | |
| 166 | Down:: |
| 167 | The container is in communication with the testbed, but not yet configured to act as an experiment element |
| 168 | Configured:: |
| 169 | The container is set up to act as an experiment element but is not yet doing so |
| 170 | Pinned:: |
| 171 | The container is not acting as an experiment element, but is carrying out an operation that renders it otherwise unusable. For example, a container that is capturing its state may be in this state. |
| 172 | Up:: |
| 173 | The container is acting as an experiment element |
| 174 | None:: |
| 175 | Nothing is known about the container. is is (as yet) unresponsive. |
| 176 | |
| 177 | Containers report state in response to a {{{describe}}} operation and can also spontaneously report changes in state to the testbed. |
| 178 | |
| 179 | Generally a container's life cycle looks like: |
| 180 | |
| 181 | * Container starts in None state. |
| 182 | * Hardware boots, containers code begins running on the resource, when that code comes up the container is Down and reports this state to the testbed. |
| 183 | * The testbed asks the container to describe itself and sends an appropriate contfiguration request |
| 184 | * When the configuration is successful the container moves to Configured and reports it |
| 185 | * When the testbed tells the contatiner to start, it reports when it comes up and changes its state to Up. At this point, if an experiment control system like MAGI was part of the configuration, that system will take over running any experiment procedure. |
| 186 | * When the experiment (or a phase of the experiment is done) the testbed can issue a Stop to the container, which will move to Configured. |
| 187 | |