minimega.parse_experiment_graph
This MC performs all of the heavy processing for parsing the experiment graph, converting it minimega commands (via discovery), launching the experiment with minimega, and starting a VM Resource Handler for each VM. Once this MC has finished processing the experiment has effectively been launched.
- Attribute Provides:
minimega_parsed_experiment_graph
- Attribute Depends:
testbed_available
mac_addresses
ips
vm_image_details
topology
validated_vm_resource_schedule_database
- Model Component Dependencies:
Plugin
- class minimega.parse_experiment_graph_plugin.Plugin(graph, log)[source]
Bases:
AbstractPlugin
This Plugin parses the experiment graph to build necessary data structures which can be passed to Discovery. Discovery will then generate the necessary minimega commands and this Plugin will launch the experiment.
- __annotations__ = {}
- insert_vm_endpoint(vme_conf)[source]
For each VM, we will create a dictionary containing all information required to launch it. Then pass this to discovery’s
insert
endpoint. The NIC/interface information is not included as it will be handled withmake_endpoint_connections
.- Parameters:
vme_conf (dict) – The generated minimega configuration dictionary created by minimega.emulated_entities.
- Raises:
RuntimeError – If minimega tags are used and a tag name conflicts with a required configuration key.
- Returns:
The newly created endpoint in the discovery graph.
- Return type:
- make_endpoint_connections(mm_endpoint, vme_conf, switch_name_to_nid)[source]
This method informs discovery about all the connections that need to happen to launch the experiment. Due to some limitations with discovery, we are unable to add an edge between the VM and a switch containing all of the necessary information in a single discovery API call. Instead, we need to do the following:
Create an edge between the VM and the switch via discovery’s connect endpoint. This returns the updated VM endpoint, which has an empty dictionary added to its list of edges.
Create a dictionary containing the edge’s attributes. We store this dictionary in a local list so that we can update all of the edges for this VM in a single update endpoint API call.
Once all edges are initialized in the discovery graph, we update the edges contained in our VM endpoint dictionary with the ones from our local edge list. We update the edges in discovery by passing this updated VM dictionary to discovery’s update endpoint.
- Parameters:
mm_endpoint (dict) – The discovery endpoint dictionary created by
insert_vm_endpoint
.vme_conf (dict) – The generated minimega configuration dictionary created by minimega.emulated_entities.
switch_name_to_nid (dict) – A dictionary of network IDs which are used by discovery.
- Returns:
The newly updated endpoint in the discovery graph.
- Return type:
- run()[source]
This method contains the primary logic to launch an experiment. It has several objectives:
Add all VMs and connections to Discovery’s graph.
Invoke discovery to output this data as minimega commands via the
minemiter
command. See the Discovery source code for more information about minemiter.Have minimega read the output to launch the VMs.
Finish setting up the control network (if any exists).
Launch a VM Resource Handler for each VM using minimega to start the process.