Python API¶
The Python bindings are generated from the same minimega command definitions as the command API.
minimega
¶
Copyright 2015-2023 National Technology & Engineering Solutions of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S. Government retains certain rights in this software.
minimega dev team minimega-dev@sandia.gov
minimega bindings for Python
- THIS FILE IS AUTOMATICALLY GENERATED. DO NOT MODIFY THIS FILE BY HAND. *
This API uses a UNIX domain socket to communicate with a running instance of minimega. The protocol is documented here, under "Command Port and the Local Command Flag":
https://sandia-minimega.github.io/minimega/articles/usage/#command-port-and-the-local-command-flag
This file is automatically generated from the output of "minimega -cli". See "doc.bash" for details on how to regenerate this file using pyapigen.
This API should work for both python2.7 and python3. Please report any issues to the bug tracker:
https://github.com/sandia-minimega/minimega/v2/issues
minimega
¶
Bases: object
This class communicates with a running instance of minimega using a UNIX domain socket.
Each minimega command can be called from this object, and the response will be returned unless an Exception is thrown.
__init__(path, raise_errors, debug, namespace)
¶
Connects to the minimega instance with UNIX socket at
args()
¶
Variants: args
Displays the CLI arguments minimega is using to run. If an argument was not set by CLI, the default value is displayed.
background(command)
¶
Variants:
background
Execute a command under the credentials of the running user.
Commands run in the background and control returns immediately. Any output is logged at the "info" level.
background_error(id)
¶
Variants:
background-error
Get the standard error of a background command.
background-error <id>
background_output(id)
¶
Variants:
background-output
Get the standard output of a background command.
background-output <id>
background_status(id=None)
¶
Variants:
background-status
Get the status of a background command / commands.
To get the status of all background commands run
background-status
To get the status of a specific command, run
background-status [id]
bridge()
¶
Variants: bridge
When called with no arguments, display information about all managed bridges.
To add a trunk interface to a specific bridge, use 'bridge trunk'. For example, to add interface bar to bridge foo:
bridge trunk foo bar
To create a vxlan or GRE tunnel to another bridge, use 'bridge tunnel'. For example, to create a vxlan tunnel to another bridge with IP 10.0.0.1:
bridge tunnel vxlan mega_bridge 10.0.0.1
Note: bridge is not a namespace-aware command.
bridge_config(bridge, config)
¶
Variants:
bridge config
When called with no arguments, display information about all managed bridges.
To add a trunk interface to a specific bridge, use 'bridge trunk'. For example, to add interface bar to bridge foo:
bridge trunk foo bar
To create a vxlan or GRE tunnel to another bridge, use 'bridge tunnel'. For example, to create a vxlan tunnel to another bridge with IP 10.0.0.1:
bridge tunnel vxlan mega_bridge 10.0.0.1
Note: bridge is not a namespace-aware command.
bridge_destroy(bridge)
¶
Variants:
bridge destroy
When called with no arguments, display information about all managed bridges.
To add a trunk interface to a specific bridge, use 'bridge trunk'. For example, to add interface bar to bridge foo:
bridge trunk foo bar
To create a vxlan or GRE tunnel to another bridge, use 'bridge tunnel'. For example, to create a vxlan tunnel to another bridge with IP 10.0.0.1:
bridge tunnel vxlan mega_bridge 10.0.0.1
Note: bridge is not a namespace-aware command.
bridge_notrunk(bridge, interface)
¶
Variants:
bridge notrunk
When called with no arguments, display information about all managed bridges.
To add a trunk interface to a specific bridge, use 'bridge trunk'. For example, to add interface bar to bridge foo:
bridge trunk foo bar
To create a vxlan or GRE tunnel to another bridge, use 'bridge tunnel'. For example, to create a vxlan tunnel to another bridge with IP 10.0.0.1:
bridge tunnel vxlan mega_bridge 10.0.0.1
Note: bridge is not a namespace-aware command.
bridge_notunnel(bridge, interface)
¶
Variants:
bridge notunnel
When called with no arguments, display information about all managed bridges.
To add a trunk interface to a specific bridge, use 'bridge trunk'. For example, to add interface bar to bridge foo:
bridge trunk foo bar
To create a vxlan or GRE tunnel to another bridge, use 'bridge tunnel'. For example, to create a vxlan tunnel to another bridge with IP 10.0.0.1:
bridge tunnel vxlan mega_bridge 10.0.0.1
Note: bridge is not a namespace-aware command.
bridge_trunk(bridge, interface)
¶
Variants:
bridge trunk
When called with no arguments, display information about all managed bridges.
To add a trunk interface to a specific bridge, use 'bridge trunk'. For example, to add interface bar to bridge foo:
bridge trunk foo bar
To create a vxlan or GRE tunnel to another bridge, use 'bridge tunnel'. For example, to create a vxlan tunnel to another bridge with IP 10.0.0.1:
bridge tunnel vxlan mega_bridge 10.0.0.1
Note: bridge is not a namespace-aware command.
bridge_tunnel(vxlan_or_gre, bridge, remote, key=None)
¶
Variants:
bridge tunnel
When called with no arguments, display information about all managed bridges.
To add a trunk interface to a specific bridge, use 'bridge trunk'. For example, to add interface bar to bridge foo:
bridge trunk foo bar
To create a vxlan or GRE tunnel to another bridge, use 'bridge tunnel'. For example, to create a vxlan tunnel to another bridge with IP 10.0.0.1:
bridge tunnel vxlan mega_bridge 10.0.0.1
Note: bridge is not a namespace-aware command.
capture()
¶
Variants: capture
show active captures
capture_netflow_bridge(bridge, filename=None, tcp_or_udp=None, hostname_port=None)
¶
Variants:
capture netflow bridge
Note: the capture API is not fully namespace-aware and should be used with caution. See notes below.
Capture experiment data including netflow and PCAP. Netflow capture obtains netflow data from any local openvswitch switch, and can write to file, another socket, or both. Netflow data can be written out in raw or ascii format, and file output can be compressed on the fly. Multiple netflow writers can be configured. There are several APIs to configure new netflow captures:
capture netflow mode [raw,ascii]
capture netflow gzip [true,false]
capture netflow timeout [timeout]
PCAP capture can be from a bridge or VM interface. To set the snaplen or filter for new PCAP captures, use:
capture pcap snaplen <size>
capture pcap filter <bpf>
Examples:
# Capture netflow for mega_bridge to foo.netflow
capture netflow bridge mega_bridge foo.netflow
# Capture all bridge foo traffic to foo.pcap
capture pcap bridge foo foo.pcap
# Capture the 0-th interface for VM foo to foo.pcap
capture pcap vm foo 0 foo.pcap
When run without arguments, capture prints all running captures. To stop a capture, use the delete commands:
capture netflow delete bridge <bridge>
capture pcap delete bridge <bridge>
capture pcap delete vm <name>
capture pcap delete vm <name> <interface index>
To stop all captures of a particular kind, replace
Notes with namespaces: * Capturing traffic directly from the bridge (as PCAP or netflow) is not recommended if different namespaces share the same bridge. If this is the case, the captured traffic would contain data from across namespaces. * Due to the way Open vSwitch implements netflow, there can be only one netflow object per bridge. This means that the netflow timeout is shared across namespaces. Additionally, note that the API is also not bridge-specific.
Due to the above intricacies, the following commands only run on the local minimega instance:
capture <netflow,> <bridge,> <bridge> <filename>
capture <netflow,> <bridge,> <bridge> <tcp,udp> <hostname:port>
capture <netflow,> <delete,> bridge <name>
capture <netflow,> <timeout,> [timeout in seconds]
capture <pcap,> bridge <bridge> <filename>
capture <pcap,> <delete,> bridge <name>
capture_netflow_delete_bridge(bridge)
¶
Variants:
capture netflow delete bridge
Note: the capture API is not fully namespace-aware and should be used with caution. See notes below.
Capture experiment data including netflow and PCAP. Netflow capture obtains netflow data from any local openvswitch switch, and can write to file, another socket, or both. Netflow data can be written out in raw or ascii format, and file output can be compressed on the fly. Multiple netflow writers can be configured. There are several APIs to configure new netflow captures:
capture netflow mode [raw,ascii]
capture netflow gzip [true,false]
capture netflow timeout [timeout]
PCAP capture can be from a bridge or VM interface. To set the snaplen or filter for new PCAP captures, use:
capture pcap snaplen <size>
capture pcap filter <bpf>
Examples:
# Capture netflow for mega_bridge to foo.netflow
capture netflow bridge mega_bridge foo.netflow
# Capture all bridge foo traffic to foo.pcap
capture pcap bridge foo foo.pcap
# Capture the 0-th interface for VM foo to foo.pcap
capture pcap vm foo 0 foo.pcap
When run without arguments, capture prints all running captures. To stop a capture, use the delete commands:
capture netflow delete bridge <bridge>
capture pcap delete bridge <bridge>
capture pcap delete vm <name>
capture pcap delete vm <name> <interface index>
To stop all captures of a particular kind, replace
Notes with namespaces: * Capturing traffic directly from the bridge (as PCAP or netflow) is not recommended if different namespaces share the same bridge. If this is the case, the captured traffic would contain data from across namespaces. * Due to the way Open vSwitch implements netflow, there can be only one netflow object per bridge. This means that the netflow timeout is shared across namespaces. Additionally, note that the API is also not bridge-specific.
Due to the above intricacies, the following commands only run on the local minimega instance:
capture <netflow,> <bridge,> <bridge> <filename>
capture <netflow,> <bridge,> <bridge> <tcp,udp> <hostname:port>
capture <netflow,> <delete,> bridge <name>
capture <netflow,> <timeout,> [timeout in seconds]
capture <pcap,> bridge <bridge> <filename>
capture <pcap,> <delete,> bridge <name>
capture_netflow_gzip(true_or_false=None)
¶
Variants:
capture netflow gzip
configure captures
capture_netflow_mode(raw_or_ascii=None)
¶
Variants:
capture netflow mode
configure captures
capture_netflow_timeout(timeout=None)
¶
Variants:
capture netflow timeout
Note: the capture API is not fully namespace-aware and should be used with caution. See notes below.
Capture experiment data including netflow and PCAP. Netflow capture obtains netflow data from any local openvswitch switch, and can write to file, another socket, or both. Netflow data can be written out in raw or ascii format, and file output can be compressed on the fly. Multiple netflow writers can be configured. There are several APIs to configure new netflow captures:
capture netflow mode [raw,ascii]
capture netflow gzip [true,false]
capture netflow timeout [timeout]
PCAP capture can be from a bridge or VM interface. To set the snaplen or filter for new PCAP captures, use:
capture pcap snaplen <size>
capture pcap filter <bpf>
Examples:
# Capture netflow for mega_bridge to foo.netflow
capture netflow bridge mega_bridge foo.netflow
# Capture all bridge foo traffic to foo.pcap
capture pcap bridge foo foo.pcap
# Capture the 0-th interface for VM foo to foo.pcap
capture pcap vm foo 0 foo.pcap
When run without arguments, capture prints all running captures. To stop a capture, use the delete commands:
capture netflow delete bridge <bridge>
capture pcap delete bridge <bridge>
capture pcap delete vm <name>
capture pcap delete vm <name> <interface index>
To stop all captures of a particular kind, replace
Notes with namespaces: * Capturing traffic directly from the bridge (as PCAP or netflow) is not recommended if different namespaces share the same bridge. If this is the case, the captured traffic would contain data from across namespaces. * Due to the way Open vSwitch implements netflow, there can be only one netflow object per bridge. This means that the netflow timeout is shared across namespaces. Additionally, note that the API is also not bridge-specific.
Due to the above intricacies, the following commands only run on the local minimega instance:
capture <netflow,> <bridge,> <bridge> <filename>
capture <netflow,> <bridge,> <bridge> <tcp,udp> <hostname:port>
capture <netflow,> <delete,> bridge <name>
capture <netflow,> <timeout,> [timeout in seconds]
capture <pcap,> bridge <bridge> <filename>
capture <pcap,> <delete,> bridge <name>
capture_pcap_bridge(bridge, filename)
¶
Variants:
capture pcap bridge
Note: the capture API is not fully namespace-aware and should be used with caution. See notes below.
Capture experiment data including netflow and PCAP. Netflow capture obtains netflow data from any local openvswitch switch, and can write to file, another socket, or both. Netflow data can be written out in raw or ascii format, and file output can be compressed on the fly. Multiple netflow writers can be configured. There are several APIs to configure new netflow captures:
capture netflow mode [raw,ascii]
capture netflow gzip [true,false]
capture netflow timeout [timeout]
PCAP capture can be from a bridge or VM interface. To set the snaplen or filter for new PCAP captures, use:
capture pcap snaplen <size>
capture pcap filter <bpf>
Examples:
# Capture netflow for mega_bridge to foo.netflow
capture netflow bridge mega_bridge foo.netflow
# Capture all bridge foo traffic to foo.pcap
capture pcap bridge foo foo.pcap
# Capture the 0-th interface for VM foo to foo.pcap
capture pcap vm foo 0 foo.pcap
When run without arguments, capture prints all running captures. To stop a capture, use the delete commands:
capture netflow delete bridge <bridge>
capture pcap delete bridge <bridge>
capture pcap delete vm <name>
capture pcap delete vm <name> <interface index>
To stop all captures of a particular kind, replace
Notes with namespaces: * Capturing traffic directly from the bridge (as PCAP or netflow) is not recommended if different namespaces share the same bridge. If this is the case, the captured traffic would contain data from across namespaces. * Due to the way Open vSwitch implements netflow, there can be only one netflow object per bridge. This means that the netflow timeout is shared across namespaces. Additionally, note that the API is also not bridge-specific.
Due to the above intricacies, the following commands only run on the local minimega instance:
capture <netflow,> <bridge,> <bridge> <filename>
capture <netflow,> <bridge,> <bridge> <tcp,udp> <hostname:port>
capture <netflow,> <delete,> bridge <name>
capture <netflow,> <timeout,> [timeout in seconds]
capture <pcap,> bridge <bridge> <filename>
capture <pcap,> <delete,> bridge <name>
capture_pcap_delete_bridge(bridge)
¶
Variants:
capture pcap delete bridge
Note: the capture API is not fully namespace-aware and should be used with caution. See notes below.
Capture experiment data including netflow and PCAP. Netflow capture obtains netflow data from any local openvswitch switch, and can write to file, another socket, or both. Netflow data can be written out in raw or ascii format, and file output can be compressed on the fly. Multiple netflow writers can be configured. There are several APIs to configure new netflow captures:
capture netflow mode [raw,ascii]
capture netflow gzip [true,false]
capture netflow timeout [timeout]
PCAP capture can be from a bridge or VM interface. To set the snaplen or filter for new PCAP captures, use:
capture pcap snaplen <size>
capture pcap filter <bpf>
Examples:
# Capture netflow for mega_bridge to foo.netflow
capture netflow bridge mega_bridge foo.netflow
# Capture all bridge foo traffic to foo.pcap
capture pcap bridge foo foo.pcap
# Capture the 0-th interface for VM foo to foo.pcap
capture pcap vm foo 0 foo.pcap
When run without arguments, capture prints all running captures. To stop a capture, use the delete commands:
capture netflow delete bridge <bridge>
capture pcap delete bridge <bridge>
capture pcap delete vm <name>
capture pcap delete vm <name> <interface index>
To stop all captures of a particular kind, replace
Notes with namespaces: * Capturing traffic directly from the bridge (as PCAP or netflow) is not recommended if different namespaces share the same bridge. If this is the case, the captured traffic would contain data from across namespaces. * Due to the way Open vSwitch implements netflow, there can be only one netflow object per bridge. This means that the netflow timeout is shared across namespaces. Additionally, note that the API is also not bridge-specific.
Due to the above intricacies, the following commands only run on the local minimega instance:
capture <netflow,> <bridge,> <bridge> <filename>
capture <netflow,> <bridge,> <bridge> <tcp,udp> <hostname:port>
capture <netflow,> <delete,> bridge <name>
capture <netflow,> <timeout,> [timeout in seconds]
capture <pcap,> bridge <bridge> <filename>
capture <pcap,> <delete,> bridge <name>
capture_pcap_delete_vm(vm, interface=None)
¶
Variants:
capture pcap delete vm
capture experiment data for a VM
capture_pcap_filter(bpf=None)
¶
Variants:
capture pcap filter
configure captures
capture_pcap_snaplen(size=None)
¶
Variants:
capture pcap snaplen
configure captures
capture_pcap_vm(vm, interface, filename)
¶
Variants:
capture pcap vm
capture experiment data for a VM
cc()
¶
Variants: cc
Command and control for VMs running the miniccc client. Commands may include regular commands, backgrounded commands, and any number of sent and/or received files. Commands will be executed in command creation order. For example, to send a file 'foo' and display the contents on a remote VM:
cc send foo
cc exec cat foo
Files to be sent must be in the filepath directory, as set by the -filepath flag when launching minimega.
Executed commands can have their stdio tied to pipes used by the plumb and pipe APIs. To use named pipes, simply specify stdin, stdout, or stderr as a key=value pair. For example:
cc exec stderr=foo cat server.log
cc background stdin=foo stdout=bar /usr/bin/program
Executed commands can also be marked to be sent to miniccc clients only once. This will prevent the command from being sent again if the client restarts (for example, after a reboot).
cc exec-once shutdown -r now
Responses are organized in a structure within
Responses to executed commands (not backgrounded) will include the command's exit code, which can be displayed with the 'exitcode' command.
Filters may be set to limit which clients may execute a posted command. For example, to filter on VMs that are running windows and have a specific IP.
cc filter os=windows ip=10.0.0.1
Users can also filter by VM tags. For example, to filter on VMs that have the tag with key foo and value bar set:
cc filter tag=foo:bar
If users wish, they may drop the tag= prefix and key=value pairs will be treated as tags:
cc filter foo=bar
Users can also filter by any column in "vm info" using a similar syntax:
cc filter name=server
cc filter vlan=DMZ
"vm info" columns take precedence over tags when both define the same key.
"cc mount" allows direct access to a guest's filesystem over the command and
control connection. When given a VM uuid or name and a path, the VM's
filesystem is mounted to the local machine at the provided path. "cc mount"
without arguments displays the existing mounts. Users can use "clear cc mount"
to unmount the filesystem of one or all VMs. This should be done before killing
or stopping the VM ("clear namespace
"cc tunnel" allows users to tunnel TCP connections to a local port through a VM to a remote port. The local port will be created on the minimega cluster host that the tunneling VM is running on. The remote port can be on the same VM or on a different VM the tunneling VM has network access to.
"cc test-conn" allows users to test network connectivity from a guest to the given IP or domain name and port. The wait timeout should be specified as a Go duration string (e.g. 5s, 1m). If "udp" is used, a "base64 udp packet" that will generate a valid response must be specified. Results of the test will be written to the command's STDOUT file, whether it passed or failed. An example test is as follows:
cc test-conn tcp 10.0.0.68 443 wait 10s
If the above test passes, STDOUT for the command will contain the following:
10.0.0.68:443 | pass
If it fails, STDOUT will instead contain the following:
10.0.0.68:443 | fail
For more documentation, see the article "Command and Control API Tutorial".
cc_background(command)
¶
Variants:
cc background
Command and control for VMs running the miniccc client. Commands may include regular commands, backgrounded commands, and any number of sent and/or received files. Commands will be executed in command creation order. For example, to send a file 'foo' and display the contents on a remote VM:
cc send foo
cc exec cat foo
Files to be sent must be in the filepath directory, as set by the -filepath flag when launching minimega.
Executed commands can have their stdio tied to pipes used by the plumb and pipe APIs. To use named pipes, simply specify stdin, stdout, or stderr as a key=value pair. For example:
cc exec stderr=foo cat server.log
cc background stdin=foo stdout=bar /usr/bin/program
Executed commands can also be marked to be sent to miniccc clients only once. This will prevent the command from being sent again if the client restarts (for example, after a reboot).
cc exec-once shutdown -r now
Responses are organized in a structure within
Responses to executed commands (not backgrounded) will include the command's exit code, which can be displayed with the 'exitcode' command.
Filters may be set to limit which clients may execute a posted command. For example, to filter on VMs that are running windows and have a specific IP.
cc filter os=windows ip=10.0.0.1
Users can also filter by VM tags. For example, to filter on VMs that have the tag with key foo and value bar set:
cc filter tag=foo:bar
If users wish, they may drop the tag= prefix and key=value pairs will be treated as tags:
cc filter foo=bar
Users can also filter by any column in "vm info" using a similar syntax:
cc filter name=server
cc filter vlan=DMZ
"vm info" columns take precedence over tags when both define the same key.
"cc mount" allows direct access to a guest's filesystem over the command and
control connection. When given a VM uuid or name and a path, the VM's
filesystem is mounted to the local machine at the provided path. "cc mount"
without arguments displays the existing mounts. Users can use "clear cc mount"
to unmount the filesystem of one or all VMs. This should be done before killing
or stopping the VM ("clear namespace
"cc tunnel" allows users to tunnel TCP connections to a local port through a VM to a remote port. The local port will be created on the minimega cluster host that the tunneling VM is running on. The remote port can be on the same VM or on a different VM the tunneling VM has network access to.
"cc test-conn" allows users to test network connectivity from a guest to the given IP or domain name and port. The wait timeout should be specified as a Go duration string (e.g. 5s, 1m). If "udp" is used, a "base64 udp packet" that will generate a valid response must be specified. Results of the test will be written to the command's STDOUT file, whether it passed or failed. An example test is as follows:
cc test-conn tcp 10.0.0.68 443 wait 10s
If the above test passes, STDOUT for the command will contain the following:
10.0.0.68:443 | pass
If it fails, STDOUT will instead contain the following:
10.0.0.68:443 | fail
For more documentation, see the article "Command and Control API Tutorial".
cc_background_once(command)
¶
Variants:
cc background-once
Command and control for VMs running the miniccc client. Commands may include regular commands, backgrounded commands, and any number of sent and/or received files. Commands will be executed in command creation order. For example, to send a file 'foo' and display the contents on a remote VM:
cc send foo
cc exec cat foo
Files to be sent must be in the filepath directory, as set by the -filepath flag when launching minimega.
Executed commands can have their stdio tied to pipes used by the plumb and pipe APIs. To use named pipes, simply specify stdin, stdout, or stderr as a key=value pair. For example:
cc exec stderr=foo cat server.log
cc background stdin=foo stdout=bar /usr/bin/program
Executed commands can also be marked to be sent to miniccc clients only once. This will prevent the command from being sent again if the client restarts (for example, after a reboot).
cc exec-once shutdown -r now
Responses are organized in a structure within
Responses to executed commands (not backgrounded) will include the command's exit code, which can be displayed with the 'exitcode' command.
Filters may be set to limit which clients may execute a posted command. For example, to filter on VMs that are running windows and have a specific IP.
cc filter os=windows ip=10.0.0.1
Users can also filter by VM tags. For example, to filter on VMs that have the tag with key foo and value bar set:
cc filter tag=foo:bar
If users wish, they may drop the tag= prefix and key=value pairs will be treated as tags:
cc filter foo=bar
Users can also filter by any column in "vm info" using a similar syntax:
cc filter name=server
cc filter vlan=DMZ
"vm info" columns take precedence over tags when both define the same key.
"cc mount" allows direct access to a guest's filesystem over the command and
control connection. When given a VM uuid or name and a path, the VM's
filesystem is mounted to the local machine at the provided path. "cc mount"
without arguments displays the existing mounts. Users can use "clear cc mount"
to unmount the filesystem of one or all VMs. This should be done before killing
or stopping the VM ("clear namespace
"cc tunnel" allows users to tunnel TCP connections to a local port through a VM to a remote port. The local port will be created on the minimega cluster host that the tunneling VM is running on. The remote port can be on the same VM or on a different VM the tunneling VM has network access to.
"cc test-conn" allows users to test network connectivity from a guest to the given IP or domain name and port. The wait timeout should be specified as a Go duration string (e.g. 5s, 1m). If "udp" is used, a "base64 udp packet" that will generate a valid response must be specified. Results of the test will be written to the command's STDOUT file, whether it passed or failed. An example test is as follows:
cc test-conn tcp 10.0.0.68 443 wait 10s
If the above test passes, STDOUT for the command will contain the following:
10.0.0.68:443 | pass
If it fails, STDOUT will instead contain the following:
10.0.0.68:443 | fail
For more documentation, see the article "Command and Control API Tutorial".
cc_clients()
¶
Variants: cc clients
Command and control for VMs running the miniccc client. Commands may include regular commands, backgrounded commands, and any number of sent and/or received files. Commands will be executed in command creation order. For example, to send a file 'foo' and display the contents on a remote VM:
cc send foo
cc exec cat foo
Files to be sent must be in the filepath directory, as set by the -filepath flag when launching minimega.
Executed commands can have their stdio tied to pipes used by the plumb and pipe APIs. To use named pipes, simply specify stdin, stdout, or stderr as a key=value pair. For example:
cc exec stderr=foo cat server.log
cc background stdin=foo stdout=bar /usr/bin/program
Executed commands can also be marked to be sent to miniccc clients only once. This will prevent the command from being sent again if the client restarts (for example, after a reboot).
cc exec-once shutdown -r now
Responses are organized in a structure within
Responses to executed commands (not backgrounded) will include the command's exit code, which can be displayed with the 'exitcode' command.
Filters may be set to limit which clients may execute a posted command. For example, to filter on VMs that are running windows and have a specific IP.
cc filter os=windows ip=10.0.0.1
Users can also filter by VM tags. For example, to filter on VMs that have the tag with key foo and value bar set:
cc filter tag=foo:bar
If users wish, they may drop the tag= prefix and key=value pairs will be treated as tags:
cc filter foo=bar
Users can also filter by any column in "vm info" using a similar syntax:
cc filter name=server
cc filter vlan=DMZ
"vm info" columns take precedence over tags when both define the same key.
"cc mount" allows direct access to a guest's filesystem over the command and
control connection. When given a VM uuid or name and a path, the VM's
filesystem is mounted to the local machine at the provided path. "cc mount"
without arguments displays the existing mounts. Users can use "clear cc mount"
to unmount the filesystem of one or all VMs. This should be done before killing
or stopping the VM ("clear namespace
"cc tunnel" allows users to tunnel TCP connections to a local port through a VM to a remote port. The local port will be created on the minimega cluster host that the tunneling VM is running on. The remote port can be on the same VM or on a different VM the tunneling VM has network access to.
"cc test-conn" allows users to test network connectivity from a guest to the given IP or domain name and port. The wait timeout should be specified as a Go duration string (e.g. 5s, 1m). If "udp" is used, a "base64 udp packet" that will generate a valid response must be specified. Results of the test will be written to the command's STDOUT file, whether it passed or failed. An example test is as follows:
cc test-conn tcp 10.0.0.68 443 wait 10s
If the above test passes, STDOUT for the command will contain the following:
10.0.0.68:443 | pass
If it fails, STDOUT will instead contain the following:
10.0.0.68:443 | fail
For more documentation, see the article "Command and Control API Tutorial".
cc_commands()
¶
Variants: cc commands
Command and control for VMs running the miniccc client. Commands may include regular commands, backgrounded commands, and any number of sent and/or received files. Commands will be executed in command creation order. For example, to send a file 'foo' and display the contents on a remote VM:
cc send foo
cc exec cat foo
Files to be sent must be in the filepath directory, as set by the -filepath flag when launching minimega.
Executed commands can have their stdio tied to pipes used by the plumb and pipe APIs. To use named pipes, simply specify stdin, stdout, or stderr as a key=value pair. For example:
cc exec stderr=foo cat server.log
cc background stdin=foo stdout=bar /usr/bin/program
Executed commands can also be marked to be sent to miniccc clients only once. This will prevent the command from being sent again if the client restarts (for example, after a reboot).
cc exec-once shutdown -r now
Responses are organized in a structure within
Responses to executed commands (not backgrounded) will include the command's exit code, which can be displayed with the 'exitcode' command.
Filters may be set to limit which clients may execute a posted command. For example, to filter on VMs that are running windows and have a specific IP.
cc filter os=windows ip=10.0.0.1
Users can also filter by VM tags. For example, to filter on VMs that have the tag with key foo and value bar set:
cc filter tag=foo:bar
If users wish, they may drop the tag= prefix and key=value pairs will be treated as tags:
cc filter foo=bar
Users can also filter by any column in "vm info" using a similar syntax:
cc filter name=server
cc filter vlan=DMZ
"vm info" columns take precedence over tags when both define the same key.
"cc mount" allows direct access to a guest's filesystem over the command and
control connection. When given a VM uuid or name and a path, the VM's
filesystem is mounted to the local machine at the provided path. "cc mount"
without arguments displays the existing mounts. Users can use "clear cc mount"
to unmount the filesystem of one or all VMs. This should be done before killing
or stopping the VM ("clear namespace
"cc tunnel" allows users to tunnel TCP connections to a local port through a VM to a remote port. The local port will be created on the minimega cluster host that the tunneling VM is running on. The remote port can be on the same VM or on a different VM the tunneling VM has network access to.
"cc test-conn" allows users to test network connectivity from a guest to the given IP or domain name and port. The wait timeout should be specified as a Go duration string (e.g. 5s, 1m). If "udp" is used, a "base64 udp packet" that will generate a valid response must be specified. Results of the test will be written to the command's STDOUT file, whether it passed or failed. An example test is as follows:
cc test-conn tcp 10.0.0.68 443 wait 10s
If the above test passes, STDOUT for the command will contain the following:
10.0.0.68:443 | pass
If it fails, STDOUT will instead contain the following:
10.0.0.68:443 | fail
For more documentation, see the article "Command and Control API Tutorial".
cc_delete_command(id)
¶
Variants:
cc delete command
Command and control for VMs running the miniccc client. Commands may include regular commands, backgrounded commands, and any number of sent and/or received files. Commands will be executed in command creation order. For example, to send a file 'foo' and display the contents on a remote VM:
cc send foo
cc exec cat foo
Files to be sent must be in the filepath directory, as set by the -filepath flag when launching minimega.
Executed commands can have their stdio tied to pipes used by the plumb and pipe APIs. To use named pipes, simply specify stdin, stdout, or stderr as a key=value pair. For example:
cc exec stderr=foo cat server.log
cc background stdin=foo stdout=bar /usr/bin/program
Executed commands can also be marked to be sent to miniccc clients only once. This will prevent the command from being sent again if the client restarts (for example, after a reboot).
cc exec-once shutdown -r now
Responses are organized in a structure within
Responses to executed commands (not backgrounded) will include the command's exit code, which can be displayed with the 'exitcode' command.
Filters may be set to limit which clients may execute a posted command. For example, to filter on VMs that are running windows and have a specific IP.
cc filter os=windows ip=10.0.0.1
Users can also filter by VM tags. For example, to filter on VMs that have the tag with key foo and value bar set:
cc filter tag=foo:bar
If users wish, they may drop the tag= prefix and key=value pairs will be treated as tags:
cc filter foo=bar
Users can also filter by any column in "vm info" using a similar syntax:
cc filter name=server
cc filter vlan=DMZ
"vm info" columns take precedence over tags when both define the same key.
"cc mount" allows direct access to a guest's filesystem over the command and
control connection. When given a VM uuid or name and a path, the VM's
filesystem is mounted to the local machine at the provided path. "cc mount"
without arguments displays the existing mounts. Users can use "clear cc mount"
to unmount the filesystem of one or all VMs. This should be done before killing
or stopping the VM ("clear namespace
"cc tunnel" allows users to tunnel TCP connections to a local port through a VM to a remote port. The local port will be created on the minimega cluster host that the tunneling VM is running on. The remote port can be on the same VM or on a different VM the tunneling VM has network access to.
"cc test-conn" allows users to test network connectivity from a guest to the given IP or domain name and port. The wait timeout should be specified as a Go duration string (e.g. 5s, 1m). If "udp" is used, a "base64 udp packet" that will generate a valid response must be specified. Results of the test will be written to the command's STDOUT file, whether it passed or failed. An example test is as follows:
cc test-conn tcp 10.0.0.68 443 wait 10s
If the above test passes, STDOUT for the command will contain the following:
10.0.0.68:443 | pass
If it fails, STDOUT will instead contain the following:
10.0.0.68:443 | fail
For more documentation, see the article "Command and Control API Tutorial".
cc_delete_response(id)
¶
Variants:
cc delete response
Command and control for VMs running the miniccc client. Commands may include regular commands, backgrounded commands, and any number of sent and/or received files. Commands will be executed in command creation order. For example, to send a file 'foo' and display the contents on a remote VM:
cc send foo
cc exec cat foo
Files to be sent must be in the filepath directory, as set by the -filepath flag when launching minimega.
Executed commands can have their stdio tied to pipes used by the plumb and pipe APIs. To use named pipes, simply specify stdin, stdout, or stderr as a key=value pair. For example:
cc exec stderr=foo cat server.log
cc background stdin=foo stdout=bar /usr/bin/program
Executed commands can also be marked to be sent to miniccc clients only once. This will prevent the command from being sent again if the client restarts (for example, after a reboot).
cc exec-once shutdown -r now
Responses are organized in a structure within
Responses to executed commands (not backgrounded) will include the command's exit code, which can be displayed with the 'exitcode' command.
Filters may be set to limit which clients may execute a posted command. For example, to filter on VMs that are running windows and have a specific IP.
cc filter os=windows ip=10.0.0.1
Users can also filter by VM tags. For example, to filter on VMs that have the tag with key foo and value bar set:
cc filter tag=foo:bar
If users wish, they may drop the tag= prefix and key=value pairs will be treated as tags:
cc filter foo=bar
Users can also filter by any column in "vm info" using a similar syntax:
cc filter name=server
cc filter vlan=DMZ
"vm info" columns take precedence over tags when both define the same key.
"cc mount" allows direct access to a guest's filesystem over the command and
control connection. When given a VM uuid or name and a path, the VM's
filesystem is mounted to the local machine at the provided path. "cc mount"
without arguments displays the existing mounts. Users can use "clear cc mount"
to unmount the filesystem of one or all VMs. This should be done before killing
or stopping the VM ("clear namespace
"cc tunnel" allows users to tunnel TCP connections to a local port through a VM to a remote port. The local port will be created on the minimega cluster host that the tunneling VM is running on. The remote port can be on the same VM or on a different VM the tunneling VM has network access to.
"cc test-conn" allows users to test network connectivity from a guest to the given IP or domain name and port. The wait timeout should be specified as a Go duration string (e.g. 5s, 1m). If "udp" is used, a "base64 udp packet" that will generate a valid response must be specified. Results of the test will be written to the command's STDOUT file, whether it passed or failed. An example test is as follows:
cc test-conn tcp 10.0.0.68 443 wait 10s
If the above test passes, STDOUT for the command will contain the following:
10.0.0.68:443 | pass
If it fails, STDOUT will instead contain the following:
10.0.0.68:443 | fail
For more documentation, see the article "Command and Control API Tutorial".
cc_exec(command)
¶
Variants:
cc exec
Command and control for VMs running the miniccc client. Commands may include regular commands, backgrounded commands, and any number of sent and/or received files. Commands will be executed in command creation order. For example, to send a file 'foo' and display the contents on a remote VM:
cc send foo
cc exec cat foo
Files to be sent must be in the filepath directory, as set by the -filepath flag when launching minimega.
Executed commands can have their stdio tied to pipes used by the plumb and pipe APIs. To use named pipes, simply specify stdin, stdout, or stderr as a key=value pair. For example:
cc exec stderr=foo cat server.log
cc background stdin=foo stdout=bar /usr/bin/program
Executed commands can also be marked to be sent to miniccc clients only once. This will prevent the command from being sent again if the client restarts (for example, after a reboot).
cc exec-once shutdown -r now
Responses are organized in a structure within
Responses to executed commands (not backgrounded) will include the command's exit code, which can be displayed with the 'exitcode' command.
Filters may be set to limit which clients may execute a posted command. For example, to filter on VMs that are running windows and have a specific IP.
cc filter os=windows ip=10.0.0.1
Users can also filter by VM tags. For example, to filter on VMs that have the tag with key foo and value bar set:
cc filter tag=foo:bar
If users wish, they may drop the tag= prefix and key=value pairs will be treated as tags:
cc filter foo=bar
Users can also filter by any column in "vm info" using a similar syntax:
cc filter name=server
cc filter vlan=DMZ
"vm info" columns take precedence over tags when both define the same key.
"cc mount" allows direct access to a guest's filesystem over the command and
control connection. When given a VM uuid or name and a path, the VM's
filesystem is mounted to the local machine at the provided path. "cc mount"
without arguments displays the existing mounts. Users can use "clear cc mount"
to unmount the filesystem of one or all VMs. This should be done before killing
or stopping the VM ("clear namespace
"cc tunnel" allows users to tunnel TCP connections to a local port through a VM to a remote port. The local port will be created on the minimega cluster host that the tunneling VM is running on. The remote port can be on the same VM or on a different VM the tunneling VM has network access to.
"cc test-conn" allows users to test network connectivity from a guest to the given IP or domain name and port. The wait timeout should be specified as a Go duration string (e.g. 5s, 1m). If "udp" is used, a "base64 udp packet" that will generate a valid response must be specified. Results of the test will be written to the command's STDOUT file, whether it passed or failed. An example test is as follows:
cc test-conn tcp 10.0.0.68 443 wait 10s
If the above test passes, STDOUT for the command will contain the following:
10.0.0.68:443 | pass
If it fails, STDOUT will instead contain the following:
10.0.0.68:443 | fail
For more documentation, see the article "Command and Control API Tutorial".
cc_exec_once(command)
¶
Variants:
cc exec-once
Command and control for VMs running the miniccc client. Commands may include regular commands, backgrounded commands, and any number of sent and/or received files. Commands will be executed in command creation order. For example, to send a file 'foo' and display the contents on a remote VM:
cc send foo
cc exec cat foo
Files to be sent must be in the filepath directory, as set by the -filepath flag when launching minimega.
Executed commands can have their stdio tied to pipes used by the plumb and pipe APIs. To use named pipes, simply specify stdin, stdout, or stderr as a key=value pair. For example:
cc exec stderr=foo cat server.log
cc background stdin=foo stdout=bar /usr/bin/program
Executed commands can also be marked to be sent to miniccc clients only once. This will prevent the command from being sent again if the client restarts (for example, after a reboot).
cc exec-once shutdown -r now
Responses are organized in a structure within
Responses to executed commands (not backgrounded) will include the command's exit code, which can be displayed with the 'exitcode' command.
Filters may be set to limit which clients may execute a posted command. For example, to filter on VMs that are running windows and have a specific IP.
cc filter os=windows ip=10.0.0.1
Users can also filter by VM tags. For example, to filter on VMs that have the tag with key foo and value bar set:
cc filter tag=foo:bar
If users wish, they may drop the tag= prefix and key=value pairs will be treated as tags:
cc filter foo=bar
Users can also filter by any column in "vm info" using a similar syntax:
cc filter name=server
cc filter vlan=DMZ
"vm info" columns take precedence over tags when both define the same key.
"cc mount" allows direct access to a guest's filesystem over the command and
control connection. When given a VM uuid or name and a path, the VM's
filesystem is mounted to the local machine at the provided path. "cc mount"
without arguments displays the existing mounts. Users can use "clear cc mount"
to unmount the filesystem of one or all VMs. This should be done before killing
or stopping the VM ("clear namespace
"cc tunnel" allows users to tunnel TCP connections to a local port through a VM to a remote port. The local port will be created on the minimega cluster host that the tunneling VM is running on. The remote port can be on the same VM or on a different VM the tunneling VM has network access to.
"cc test-conn" allows users to test network connectivity from a guest to the given IP or domain name and port. The wait timeout should be specified as a Go duration string (e.g. 5s, 1m). If "udp" is used, a "base64 udp packet" that will generate a valid response must be specified. Results of the test will be written to the command's STDOUT file, whether it passed or failed. An example test is as follows:
cc test-conn tcp 10.0.0.68 443 wait 10s
If the above test passes, STDOUT for the command will contain the following:
10.0.0.68:443 | pass
If it fails, STDOUT will instead contain the following:
10.0.0.68:443 | fail
For more documentation, see the article "Command and Control API Tutorial".
cc_exitcode(id, vm)
¶
Variants:
cc exitcode
Command and control for VMs running the miniccc client. Commands may include regular commands, backgrounded commands, and any number of sent and/or received files. Commands will be executed in command creation order. For example, to send a file 'foo' and display the contents on a remote VM:
cc send foo
cc exec cat foo
Files to be sent must be in the filepath directory, as set by the -filepath flag when launching minimega.
Executed commands can have their stdio tied to pipes used by the plumb and pipe APIs. To use named pipes, simply specify stdin, stdout, or stderr as a key=value pair. For example:
cc exec stderr=foo cat server.log
cc background stdin=foo stdout=bar /usr/bin/program
Executed commands can also be marked to be sent to miniccc clients only once. This will prevent the command from being sent again if the client restarts (for example, after a reboot).
cc exec-once shutdown -r now
Responses are organized in a structure within
Responses to executed commands (not backgrounded) will include the command's exit code, which can be displayed with the 'exitcode' command.
Filters may be set to limit which clients may execute a posted command. For example, to filter on VMs that are running windows and have a specific IP.
cc filter os=windows ip=10.0.0.1
Users can also filter by VM tags. For example, to filter on VMs that have the tag with key foo and value bar set:
cc filter tag=foo:bar
If users wish, they may drop the tag= prefix and key=value pairs will be treated as tags:
cc filter foo=bar
Users can also filter by any column in "vm info" using a similar syntax:
cc filter name=server
cc filter vlan=DMZ
"vm info" columns take precedence over tags when both define the same key.
"cc mount" allows direct access to a guest's filesystem over the command and
control connection. When given a VM uuid or name and a path, the VM's
filesystem is mounted to the local machine at the provided path. "cc mount"
without arguments displays the existing mounts. Users can use "clear cc mount"
to unmount the filesystem of one or all VMs. This should be done before killing
or stopping the VM ("clear namespace
"cc tunnel" allows users to tunnel TCP connections to a local port through a VM to a remote port. The local port will be created on the minimega cluster host that the tunneling VM is running on. The remote port can be on the same VM or on a different VM the tunneling VM has network access to.
"cc test-conn" allows users to test network connectivity from a guest to the given IP or domain name and port. The wait timeout should be specified as a Go duration string (e.g. 5s, 1m). If "udp" is used, a "base64 udp packet" that will generate a valid response must be specified. Results of the test will be written to the command's STDOUT file, whether it passed or failed. An example test is as follows:
cc test-conn tcp 10.0.0.68 443 wait 10s
If the above test passes, STDOUT for the command will contain the following:
10.0.0.68:443 | pass
If it fails, STDOUT will instead contain the following:
10.0.0.68:443 | fail
For more documentation, see the article "Command and Control API Tutorial".
cc_filter(filter=None)
¶
Variants:
cc filter
Command and control for VMs running the miniccc client. Commands may include regular commands, backgrounded commands, and any number of sent and/or received files. Commands will be executed in command creation order. For example, to send a file 'foo' and display the contents on a remote VM:
cc send foo
cc exec cat foo
Files to be sent must be in the filepath directory, as set by the -filepath flag when launching minimega.
Executed commands can have their stdio tied to pipes used by the plumb and pipe APIs. To use named pipes, simply specify stdin, stdout, or stderr as a key=value pair. For example:
cc exec stderr=foo cat server.log
cc background stdin=foo stdout=bar /usr/bin/program
Executed commands can also be marked to be sent to miniccc clients only once. This will prevent the command from being sent again if the client restarts (for example, after a reboot).
cc exec-once shutdown -r now
Responses are organized in a structure within
Responses to executed commands (not backgrounded) will include the command's exit code, which can be displayed with the 'exitcode' command.
Filters may be set to limit which clients may execute a posted command. For example, to filter on VMs that are running windows and have a specific IP.
cc filter os=windows ip=10.0.0.1
Users can also filter by VM tags. For example, to filter on VMs that have the tag with key foo and value bar set:
cc filter tag=foo:bar
If users wish, they may drop the tag= prefix and key=value pairs will be treated as tags:
cc filter foo=bar
Users can also filter by any column in "vm info" using a similar syntax:
cc filter name=server
cc filter vlan=DMZ
"vm info" columns take precedence over tags when both define the same key.
"cc mount" allows direct access to a guest's filesystem over the command and
control connection. When given a VM uuid or name and a path, the VM's
filesystem is mounted to the local machine at the provided path. "cc mount"
without arguments displays the existing mounts. Users can use "clear cc mount"
to unmount the filesystem of one or all VMs. This should be done before killing
or stopping the VM ("clear namespace
"cc tunnel" allows users to tunnel TCP connections to a local port through a VM to a remote port. The local port will be created on the minimega cluster host that the tunneling VM is running on. The remote port can be on the same VM or on a different VM the tunneling VM has network access to.
"cc test-conn" allows users to test network connectivity from a guest to the given IP or domain name and port. The wait timeout should be specified as a Go duration string (e.g. 5s, 1m). If "udp" is used, a "base64 udp packet" that will generate a valid response must be specified. Results of the test will be written to the command's STDOUT file, whether it passed or failed. An example test is as follows:
cc test-conn tcp 10.0.0.68 443 wait 10s
If the above test passes, STDOUT for the command will contain the following:
10.0.0.68:443 | pass
If it fails, STDOUT will instead contain the following:
10.0.0.68:443 | fail
For more documentation, see the article "Command and Control API Tutorial".
cc_listen(port)
¶
Variants:
cc listen
Command and control for VMs running the miniccc client. Commands may include regular commands, backgrounded commands, and any number of sent and/or received files. Commands will be executed in command creation order. For example, to send a file 'foo' and display the contents on a remote VM:
cc send foo
cc exec cat foo
Files to be sent must be in the filepath directory, as set by the -filepath flag when launching minimega.
Executed commands can have their stdio tied to pipes used by the plumb and pipe APIs. To use named pipes, simply specify stdin, stdout, or stderr as a key=value pair. For example:
cc exec stderr=foo cat server.log
cc background stdin=foo stdout=bar /usr/bin/program
Executed commands can also be marked to be sent to miniccc clients only once. This will prevent the command from being sent again if the client restarts (for example, after a reboot).
cc exec-once shutdown -r now
Responses are organized in a structure within
Responses to executed commands (not backgrounded) will include the command's exit code, which can be displayed with the 'exitcode' command.
Filters may be set to limit which clients may execute a posted command. For example, to filter on VMs that are running windows and have a specific IP.
cc filter os=windows ip=10.0.0.1
Users can also filter by VM tags. For example, to filter on VMs that have the tag with key foo and value bar set:
cc filter tag=foo:bar
If users wish, they may drop the tag= prefix and key=value pairs will be treated as tags:
cc filter foo=bar
Users can also filter by any column in "vm info" using a similar syntax:
cc filter name=server
cc filter vlan=DMZ
"vm info" columns take precedence over tags when both define the same key.
"cc mount" allows direct access to a guest's filesystem over the command and
control connection. When given a VM uuid or name and a path, the VM's
filesystem is mounted to the local machine at the provided path. "cc mount"
without arguments displays the existing mounts. Users can use "clear cc mount"
to unmount the filesystem of one or all VMs. This should be done before killing
or stopping the VM ("clear namespace
"cc tunnel" allows users to tunnel TCP connections to a local port through a VM to a remote port. The local port will be created on the minimega cluster host that the tunneling VM is running on. The remote port can be on the same VM or on a different VM the tunneling VM has network access to.
"cc test-conn" allows users to test network connectivity from a guest to the given IP or domain name and port. The wait timeout should be specified as a Go duration string (e.g. 5s, 1m). If "udp" is used, a "base64 udp packet" that will generate a valid response must be specified. Results of the test will be written to the command's STDOUT file, whether it passed or failed. An example test is as follows:
cc test-conn tcp 10.0.0.68 443 wait 10s
If the above test passes, STDOUT for the command will contain the following:
10.0.0.68:443 | pass
If it fails, STDOUT will instead contain the following:
10.0.0.68:443 | fail
For more documentation, see the article "Command and Control API Tutorial".
cc_log_level(debug_or_info_or_warn_or_error_or_fatal)
¶
Variants:
cc log level
Command and control for VMs running the miniccc client. Commands may include regular commands, backgrounded commands, and any number of sent and/or received files. Commands will be executed in command creation order. For example, to send a file 'foo' and display the contents on a remote VM:
cc send foo
cc exec cat foo
Files to be sent must be in the filepath directory, as set by the -filepath flag when launching minimega.
Executed commands can have their stdio tied to pipes used by the plumb and pipe APIs. To use named pipes, simply specify stdin, stdout, or stderr as a key=value pair. For example:
cc exec stderr=foo cat server.log
cc background stdin=foo stdout=bar /usr/bin/program
Executed commands can also be marked to be sent to miniccc clients only once. This will prevent the command from being sent again if the client restarts (for example, after a reboot).
cc exec-once shutdown -r now
Responses are organized in a structure within
Responses to executed commands (not backgrounded) will include the command's exit code, which can be displayed with the 'exitcode' command.
Filters may be set to limit which clients may execute a posted command. For example, to filter on VMs that are running windows and have a specific IP.
cc filter os=windows ip=10.0.0.1
Users can also filter by VM tags. For example, to filter on VMs that have the tag with key foo and value bar set:
cc filter tag=foo:bar
If users wish, they may drop the tag= prefix and key=value pairs will be treated as tags:
cc filter foo=bar
Users can also filter by any column in "vm info" using a similar syntax:
cc filter name=server
cc filter vlan=DMZ
"vm info" columns take precedence over tags when both define the same key.
"cc mount" allows direct access to a guest's filesystem over the command and
control connection. When given a VM uuid or name and a path, the VM's
filesystem is mounted to the local machine at the provided path. "cc mount"
without arguments displays the existing mounts. Users can use "clear cc mount"
to unmount the filesystem of one or all VMs. This should be done before killing
or stopping the VM ("clear namespace
"cc tunnel" allows users to tunnel TCP connections to a local port through a VM to a remote port. The local port will be created on the minimega cluster host that the tunneling VM is running on. The remote port can be on the same VM or on a different VM the tunneling VM has network access to.
"cc test-conn" allows users to test network connectivity from a guest to the given IP or domain name and port. The wait timeout should be specified as a Go duration string (e.g. 5s, 1m). If "udp" is used, a "base64 udp packet" that will generate a valid response must be specified. Results of the test will be written to the command's STDOUT file, whether it passed or failed. An example test is as follows:
cc test-conn tcp 10.0.0.68 443 wait 10s
If the above test passes, STDOUT for the command will contain the following:
10.0.0.68:443 | pass
If it fails, STDOUT will instead contain the following:
10.0.0.68:443 | fail
For more documentation, see the article "Command and Control API Tutorial".
cc_mount(uuid=None, path=None)
¶
Variants:
cc mount
list mounted filesystems
cc_prefix(prefix=None)
¶
Variants:
cc prefix
Command and control for VMs running the miniccc client. Commands may include regular commands, backgrounded commands, and any number of sent and/or received files. Commands will be executed in command creation order. For example, to send a file 'foo' and display the contents on a remote VM:
cc send foo
cc exec cat foo
Files to be sent must be in the filepath directory, as set by the -filepath flag when launching minimega.
Executed commands can have their stdio tied to pipes used by the plumb and pipe APIs. To use named pipes, simply specify stdin, stdout, or stderr as a key=value pair. For example:
cc exec stderr=foo cat server.log
cc background stdin=foo stdout=bar /usr/bin/program
Executed commands can also be marked to be sent to miniccc clients only once. This will prevent the command from being sent again if the client restarts (for example, after a reboot).
cc exec-once shutdown -r now
Responses are organized in a structure within
Responses to executed commands (not backgrounded) will include the command's exit code, which can be displayed with the 'exitcode' command.
Filters may be set to limit which clients may execute a posted command. For example, to filter on VMs that are running windows and have a specific IP.
cc filter os=windows ip=10.0.0.1
Users can also filter by VM tags. For example, to filter on VMs that have the tag with key foo and value bar set:
cc filter tag=foo:bar
If users wish, they may drop the tag= prefix and key=value pairs will be treated as tags:
cc filter foo=bar
Users can also filter by any column in "vm info" using a similar syntax:
cc filter name=server
cc filter vlan=DMZ
"vm info" columns take precedence over tags when both define the same key.
"cc mount" allows direct access to a guest's filesystem over the command and
control connection. When given a VM uuid or name and a path, the VM's
filesystem is mounted to the local machine at the provided path. "cc mount"
without arguments displays the existing mounts. Users can use "clear cc mount"
to unmount the filesystem of one or all VMs. This should be done before killing
or stopping the VM ("clear namespace
"cc tunnel" allows users to tunnel TCP connections to a local port through a VM to a remote port. The local port will be created on the minimega cluster host that the tunneling VM is running on. The remote port can be on the same VM or on a different VM the tunneling VM has network access to.
"cc test-conn" allows users to test network connectivity from a guest to the given IP or domain name and port. The wait timeout should be specified as a Go duration string (e.g. 5s, 1m). If "udp" is used, a "base64 udp packet" that will generate a valid response must be specified. Results of the test will be written to the command's STDOUT file, whether it passed or failed. An example test is as follows:
cc test-conn tcp 10.0.0.68 443 wait 10s
If the above test passes, STDOUT for the command will contain the following:
10.0.0.68:443 | pass
If it fails, STDOUT will instead contain the following:
10.0.0.68:443 | fail
For more documentation, see the article "Command and Control API Tutorial".
cc_process_kill(pid)
¶
Variants:
cc process kill
Command and control for VMs running the miniccc client. Commands may include regular commands, backgrounded commands, and any number of sent and/or received files. Commands will be executed in command creation order. For example, to send a file 'foo' and display the contents on a remote VM:
cc send foo
cc exec cat foo
Files to be sent must be in the filepath directory, as set by the -filepath flag when launching minimega.
Executed commands can have their stdio tied to pipes used by the plumb and pipe APIs. To use named pipes, simply specify stdin, stdout, or stderr as a key=value pair. For example:
cc exec stderr=foo cat server.log
cc background stdin=foo stdout=bar /usr/bin/program
Executed commands can also be marked to be sent to miniccc clients only once. This will prevent the command from being sent again if the client restarts (for example, after a reboot).
cc exec-once shutdown -r now
Responses are organized in a structure within
Responses to executed commands (not backgrounded) will include the command's exit code, which can be displayed with the 'exitcode' command.
Filters may be set to limit which clients may execute a posted command. For example, to filter on VMs that are running windows and have a specific IP.
cc filter os=windows ip=10.0.0.1
Users can also filter by VM tags. For example, to filter on VMs that have the tag with key foo and value bar set:
cc filter tag=foo:bar
If users wish, they may drop the tag= prefix and key=value pairs will be treated as tags:
cc filter foo=bar
Users can also filter by any column in "vm info" using a similar syntax:
cc filter name=server
cc filter vlan=DMZ
"vm info" columns take precedence over tags when both define the same key.
"cc mount" allows direct access to a guest's filesystem over the command and
control connection. When given a VM uuid or name and a path, the VM's
filesystem is mounted to the local machine at the provided path. "cc mount"
without arguments displays the existing mounts. Users can use "clear cc mount"
to unmount the filesystem of one or all VMs. This should be done before killing
or stopping the VM ("clear namespace
"cc tunnel" allows users to tunnel TCP connections to a local port through a VM to a remote port. The local port will be created on the minimega cluster host that the tunneling VM is running on. The remote port can be on the same VM or on a different VM the tunneling VM has network access to.
"cc test-conn" allows users to test network connectivity from a guest to the given IP or domain name and port. The wait timeout should be specified as a Go duration string (e.g. 5s, 1m). If "udp" is used, a "base64 udp packet" that will generate a valid response must be specified. Results of the test will be written to the command's STDOUT file, whether it passed or failed. An example test is as follows:
cc test-conn tcp 10.0.0.68 443 wait 10s
If the above test passes, STDOUT for the command will contain the following:
10.0.0.68:443 | pass
If it fails, STDOUT will instead contain the following:
10.0.0.68:443 | fail
For more documentation, see the article "Command and Control API Tutorial".
cc_process_killall(name)
¶
Variants:
cc process killall
Command and control for VMs running the miniccc client. Commands may include regular commands, backgrounded commands, and any number of sent and/or received files. Commands will be executed in command creation order. For example, to send a file 'foo' and display the contents on a remote VM:
cc send foo
cc exec cat foo
Files to be sent must be in the filepath directory, as set by the -filepath flag when launching minimega.
Executed commands can have their stdio tied to pipes used by the plumb and pipe APIs. To use named pipes, simply specify stdin, stdout, or stderr as a key=value pair. For example:
cc exec stderr=foo cat server.log
cc background stdin=foo stdout=bar /usr/bin/program
Executed commands can also be marked to be sent to miniccc clients only once. This will prevent the command from being sent again if the client restarts (for example, after a reboot).
cc exec-once shutdown -r now
Responses are organized in a structure within
Responses to executed commands (not backgrounded) will include the command's exit code, which can be displayed with the 'exitcode' command.
Filters may be set to limit which clients may execute a posted command. For example, to filter on VMs that are running windows and have a specific IP.
cc filter os=windows ip=10.0.0.1
Users can also filter by VM tags. For example, to filter on VMs that have the tag with key foo and value bar set:
cc filter tag=foo:bar
If users wish, they may drop the tag= prefix and key=value pairs will be treated as tags:
cc filter foo=bar
Users can also filter by any column in "vm info" using a similar syntax:
cc filter name=server
cc filter vlan=DMZ
"vm info" columns take precedence over tags when both define the same key.
"cc mount" allows direct access to a guest's filesystem over the command and
control connection. When given a VM uuid or name and a path, the VM's
filesystem is mounted to the local machine at the provided path. "cc mount"
without arguments displays the existing mounts. Users can use "clear cc mount"
to unmount the filesystem of one or all VMs. This should be done before killing
or stopping the VM ("clear namespace
"cc tunnel" allows users to tunnel TCP connections to a local port through a VM to a remote port. The local port will be created on the minimega cluster host that the tunneling VM is running on. The remote port can be on the same VM or on a different VM the tunneling VM has network access to.
"cc test-conn" allows users to test network connectivity from a guest to the given IP or domain name and port. The wait timeout should be specified as a Go duration string (e.g. 5s, 1m). If "udp" is used, a "base64 udp packet" that will generate a valid response must be specified. Results of the test will be written to the command's STDOUT file, whether it passed or failed. An example test is as follows:
cc test-conn tcp 10.0.0.68 443 wait 10s
If the above test passes, STDOUT for the command will contain the following:
10.0.0.68:443 | pass
If it fails, STDOUT will instead contain the following:
10.0.0.68:443 | fail
For more documentation, see the article "Command and Control API Tutorial".
cc_process_list(vm)
¶
Variants:
cc process list
Command and control for VMs running the miniccc client. Commands may include regular commands, backgrounded commands, and any number of sent and/or received files. Commands will be executed in command creation order. For example, to send a file 'foo' and display the contents on a remote VM:
cc send foo
cc exec cat foo
Files to be sent must be in the filepath directory, as set by the -filepath flag when launching minimega.
Executed commands can have their stdio tied to pipes used by the plumb and pipe APIs. To use named pipes, simply specify stdin, stdout, or stderr as a key=value pair. For example:
cc exec stderr=foo cat server.log
cc background stdin=foo stdout=bar /usr/bin/program
Executed commands can also be marked to be sent to miniccc clients only once. This will prevent the command from being sent again if the client restarts (for example, after a reboot).
cc exec-once shutdown -r now
Responses are organized in a structure within
Responses to executed commands (not backgrounded) will include the command's exit code, which can be displayed with the 'exitcode' command.
Filters may be set to limit which clients may execute a posted command. For example, to filter on VMs that are running windows and have a specific IP.
cc filter os=windows ip=10.0.0.1
Users can also filter by VM tags. For example, to filter on VMs that have the tag with key foo and value bar set:
cc filter tag=foo:bar
If users wish, they may drop the tag= prefix and key=value pairs will be treated as tags:
cc filter foo=bar
Users can also filter by any column in "vm info" using a similar syntax:
cc filter name=server
cc filter vlan=DMZ
"vm info" columns take precedence over tags when both define the same key.
"cc mount" allows direct access to a guest's filesystem over the command and
control connection. When given a VM uuid or name and a path, the VM's
filesystem is mounted to the local machine at the provided path. "cc mount"
without arguments displays the existing mounts. Users can use "clear cc mount"
to unmount the filesystem of one or all VMs. This should be done before killing
or stopping the VM ("clear namespace
"cc tunnel" allows users to tunnel TCP connections to a local port through a VM to a remote port. The local port will be created on the minimega cluster host that the tunneling VM is running on. The remote port can be on the same VM or on a different VM the tunneling VM has network access to.
"cc test-conn" allows users to test network connectivity from a guest to the given IP or domain name and port. The wait timeout should be specified as a Go duration string (e.g. 5s, 1m). If "udp" is used, a "base64 udp packet" that will generate a valid response must be specified. Results of the test will be written to the command's STDOUT file, whether it passed or failed. An example test is as follows:
cc test-conn tcp 10.0.0.68 443 wait 10s
If the above test passes, STDOUT for the command will contain the following:
10.0.0.68:443 | pass
If it fails, STDOUT will instead contain the following:
10.0.0.68:443 | fail
For more documentation, see the article "Command and Control API Tutorial".
cc_recv(file)
¶
Variants:
cc recv
Command and control for VMs running the miniccc client. Commands may include regular commands, backgrounded commands, and any number of sent and/or received files. Commands will be executed in command creation order. For example, to send a file 'foo' and display the contents on a remote VM:
cc send foo
cc exec cat foo
Files to be sent must be in the filepath directory, as set by the -filepath flag when launching minimega.
Executed commands can have their stdio tied to pipes used by the plumb and pipe APIs. To use named pipes, simply specify stdin, stdout, or stderr as a key=value pair. For example:
cc exec stderr=foo cat server.log
cc background stdin=foo stdout=bar /usr/bin/program
Executed commands can also be marked to be sent to miniccc clients only once. This will prevent the command from being sent again if the client restarts (for example, after a reboot).
cc exec-once shutdown -r now
Responses are organized in a structure within
Responses to executed commands (not backgrounded) will include the command's exit code, which can be displayed with the 'exitcode' command.
Filters may be set to limit which clients may execute a posted command. For example, to filter on VMs that are running windows and have a specific IP.
cc filter os=windows ip=10.0.0.1
Users can also filter by VM tags. For example, to filter on VMs that have the tag with key foo and value bar set:
cc filter tag=foo:bar
If users wish, they may drop the tag= prefix and key=value pairs will be treated as tags:
cc filter foo=bar
Users can also filter by any column in "vm info" using a similar syntax:
cc filter name=server
cc filter vlan=DMZ
"vm info" columns take precedence over tags when both define the same key.
"cc mount" allows direct access to a guest's filesystem over the command and
control connection. When given a VM uuid or name and a path, the VM's
filesystem is mounted to the local machine at the provided path. "cc mount"
without arguments displays the existing mounts. Users can use "clear cc mount"
to unmount the filesystem of one or all VMs. This should be done before killing
or stopping the VM ("clear namespace
"cc tunnel" allows users to tunnel TCP connections to a local port through a VM to a remote port. The local port will be created on the minimega cluster host that the tunneling VM is running on. The remote port can be on the same VM or on a different VM the tunneling VM has network access to.
"cc test-conn" allows users to test network connectivity from a guest to the given IP or domain name and port. The wait timeout should be specified as a Go duration string (e.g. 5s, 1m). If "udp" is used, a "base64 udp packet" that will generate a valid response must be specified. Results of the test will be written to the command's STDOUT file, whether it passed or failed. An example test is as follows:
cc test-conn tcp 10.0.0.68 443 wait 10s
If the above test passes, STDOUT for the command will contain the following:
10.0.0.68:443 | pass
If it fails, STDOUT will instead contain the following:
10.0.0.68:443 | fail
For more documentation, see the article "Command and Control API Tutorial".
cc_responses(id, raw=None)
¶
Variants:
cc responses
Command and control for VMs running the miniccc client. Commands may include regular commands, backgrounded commands, and any number of sent and/or received files. Commands will be executed in command creation order. For example, to send a file 'foo' and display the contents on a remote VM:
cc send foo
cc exec cat foo
Files to be sent must be in the filepath directory, as set by the -filepath flag when launching minimega.
Executed commands can have their stdio tied to pipes used by the plumb and pipe APIs. To use named pipes, simply specify stdin, stdout, or stderr as a key=value pair. For example:
cc exec stderr=foo cat server.log
cc background stdin=foo stdout=bar /usr/bin/program
Executed commands can also be marked to be sent to miniccc clients only once. This will prevent the command from being sent again if the client restarts (for example, after a reboot).
cc exec-once shutdown -r now
Responses are organized in a structure within
Responses to executed commands (not backgrounded) will include the command's exit code, which can be displayed with the 'exitcode' command.
Filters may be set to limit which clients may execute a posted command. For example, to filter on VMs that are running windows and have a specific IP.
cc filter os=windows ip=10.0.0.1
Users can also filter by VM tags. For example, to filter on VMs that have the tag with key foo and value bar set:
cc filter tag=foo:bar
If users wish, they may drop the tag= prefix and key=value pairs will be treated as tags:
cc filter foo=bar
Users can also filter by any column in "vm info" using a similar syntax:
cc filter name=server
cc filter vlan=DMZ
"vm info" columns take precedence over tags when both define the same key.
"cc mount" allows direct access to a guest's filesystem over the command and
control connection. When given a VM uuid or name and a path, the VM's
filesystem is mounted to the local machine at the provided path. "cc mount"
without arguments displays the existing mounts. Users can use "clear cc mount"
to unmount the filesystem of one or all VMs. This should be done before killing
or stopping the VM ("clear namespace
"cc tunnel" allows users to tunnel TCP connections to a local port through a VM to a remote port. The local port will be created on the minimega cluster host that the tunneling VM is running on. The remote port can be on the same VM or on a different VM the tunneling VM has network access to.
"cc test-conn" allows users to test network connectivity from a guest to the given IP or domain name and port. The wait timeout should be specified as a Go duration string (e.g. 5s, 1m). If "udp" is used, a "base64 udp packet" that will generate a valid response must be specified. Results of the test will be written to the command's STDOUT file, whether it passed or failed. An example test is as follows:
cc test-conn tcp 10.0.0.68 443 wait 10s
If the above test passes, STDOUT for the command will contain the following:
10.0.0.68:443 | pass
If it fails, STDOUT will instead contain the following:
10.0.0.68:443 | fail
For more documentation, see the article "Command and Control API Tutorial".
cc_rtunnel(src, host, dst)
¶
Variants:
cc rtunnel
Command and control for VMs running the miniccc client. Commands may include regular commands, backgrounded commands, and any number of sent and/or received files. Commands will be executed in command creation order. For example, to send a file 'foo' and display the contents on a remote VM:
cc send foo
cc exec cat foo
Files to be sent must be in the filepath directory, as set by the -filepath flag when launching minimega.
Executed commands can have their stdio tied to pipes used by the plumb and pipe APIs. To use named pipes, simply specify stdin, stdout, or stderr as a key=value pair. For example:
cc exec stderr=foo cat server.log
cc background stdin=foo stdout=bar /usr/bin/program
Executed commands can also be marked to be sent to miniccc clients only once. This will prevent the command from being sent again if the client restarts (for example, after a reboot).
cc exec-once shutdown -r now
Responses are organized in a structure within
Responses to executed commands (not backgrounded) will include the command's exit code, which can be displayed with the 'exitcode' command.
Filters may be set to limit which clients may execute a posted command. For example, to filter on VMs that are running windows and have a specific IP.
cc filter os=windows ip=10.0.0.1
Users can also filter by VM tags. For example, to filter on VMs that have the tag with key foo and value bar set:
cc filter tag=foo:bar
If users wish, they may drop the tag= prefix and key=value pairs will be treated as tags:
cc filter foo=bar
Users can also filter by any column in "vm info" using a similar syntax:
cc filter name=server
cc filter vlan=DMZ
"vm info" columns take precedence over tags when both define the same key.
"cc mount" allows direct access to a guest's filesystem over the command and
control connection. When given a VM uuid or name and a path, the VM's
filesystem is mounted to the local machine at the provided path. "cc mount"
without arguments displays the existing mounts. Users can use "clear cc mount"
to unmount the filesystem of one or all VMs. This should be done before killing
or stopping the VM ("clear namespace
"cc tunnel" allows users to tunnel TCP connections to a local port through a VM to a remote port. The local port will be created on the minimega cluster host that the tunneling VM is running on. The remote port can be on the same VM or on a different VM the tunneling VM has network access to.
"cc test-conn" allows users to test network connectivity from a guest to the given IP or domain name and port. The wait timeout should be specified as a Go duration string (e.g. 5s, 1m). If "udp" is used, a "base64 udp packet" that will generate a valid response must be specified. Results of the test will be written to the command's STDOUT file, whether it passed or failed. An example test is as follows:
cc test-conn tcp 10.0.0.68 443 wait 10s
If the above test passes, STDOUT for the command will contain the following:
10.0.0.68:443 | pass
If it fails, STDOUT will instead contain the following:
10.0.0.68:443 | fail
For more documentation, see the article "Command and Control API Tutorial".
cc_send(file)
¶
Variants:
cc send
Command and control for VMs running the miniccc client. Commands may include regular commands, backgrounded commands, and any number of sent and/or received files. Commands will be executed in command creation order. For example, to send a file 'foo' and display the contents on a remote VM:
cc send foo
cc exec cat foo
Files to be sent must be in the filepath directory, as set by the -filepath flag when launching minimega.
Executed commands can have their stdio tied to pipes used by the plumb and pipe APIs. To use named pipes, simply specify stdin, stdout, or stderr as a key=value pair. For example:
cc exec stderr=foo cat server.log
cc background stdin=foo stdout=bar /usr/bin/program
Executed commands can also be marked to be sent to miniccc clients only once. This will prevent the command from being sent again if the client restarts (for example, after a reboot).
cc exec-once shutdown -r now
Responses are organized in a structure within
Responses to executed commands (not backgrounded) will include the command's exit code, which can be displayed with the 'exitcode' command.
Filters may be set to limit which clients may execute a posted command. For example, to filter on VMs that are running windows and have a specific IP.
cc filter os=windows ip=10.0.0.1
Users can also filter by VM tags. For example, to filter on VMs that have the tag with key foo and value bar set:
cc filter tag=foo:bar
If users wish, they may drop the tag= prefix and key=value pairs will be treated as tags:
cc filter foo=bar
Users can also filter by any column in "vm info" using a similar syntax:
cc filter name=server
cc filter vlan=DMZ
"vm info" columns take precedence over tags when both define the same key.
"cc mount" allows direct access to a guest's filesystem over the command and
control connection. When given a VM uuid or name and a path, the VM's
filesystem is mounted to the local machine at the provided path. "cc mount"
without arguments displays the existing mounts. Users can use "clear cc mount"
to unmount the filesystem of one or all VMs. This should be done before killing
or stopping the VM ("clear namespace
"cc tunnel" allows users to tunnel TCP connections to a local port through a VM to a remote port. The local port will be created on the minimega cluster host that the tunneling VM is running on. The remote port can be on the same VM or on a different VM the tunneling VM has network access to.
"cc test-conn" allows users to test network connectivity from a guest to the given IP or domain name and port. The wait timeout should be specified as a Go duration string (e.g. 5s, 1m). If "udp" is used, a "base64 udp packet" that will generate a valid response must be specified. Results of the test will be written to the command's STDOUT file, whether it passed or failed. An example test is as follows:
cc test-conn tcp 10.0.0.68 443 wait 10s
If the above test passes, STDOUT for the command will contain the following:
10.0.0.68:443 | pass
If it fails, STDOUT will instead contain the following:
10.0.0.68:443 | fail
For more documentation, see the article "Command and Control API Tutorial".
cc_test_conn_wait(tcp_or_udp, ip, port, timeout, base64=None)
¶
Variants:
cc test-conn
Command and control for VMs running the miniccc client. Commands may include regular commands, backgrounded commands, and any number of sent and/or received files. Commands will be executed in command creation order. For example, to send a file 'foo' and display the contents on a remote VM:
cc send foo
cc exec cat foo
Files to be sent must be in the filepath directory, as set by the -filepath flag when launching minimega.
Executed commands can have their stdio tied to pipes used by the plumb and pipe APIs. To use named pipes, simply specify stdin, stdout, or stderr as a key=value pair. For example:
cc exec stderr=foo cat server.log
cc background stdin=foo stdout=bar /usr/bin/program
Executed commands can also be marked to be sent to miniccc clients only once. This will prevent the command from being sent again if the client restarts (for example, after a reboot).
cc exec-once shutdown -r now
Responses are organized in a structure within
Responses to executed commands (not backgrounded) will include the command's exit code, which can be displayed with the 'exitcode' command.
Filters may be set to limit which clients may execute a posted command. For example, to filter on VMs that are running windows and have a specific IP.
cc filter os=windows ip=10.0.0.1
Users can also filter by VM tags. For example, to filter on VMs that have the tag with key foo and value bar set:
cc filter tag=foo:bar
If users wish, they may drop the tag= prefix and key=value pairs will be treated as tags:
cc filter foo=bar
Users can also filter by any column in "vm info" using a similar syntax:
cc filter name=server
cc filter vlan=DMZ
"vm info" columns take precedence over tags when both define the same key.
"cc mount" allows direct access to a guest's filesystem over the command and
control connection. When given a VM uuid or name and a path, the VM's
filesystem is mounted to the local machine at the provided path. "cc mount"
without arguments displays the existing mounts. Users can use "clear cc mount"
to unmount the filesystem of one or all VMs. This should be done before killing
or stopping the VM ("clear namespace
"cc tunnel" allows users to tunnel TCP connections to a local port through a VM to a remote port. The local port will be created on the minimega cluster host that the tunneling VM is running on. The remote port can be on the same VM or on a different VM the tunneling VM has network access to.
"cc test-conn" allows users to test network connectivity from a guest to the given IP or domain name and port. The wait timeout should be specified as a Go duration string (e.g. 5s, 1m). If "udp" is used, a "base64 udp packet" that will generate a valid response must be specified. Results of the test will be written to the command's STDOUT file, whether it passed or failed. An example test is as follows:
cc test-conn tcp 10.0.0.68 443 wait 10s
If the above test passes, STDOUT for the command will contain the following:
10.0.0.68:443 | pass
If it fails, STDOUT will instead contain the following:
10.0.0.68:443 | fail
For more documentation, see the article "Command and Control API Tutorial".
cc_tunnel(vm, src, host, dst)
¶
Variants:
cc tunnel
Command and control for VMs running the miniccc client. Commands may include regular commands, backgrounded commands, and any number of sent and/or received files. Commands will be executed in command creation order. For example, to send a file 'foo' and display the contents on a remote VM:
cc send foo
cc exec cat foo
Files to be sent must be in the filepath directory, as set by the -filepath flag when launching minimega.
Executed commands can have their stdio tied to pipes used by the plumb and pipe APIs. To use named pipes, simply specify stdin, stdout, or stderr as a key=value pair. For example:
cc exec stderr=foo cat server.log
cc background stdin=foo stdout=bar /usr/bin/program
Executed commands can also be marked to be sent to miniccc clients only once. This will prevent the command from being sent again if the client restarts (for example, after a reboot).
cc exec-once shutdown -r now
Responses are organized in a structure within
Responses to executed commands (not backgrounded) will include the command's exit code, which can be displayed with the 'exitcode' command.
Filters may be set to limit which clients may execute a posted command. For example, to filter on VMs that are running windows and have a specific IP.
cc filter os=windows ip=10.0.0.1
Users can also filter by VM tags. For example, to filter on VMs that have the tag with key foo and value bar set:
cc filter tag=foo:bar
If users wish, they may drop the tag= prefix and key=value pairs will be treated as tags:
cc filter foo=bar
Users can also filter by any column in "vm info" using a similar syntax:
cc filter name=server
cc filter vlan=DMZ
"vm info" columns take precedence over tags when both define the same key.
"cc mount" allows direct access to a guest's filesystem over the command and
control connection. When given a VM uuid or name and a path, the VM's
filesystem is mounted to the local machine at the provided path. "cc mount"
without arguments displays the existing mounts. Users can use "clear cc mount"
to unmount the filesystem of one or all VMs. This should be done before killing
or stopping the VM ("clear namespace
"cc tunnel" allows users to tunnel TCP connections to a local port through a VM to a remote port. The local port will be created on the minimega cluster host that the tunneling VM is running on. The remote port can be on the same VM or on a different VM the tunneling VM has network access to.
"cc test-conn" allows users to test network connectivity from a guest to the given IP or domain name and port. The wait timeout should be specified as a Go duration string (e.g. 5s, 1m). If "udp" is used, a "base64 udp packet" that will generate a valid response must be specified. Results of the test will be written to the command's STDOUT file, whether it passed or failed. An example test is as follows:
cc test-conn tcp 10.0.0.68 443 wait 10s
If the above test passes, STDOUT for the command will contain the following:
10.0.0.68:443 | pass
If it fails, STDOUT will instead contain the following:
10.0.0.68:443 | fail
For more documentation, see the article "Command and Control API Tutorial".
cc_tunnel_close(vm, id)
¶
Variants:
cc tunnel close
Command and control for VMs running the miniccc client. Commands may include regular commands, backgrounded commands, and any number of sent and/or received files. Commands will be executed in command creation order. For example, to send a file 'foo' and display the contents on a remote VM:
cc send foo
cc exec cat foo
Files to be sent must be in the filepath directory, as set by the -filepath flag when launching minimega.
Executed commands can have their stdio tied to pipes used by the plumb and pipe APIs. To use named pipes, simply specify stdin, stdout, or stderr as a key=value pair. For example:
cc exec stderr=foo cat server.log
cc background stdin=foo stdout=bar /usr/bin/program
Executed commands can also be marked to be sent to miniccc clients only once. This will prevent the command from being sent again if the client restarts (for example, after a reboot).
cc exec-once shutdown -r now
Responses are organized in a structure within
Responses to executed commands (not backgrounded) will include the command's exit code, which can be displayed with the 'exitcode' command.
Filters may be set to limit which clients may execute a posted command. For example, to filter on VMs that are running windows and have a specific IP.
cc filter os=windows ip=10.0.0.1
Users can also filter by VM tags. For example, to filter on VMs that have the tag with key foo and value bar set:
cc filter tag=foo:bar
If users wish, they may drop the tag= prefix and key=value pairs will be treated as tags:
cc filter foo=bar
Users can also filter by any column in "vm info" using a similar syntax:
cc filter name=server
cc filter vlan=DMZ
"vm info" columns take precedence over tags when both define the same key.
"cc mount" allows direct access to a guest's filesystem over the command and
control connection. When given a VM uuid or name and a path, the VM's
filesystem is mounted to the local machine at the provided path. "cc mount"
without arguments displays the existing mounts. Users can use "clear cc mount"
to unmount the filesystem of one or all VMs. This should be done before killing
or stopping the VM ("clear namespace
"cc tunnel" allows users to tunnel TCP connections to a local port through a VM to a remote port. The local port will be created on the minimega cluster host that the tunneling VM is running on. The remote port can be on the same VM or on a different VM the tunneling VM has network access to.
"cc test-conn" allows users to test network connectivity from a guest to the given IP or domain name and port. The wait timeout should be specified as a Go duration string (e.g. 5s, 1m). If "udp" is used, a "base64 udp packet" that will generate a valid response must be specified. Results of the test will be written to the command's STDOUT file, whether it passed or failed. An example test is as follows:
cc test-conn tcp 10.0.0.68 443 wait 10s
If the above test passes, STDOUT for the command will contain the following:
10.0.0.68:443 | pass
If it fails, STDOUT will instead contain the following:
10.0.0.68:443 | fail
For more documentation, see the article "Command and Control API Tutorial".
cc_tunnel_list(vm)
¶
Variants:
cc tunnel list
Command and control for VMs running the miniccc client. Commands may include regular commands, backgrounded commands, and any number of sent and/or received files. Commands will be executed in command creation order. For example, to send a file 'foo' and display the contents on a remote VM:
cc send foo
cc exec cat foo
Files to be sent must be in the filepath directory, as set by the -filepath flag when launching minimega.
Executed commands can have their stdio tied to pipes used by the plumb and pipe APIs. To use named pipes, simply specify stdin, stdout, or stderr as a key=value pair. For example:
cc exec stderr=foo cat server.log
cc background stdin=foo stdout=bar /usr/bin/program
Executed commands can also be marked to be sent to miniccc clients only once. This will prevent the command from being sent again if the client restarts (for example, after a reboot).
cc exec-once shutdown -r now
Responses are organized in a structure within
Responses to executed commands (not backgrounded) will include the command's exit code, which can be displayed with the 'exitcode' command.
Filters may be set to limit which clients may execute a posted command. For example, to filter on VMs that are running windows and have a specific IP.
cc filter os=windows ip=10.0.0.1
Users can also filter by VM tags. For example, to filter on VMs that have the tag with key foo and value bar set:
cc filter tag=foo:bar
If users wish, they may drop the tag= prefix and key=value pairs will be treated as tags:
cc filter foo=bar
Users can also filter by any column in "vm info" using a similar syntax:
cc filter name=server
cc filter vlan=DMZ
"vm info" columns take precedence over tags when both define the same key.
"cc mount" allows direct access to a guest's filesystem over the command and
control connection. When given a VM uuid or name and a path, the VM's
filesystem is mounted to the local machine at the provided path. "cc mount"
without arguments displays the existing mounts. Users can use "clear cc mount"
to unmount the filesystem of one or all VMs. This should be done before killing
or stopping the VM ("clear namespace
"cc tunnel" allows users to tunnel TCP connections to a local port through a VM to a remote port. The local port will be created on the minimega cluster host that the tunneling VM is running on. The remote port can be on the same VM or on a different VM the tunneling VM has network access to.
"cc test-conn" allows users to test network connectivity from a guest to the given IP or domain name and port. The wait timeout should be specified as a Go duration string (e.g. 5s, 1m). If "udp" is used, a "base64 udp packet" that will generate a valid response must be specified. Results of the test will be written to the command's STDOUT file, whether it passed or failed. An example test is as follows:
cc test-conn tcp 10.0.0.68 443 wait 10s
If the above test passes, STDOUT for the command will contain the following:
10.0.0.68:443 | pass
If it fails, STDOUT will instead contain the following:
10.0.0.68:443 | fail
For more documentation, see the article "Command and Control API Tutorial".
check()
¶
Variants: check
minimega maintains a list of external packages that it depends on, such as qemu. Calling check will attempt to find each of these executables in the available path and check to make sure they meet the minimum version requirements. Returns errors for all missing executables and all minimum versions not met.
clear_all()
¶
Variants: clear all
Runs all the "clear ..." handlers on the local instance -- as close to nuke as you can get without restarting minimega. Restarting minimega is preferable.
clear_background_status()
¶
Variants: clear background-status
Clear background-status information
clear_capture(netflow_or_pcap=None)
¶
Variants:
clear capture
Resets state for captures across the namespace. See "help capture" for more information.
clear_cc()
¶
Variants: clear cc
Resets state for the command and control infrastructure provided by minimega. See "help cc" for more information.
clear_cc_commands()
¶
Variants: clear cc commands
Resets state for the command and control infrastructure provided by minimega. See "help cc" for more information.
clear_cc_filter()
¶
Variants: clear cc filter
Resets state for the command and control infrastructure provided by minimega. See "help cc" for more information.
clear_cc_mount(uuid=None)
¶
Variants:
clear cc mount
unmount VM filesystem
clear_cc_prefix()
¶
Variants: clear cc prefix
Resets state for the command and control infrastructure provided by minimega. See "help cc" for more information.
clear_cc_responses()
¶
Variants: clear cc responses
Resets state for the command and control infrastructure provided by minimega. See "help cc" for more information.
clear_deploy_flags()
¶
Variants: clear deploy flags
Reset the deploy flags to their default value, which is equal to the launch flags used when launching minimega.
clear_history()
¶
Variants: clear history
Reset the command history. See "help history" for more information.
clear_log()
¶
Variants: clear log
Resets state for logging. See "help log ..." for more information.
clear_log_file()
¶
Variants: clear log file
Resets state for logging. See "help log ..." for more information.
clear_log_filter()
¶
Variants: clear log filter
Resets state for logging. See "help log ..." for more information.
clear_log_level()
¶
Variants: clear log level
Resets state for logging. See "help log ..." for more information.
clear_log_mesh()
¶
Variants: clear log mesh
Resets state for logging. See "help log ..." for more information.
clear_log_ring()
¶
Variants: clear log ring
Resets state for logging. See "help log ..." for more information.
clear_log_stderr()
¶
Variants: clear log stderr
Resets state for logging. See "help log ..." for more information.
clear_log_syslog()
¶
Variants: clear log syslog
Resets state for logging. See "help log ..." for more information.
clear_optimize()
¶
Variants: clear optimize
Resets state for virtualization optimizations. See "help optimize" for more information.
clear_optimize_affinity(filter=None)
¶
Variants:
clear optimize affinity
Resets state for virtualization optimizations. See "help optimize" for more information.
clear_optimize_hugepages()
¶
Variants: clear optimize hugepages
Resets state for virtualization optimizations. See "help optimize" for more information.
clear_optimize_ksm()
¶
Variants: clear optimize ksm
Resets state for virtualization optimizations. See "help optimize" for more information.
clear_pipe(pipe=None)
¶
Variants:
clear pipe
reset pipe state
clear_pipe_log(pipe)
¶
Variants:
clear pipe
reset pipe state
clear_pipe_mode(pipe)
¶
Variants:
clear pipe
reset pipe state
clear_pipe_via(pipe)
¶
Variants:
clear pipe
reset pipe state
clear_plumb(pipeline=None)
¶
Variants:
clear plumb
reset plumber state
clear_qos(vm, tap=None)
¶
Variants:
clear qos
Remove QoS constraints from a VM's interface. To clear QoS from all interfaces for a VM, use the wildcard:
clear qos foo all
See "vm start" for a full description of allowable targets.
clear_router(vm=None)
¶
Variants:
clear router
clear_router_dhcp(vm, listen=None)
¶
Variants:
clear router
clear_router_dhcp_dns(vm, listen)
¶
Variants:
clear router
clear_router_dhcp_range(vm, listen)
¶
Variants:
clear router
clear_router_dhcp_router(vm, listen)
¶
Variants:
clear router
clear_router_dhcp_static(vm, listen, mac=None)
¶
Variants:
clear router
clear_router_dns(vm, ip=None)
¶
Variants:
clear router
clear_router_fw(vm)
¶
Variants:
clear router
clear_router_gw(vm)
¶
Variants:
clear router
clear_router_interface(vm, network=None, IPv4_MASK=None, lo=None)
¶
Variants:
clear router
clear_router_ra(vm, subnet=None)
¶
Variants:
clear router
clear_router_rid(vm)
¶
Variants:
clear router
clear_router_route(vm, static_or_namedstatic=None)
¶
Variants:
clear router
clear_router_route_bgp(vm, processname, local_or_neighbor=None)
¶
Variants:
clear router
clear_router_route_bgp_rrclient(vm, processname)
¶
Variants:
clear router
clear_router_route_ospf(vm, area=None, network=None)
¶
Variants:
clear router
clear_router_route_ospf_export(vm, area, Ipv4_Mask)
¶
Variants:
clear router
clear_router_route_static(vm, network, staticroutename=None)
¶
Variants:
clear router
clear_router_upstream(vm)
¶
Variants:
clear router
clear_tap()
¶
Variants: clear tap
Reset state for taps. To delete individual taps, use "tap delete".
"clear tap mirror" can be used to delete one or all mirrors. Mirrors are identified by the destination for the mirror since a source can have multiple mirrors. "clear tap" also deletes all mirrors.
Only affects taps on the local node.
clear_tap_mirror(name=None, vm=None, interface=None)
¶
Variants:
clear tap mirror
Reset state for taps. To delete individual taps, use "tap delete".
"clear tap mirror" can be used to delete one or all mirrors. Mirrors are identified by the destination for the mirror since a source can have multiple mirrors. "clear tap" also deletes all mirrors.
Only affects taps on the local node.
clear_vlans(prefix=None)
¶
Variants:
clear vlans
Clear one or more aliases, freeing the VLANs for reuse. You should only clear allocated VLANs once you have killed all the VMs connected to them.
By default, "clear vlans" only clears aliases for the current namespace. If given "all" as the prefix, all state about managed VLANs is cleared across all namespaces, including blacklisted VLANS. You should only use this if you want a completely clean slate.
clear_vm_config()
¶
Variants: clear vm config
reset one or more configurations to default value
clear_vm_config_android_adb()
¶
Variants: clear vm config android-adb
reset one or more configurations to default value
clear_vm_config_android_avd()
¶
Variants: clear vm config android-avd
reset one or more configurations to default value
clear_vm_config_android_avd_dir()
¶
Variants: clear vm config android-avd-dir
reset one or more configurations to default value
clear_vm_config_android_console_base_port()
¶
Variants: clear vm config android-console-base-port
reset one or more configurations to default value
clear_vm_config_android_emulator()
¶
Variants: clear vm config android-emulator
reset one or more configurations to default value
clear_vm_config_android_extra_args()
¶
Variants: clear vm config android-extra-args
reset one or more configurations to default value
clear_vm_config_android_no_window()
¶
Variants: clear vm config android-no-window
reset one or more configurations to default value
clear_vm_config_android_sdk()
¶
Variants: clear vm config android-sdk
reset one or more configurations to default value
clear_vm_config_android_writable_system()
¶
Variants: clear vm config android-writable-system
reset one or more configurations to default value
clear_vm_config_append()
¶
Variants: clear vm config append
reset one or more configurations to default value
clear_vm_config_backchannel()
¶
Variants: clear vm config backchannel
reset one or more configurations to default value
clear_vm_config_baremetal()
¶
Variants: clear vm config baremetal
reset one or more configurations to default value
clear_vm_config_baremetal_network_driver()
¶
Variants: clear vm config baremetal-network-driver
reset one or more configurations to default value
clear_vm_config_bidirectional_copy_paste()
¶
Variants: clear vm config bidirectional-copy-paste
reset one or more configurations to default value
clear_vm_config_bonds()
¶
Variants: clear vm config bonds
reset one or more configurations to default value
clear_vm_config_cdrom()
¶
Variants: clear vm config cdrom
reset one or more configurations to default value
clear_vm_config_colocate()
¶
Variants: clear vm config colocate
reset one or more configurations to default value
clear_vm_config_cores()
¶
Variants: clear vm config cores
reset one or more configurations to default value
clear_vm_config_coschedule()
¶
Variants: clear vm config coschedule
reset one or more configurations to default value
clear_vm_config_cpu()
¶
Variants: clear vm config cpu
reset one or more configurations to default value
clear_vm_config_disks()
¶
Variants: clear vm config disks
reset one or more configurations to default value
clear_vm_config_fifos()
¶
Variants: clear vm config fifos
reset one or more configurations to default value
clear_vm_config_filesystem()
¶
Variants: clear vm config filesystem
reset one or more configurations to default value
clear_vm_config_hostname()
¶
Variants: clear vm config hostname
reset one or more configurations to default value
clear_vm_config_init()
¶
Variants: clear vm config init
reset one or more configurations to default value
clear_vm_config_initrd()
¶
Variants: clear vm config initrd
reset one or more configurations to default value
clear_vm_config_kernel()
¶
Variants: clear vm config kernel
reset one or more configurations to default value
clear_vm_config_machine()
¶
Variants: clear vm config machine
reset one or more configurations to default value
clear_vm_config_memory()
¶
Variants: clear vm config memory
reset one or more configurations to default value
clear_vm_config_migrate()
¶
Variants: clear vm config migrate
reset one or more configurations to default value
clear_vm_config_networks()
¶
Variants: clear vm config networks
reset one or more configurations to default value
clear_vm_config_preinit()
¶
Variants: clear vm config preinit
reset one or more configurations to default value
clear_vm_config_qemu()
¶
Variants: clear vm config qemu
reset one or more configurations to default value
clear_vm_config_qemu_append()
¶
Variants: clear vm config qemu-append
reset one or more configurations to default value
clear_vm_config_qemu_override()
¶
Variants: clear vm config qemu-override
reset one or more configurations to default value
clear_vm_config_schedule()
¶
Variants: clear vm config schedule
reset one or more configurations to default value
clear_vm_config_serial_ports()
¶
Variants: clear vm config serial-ports
reset one or more configurations to default value
clear_vm_config_snapshot()
¶
Variants: clear vm config snapshot
reset one or more configurations to default value
clear_vm_config_sockets()
¶
Variants: clear vm config sockets
reset one or more configurations to default value
clear_vm_config_state()
¶
Variants: clear vm config state
reset one or more configurations to default value
clear_vm_config_tag(key)
¶
Variants:
clear vm config tag
Remove tags in the same manner as "clear vm tag".
clear_vm_config_tags()
¶
Variants: clear vm config tags
reset one or more configurations to default value
clear_vm_config_threads()
¶
Variants: clear vm config threads
reset one or more configurations to default value
clear_vm_config_tpm_socket()
¶
Variants: clear vm config tpm-socket
reset one or more configurations to default value
clear_vm_config_usb_use_xhci()
¶
Variants: clear vm config usb-use-xhci
reset one or more configurations to default value
clear_vm_config_uuid()
¶
Variants: clear vm config uuid
reset one or more configurations to default value
clear_vm_config_vcpus()
¶
Variants: clear vm config vcpus
reset one or more configurations to default value
clear_vm_config_vga()
¶
Variants: clear vm config vga
reset one or more configurations to default value
clear_vm_config_virtio_ports()
¶
Variants: clear vm config virtio-ports
reset one or more configurations to default value
clear_vm_config_volume()
¶
Variants: clear vm config volume
reset one or more configurations to default value
clear_vm_net_bond(vm, name=None)
¶
Variants:
clear vm net bond
remove net bonds from a VM
clear_vm_tag(vm=None, tag=None)
¶
Variants:
clear vm tag
Clears one, many, or all tags from a virtual machine.
Clear the tag "foo" from VM 0:
clear vm tag 0 foo
Clear the tag "foo" from all VMs:
clear vm tag all foo
Clear all tags from VM 0:
clear vm tag 0
Clear all tags from all VMs:
clear vm tag all
clear_vnc()
¶
Variants: clear vnc
Resets the state for VNC recordings. See "help vnc" for more information.
debug()
¶
Variants: debug
debug can help find and resolve issues with minimega. Without arguments, debug prints the go version, the number of goroutines, and the number of cgo calls.
With arguments, debug writes files that can be read using "go tool pprof":
- memory: sampling of all heap allocations
- cpu: starts CPU profiling (must be stopped before read)
- goroutine: stack traces of all current goroutines
debug_cpu_start(file)
¶
Variants:
debug cpu start
debug can help find and resolve issues with minimega. Without arguments, debug prints the go version, the number of goroutines, and the number of cgo calls.
With arguments, debug writes files that can be read using "go tool pprof":
- memory: sampling of all heap allocations
- cpu: starts CPU profiling (must be stopped before read)
- goroutine: stack traces of all current goroutines
debug_cpu_stop()
¶
Variants: debug cpu stop
debug can help find and resolve issues with minimega. Without arguments, debug prints the go version, the number of goroutines, and the number of cgo calls.
With arguments, debug writes files that can be read using "go tool pprof":
- memory: sampling of all heap allocations
- cpu: starts CPU profiling (must be stopped before read)
- goroutine: stack traces of all current goroutines
debug_goroutine(file)
¶
Variants:
debug goroutine
debug can help find and resolve issues with minimega. Without arguments, debug prints the go version, the number of goroutines, and the number of cgo calls.
With arguments, debug writes files that can be read using "go tool pprof":
- memory: sampling of all heap allocations
- cpu: starts CPU profiling (must be stopped before read)
- goroutine: stack traces of all current goroutines
debug_memory(file)
¶
Variants:
debug memory
debug can help find and resolve issues with minimega. Without arguments, debug prints the go version, the number of goroutines, and the number of cgo calls.
With arguments, debug writes files that can be read using "go tool pprof":
- memory: sampling of all heap allocations
- cpu: starts CPU profiling (must be stopped before read)
- goroutine: stack traces of all current goroutines
deploy_flags(minimega=None)
¶
Variants:
deploy flags
deploy copies and runs minimega on remote nodes, facilitating the deployment of minimega to a cluster. By default, deploy will launch minimega with the same flags used when starting this minimega, and add the -nostdin flag so that the remote minimega can be backgrounded. For example, to launch minimega on nodes kn1 and kn2:
deploy launch kn[1-2]
deploy uses scp/ssh to copy and run minimega. By default, minimega will attempt to login to remote nodes using the current user. This can be changed by providing a username. If using a different username, you can optionally specify the use of sudo when launching minimega (you typically need to run minimega as root).
In order to override the flags passed to remote minimega instances, provide flags with 'deploy flags'. For example:
deploy flags -base=/opt/minimega -level=debug
To customize stdout and stderr, use 'deploy stdout' and 'deploy stderr':
deploy stdout /var/log/minimega.out
deploy stderr /var/log/minimega.err
By default, stdout and stderr are written to /dev/null.
deploy_launch(hosts, user=None, sudo=None)
¶
Variants:
deploy launch
deploy copies and runs minimega on remote nodes, facilitating the deployment of minimega to a cluster. By default, deploy will launch minimega with the same flags used when starting this minimega, and add the -nostdin flag so that the remote minimega can be backgrounded. For example, to launch minimega on nodes kn1 and kn2:
deploy launch kn[1-2]
deploy uses scp/ssh to copy and run minimega. By default, minimega will attempt to login to remote nodes using the current user. This can be changed by providing a username. If using a different username, you can optionally specify the use of sudo when launching minimega (you typically need to run minimega as root).
In order to override the flags passed to remote minimega instances, provide flags with 'deploy flags'. For example:
deploy flags -base=/opt/minimega -level=debug
To customize stdout and stderr, use 'deploy stdout' and 'deploy stderr':
deploy stdout /var/log/minimega.out
deploy stderr /var/log/minimega.err
By default, stdout and stderr are written to /dev/null.
deploy_stderr(path=None)
¶
Variants:
deploy stderr
deploy copies and runs minimega on remote nodes, facilitating the deployment of minimega to a cluster. By default, deploy will launch minimega with the same flags used when starting this minimega, and add the -nostdin flag so that the remote minimega can be backgrounded. For example, to launch minimega on nodes kn1 and kn2:
deploy launch kn[1-2]
deploy uses scp/ssh to copy and run minimega. By default, minimega will attempt to login to remote nodes using the current user. This can be changed by providing a username. If using a different username, you can optionally specify the use of sudo when launching minimega (you typically need to run minimega as root).
In order to override the flags passed to remote minimega instances, provide flags with 'deploy flags'. For example:
deploy flags -base=/opt/minimega -level=debug
To customize stdout and stderr, use 'deploy stdout' and 'deploy stderr':
deploy stdout /var/log/minimega.out
deploy stderr /var/log/minimega.err
By default, stdout and stderr are written to /dev/null.
deploy_stdout(path=None)
¶
Variants:
deploy stdout
deploy copies and runs minimega on remote nodes, facilitating the deployment of minimega to a cluster. By default, deploy will launch minimega with the same flags used when starting this minimega, and add the -nostdin flag so that the remote minimega can be backgrounded. For example, to launch minimega on nodes kn1 and kn2:
deploy launch kn[1-2]
deploy uses scp/ssh to copy and run minimega. By default, minimega will attempt to login to remote nodes using the current user. This can be changed by providing a username. If using a different username, you can optionally specify the use of sudo when launching minimega (you typically need to run minimega as root).
In order to override the flags passed to remote minimega instances, provide flags with 'deploy flags'. For example:
deploy flags -base=/opt/minimega -level=debug
To customize stdout and stderr, use 'deploy stdout' and 'deploy stderr':
deploy stdout /var/log/minimega.out
deploy stderr /var/log/minimega.err
By default, stdout and stderr are written to /dev/null.
disk_commit(image)
¶
Variants:
disk commit
Commits the contents of 'image' to its backing file. 'image' is left unchanged, but may be deleted if not needed. Example of committing:
disk commit myimage.qcow2
disk_create(qcow2_or_raw, image, size)
¶
Variants:
disk create
Creates a new qcow2 or raw disk of the specified size.
Example of creating a new disk:
disk create qcow2 foo.qcow2 100G
The size argument is the size in bytes, or using optional suffixes "k" (kilobyte), "M" (megabyte), "G" (gigabyte), "T" (terabyte).
disk_info(image, recursive=None)
¶
Variants:
disk info
Provides information about a disk such as format, virtual/actual size, and backing file. The 'recursive' flag can be set to print out full details for all backing images.
disk_inject_delete_files(image, files)
¶
Variants:
disk inject
Injects files into a disk.
To inject files into an image:
disk inject window7_miniccc.qc2 files "miniccc":"Program Files/miniccc"
Each argument after the image should be a source and destination pair, separated by a ':'. If the file paths contain spaces, use double quotes. Optionally, you may specify a partition (partition 1 will be used by default):
disk inject window7_miniccc.qc2:2 files "miniccc":"Program Files/miniccc"
You may also specify that there is no partition on the disk, if your filesystem was directly written to the disk (this is highly unusual):
disk inject partitionless_disk.qc2:none files /miniccc:/miniccc
You can optionally specify mount arguments to use with inject. Multiple options should be quoted. For example:
disk inject foo.qcow2 options "-t fat -o offset=100" files foo:bar
To delete files or directories from an image, specify the delete keyword before listing the files or directories to delete from the image, separated by a comma. For example:
disk inject window7_miniccc.qc2 delete files "Program Files/miniccc.exe"
disk inject window7_miniccc.qc2 delete files "Users/Administrator/Documents/TestDir"
disk inject window7_miniccc.qc2 delete files "foo.txt,Temp/bar.zip"
disk_inject_files(image, files)
¶
Variants:
disk inject
Injects files into a disk.
To inject files into an image:
disk inject window7_miniccc.qc2 files "miniccc":"Program Files/miniccc"
Each argument after the image should be a source and destination pair, separated by a ':'. If the file paths contain spaces, use double quotes. Optionally, you may specify a partition (partition 1 will be used by default):
disk inject window7_miniccc.qc2:2 files "miniccc":"Program Files/miniccc"
You may also specify that there is no partition on the disk, if your filesystem was directly written to the disk (this is highly unusual):
disk inject partitionless_disk.qc2:none files /miniccc:/miniccc
You can optionally specify mount arguments to use with inject. Multiple options should be quoted. For example:
disk inject foo.qcow2 options "-t fat -o offset=100" files foo:bar
To delete files or directories from an image, specify the delete keyword before listing the files or directories to delete from the image, separated by a comma. For example:
disk inject window7_miniccc.qc2 delete files "Program Files/miniccc.exe"
disk inject window7_miniccc.qc2 delete files "Users/Administrator/Documents/TestDir"
disk inject window7_miniccc.qc2 delete files "foo.txt,Temp/bar.zip"
disk_inject_options_delete_files(image, options, files)
¶
Variants:
disk inject
Injects files into a disk.
To inject files into an image:
disk inject window7_miniccc.qc2 files "miniccc":"Program Files/miniccc"
Each argument after the image should be a source and destination pair, separated by a ':'. If the file paths contain spaces, use double quotes. Optionally, you may specify a partition (partition 1 will be used by default):
disk inject window7_miniccc.qc2:2 files "miniccc":"Program Files/miniccc"
You may also specify that there is no partition on the disk, if your filesystem was directly written to the disk (this is highly unusual):
disk inject partitionless_disk.qc2:none files /miniccc:/miniccc
You can optionally specify mount arguments to use with inject. Multiple options should be quoted. For example:
disk inject foo.qcow2 options "-t fat -o offset=100" files foo:bar
To delete files or directories from an image, specify the delete keyword before listing the files or directories to delete from the image, separated by a comma. For example:
disk inject window7_miniccc.qc2 delete files "Program Files/miniccc.exe"
disk inject window7_miniccc.qc2 delete files "Users/Administrator/Documents/TestDir"
disk inject window7_miniccc.qc2 delete files "foo.txt,Temp/bar.zip"
disk_inject_options_files(image, options, files)
¶
Variants:
disk inject
Injects files into a disk.
To inject files into an image:
disk inject window7_miniccc.qc2 files "miniccc":"Program Files/miniccc"
Each argument after the image should be a source and destination pair, separated by a ':'. If the file paths contain spaces, use double quotes. Optionally, you may specify a partition (partition 1 will be used by default):
disk inject window7_miniccc.qc2:2 files "miniccc":"Program Files/miniccc"
You may also specify that there is no partition on the disk, if your filesystem was directly written to the disk (this is highly unusual):
disk inject partitionless_disk.qc2:none files /miniccc:/miniccc
You can optionally specify mount arguments to use with inject. Multiple options should be quoted. For example:
disk inject foo.qcow2 options "-t fat -o offset=100" files foo:bar
To delete files or directories from an image, specify the delete keyword before listing the files or directories to delete from the image, separated by a comma. For example:
disk inject window7_miniccc.qc2 delete files "Program Files/miniccc.exe"
disk inject window7_miniccc.qc2 delete files "Users/Administrator/Documents/TestDir"
disk inject window7_miniccc.qc2 delete files "foo.txt,Temp/bar.zip"
disk_rebase(image, backing=None)
¶
Variants:
disk rebase
Rebases the image 'image' onto a new backing file 'backing'. Using 'rebase' will write any differences between the original backing file and the new backing file to 'image'.
disk rebase myimage.qcow2 base.qcow2
Alternatively, 'set-backing' can be used to change the backing file pointer without any changes to the images.
disk set-backing myimage.qcow2 base.qcow2
The 'backing' argument can be omitted, causing all backing data to be written to 'image' making it independent.
disk rebase myimage.qcow2
Users may use paths relative to the 'files' directory or absolute paths for inputs; however, the backing path will always be relative to the rebased image.
disk_resize(image, size)
¶
Variants:
disk resize
Changes the size of a disk. IMPORTANT: Before shrinking an image, ensure changes have been made within the VM's OS to reduce the filesystem. Similarly, changes in the VM's OS will be required to grow the file system after increasing the disk size.
The size argument is the size in bytes, or using optional suffixes "k"
(kilobyte), "M" (megabyte), "G" (gigabyte), "T" (terabyte).
It can be given as an absolute value or a relative +/- offset.
Examples:
disk resize myimage.qcow2 50G
disk resize myimage.qcow2 +512M
disk_set_backing(image, backing=None)
¶
Variants:
disk set-backing
Rebases the image 'image' onto a new backing file 'backing'. Using 'rebase' will write any differences between the original backing file and the new backing file to 'image'.
disk rebase myimage.qcow2 base.qcow2
Alternatively, 'set-backing' can be used to change the backing file pointer without any changes to the images.
disk set-backing myimage.qcow2 base.qcow2
The 'backing' argument can be omitted, causing all backing data to be written to 'image' making it independent.
disk rebase myimage.qcow2
Users may use paths relative to the 'files' directory or absolute paths for inputs; however, the backing path will always be relative to the rebased image.
disk_snapshot(image, dst=None)
¶
Variants:
disk snapshot
Creates a new qcow2 image 'dst' backed by 'image'.
Example of taking a snapshot of a disk:
disk snapshot windows7.qc2 window7_miniccc.qc2
If the destination name is omitted, a name will be randomly generated and the snapshot will be stored in the 'files' directory. Snapshots are always created in the 'files' directory.
Users may use paths relative to the 'files' directory or absolute paths for inputs; however, the backing path will always be relative to the new image.
dnsmasq()
¶
Variants: dnsmasq
Start a dhcp/dns server on a specified IP with a specified range. For example, to start a DHCP server on IP 10.0.0.1 serving the range 10.0.0.2 - 10.0.254.254:
dnsmasq start 10.0.0.1 10.0.0.2 10.0.254.254
To start only a from a config file:
dnsmasq start /path/to/config
To list running dnsmasq servers, invoke dnsmasq with no arguments. To kill a running dnsmasq server, specify its ID from the list of running servers. For example, to kill dnsmasq server 2:
dnsmasq kill 2
To kill all running dnsmasq servers, pass all as the ID:
dnsmasq kill all
dnsmasq will provide DNS service from the host, as well as from /etc/hosts. You can specify an additional config file for dnsmasq by providing a file as an additional argument.
dnsmasq start 10.0.0.1 10.0.0.2 10.0.254.254 /tmp/dnsmasq-extra.conf
NOTE: If specifying an additional config file, you must provide the full path to the file.
dnsmasq_configure_dns(ID, ip=None, hostname=None)
¶
Variants:
dnsmasq configure
Configuration options for running dnsmasq instances. Define a static IP allocation, specify a hostname->IP mapping for DNS, configure upstream DNS servers (useful when forwarding/NAT is enabled), or set DHCP options.
To list all existing static IP allocations on the first running dnsmasq server, do the following:
dnsmasq configure 0 ip
To set up a static IP allocation for a VM with the MAC address 00:11:22:33:44:55:
dnsmasq configure 0 ip 00:11:22:33:44:55 172.17.0.50
To see DNS entries:
dnsmasq configure 0 dns
To add a DNS entry:
dnsmasq configure 0 dns 172.17.0.50 example.com
To see upstream DNS servers:
dnsmasq configure 0 upstream
To add an upstream DNS server:
dnsmasq configure 0 upstream server 1.1.1.1
To see a list of all DHCP options:
dnsmasq configure 0 options
To add a DHCP option:
dnsmasq configure 0 options option:dns-server,172.17.0.254
dnsmasq_configure_dns_upstream(ID)
¶
Variants:
dnsmasq configure
Configuration options for running dnsmasq instances. Define a static IP allocation, specify a hostname->IP mapping for DNS, configure upstream DNS servers (useful when forwarding/NAT is enabled), or set DHCP options.
To list all existing static IP allocations on the first running dnsmasq server, do the following:
dnsmasq configure 0 ip
To set up a static IP allocation for a VM with the MAC address 00:11:22:33:44:55:
dnsmasq configure 0 ip 00:11:22:33:44:55 172.17.0.50
To see DNS entries:
dnsmasq configure 0 dns
To add a DNS entry:
dnsmasq configure 0 dns 172.17.0.50 example.com
To see upstream DNS servers:
dnsmasq configure 0 upstream
To add an upstream DNS server:
dnsmasq configure 0 upstream server 1.1.1.1
To see a list of all DHCP options:
dnsmasq configure 0 options
To add a DHCP option:
dnsmasq configure 0 options option:dns-server,172.17.0.254
dnsmasq_configure_dns_upstream_server(ID, ip)
¶
Variants:
dnsmasq configure
Configuration options for running dnsmasq instances. Define a static IP allocation, specify a hostname->IP mapping for DNS, configure upstream DNS servers (useful when forwarding/NAT is enabled), or set DHCP options.
To list all existing static IP allocations on the first running dnsmasq server, do the following:
dnsmasq configure 0 ip
To set up a static IP allocation for a VM with the MAC address 00:11:22:33:44:55:
dnsmasq configure 0 ip 00:11:22:33:44:55 172.17.0.50
To see DNS entries:
dnsmasq configure 0 dns
To add a DNS entry:
dnsmasq configure 0 dns 172.17.0.50 example.com
To see upstream DNS servers:
dnsmasq configure 0 upstream
To add an upstream DNS server:
dnsmasq configure 0 upstream server 1.1.1.1
To see a list of all DHCP options:
dnsmasq configure 0 options
To add a DHCP option:
dnsmasq configure 0 options option:dns-server,172.17.0.254
dnsmasq_configure_ip(ID, mac=None, ip=None)
¶
Variants:
dnsmasq configure
Configuration options for running dnsmasq instances. Define a static IP allocation, specify a hostname->IP mapping for DNS, configure upstream DNS servers (useful when forwarding/NAT is enabled), or set DHCP options.
To list all existing static IP allocations on the first running dnsmasq server, do the following:
dnsmasq configure 0 ip
To set up a static IP allocation for a VM with the MAC address 00:11:22:33:44:55:
dnsmasq configure 0 ip 00:11:22:33:44:55 172.17.0.50
To see DNS entries:
dnsmasq configure 0 dns
To add a DNS entry:
dnsmasq configure 0 dns 172.17.0.50 example.com
To see upstream DNS servers:
dnsmasq configure 0 upstream
To add an upstream DNS server:
dnsmasq configure 0 upstream server 1.1.1.1
To see a list of all DHCP options:
dnsmasq configure 0 options
To add a DHCP option:
dnsmasq configure 0 options option:dns-server,172.17.0.254
dnsmasq_configure_options(ID, optionstring=None)
¶
Variants:
dnsmasq configure
Configuration options for running dnsmasq instances. Define a static IP allocation, specify a hostname->IP mapping for DNS, configure upstream DNS servers (useful when forwarding/NAT is enabled), or set DHCP options.
To list all existing static IP allocations on the first running dnsmasq server, do the following:
dnsmasq configure 0 ip
To set up a static IP allocation for a VM with the MAC address 00:11:22:33:44:55:
dnsmasq configure 0 ip 00:11:22:33:44:55 172.17.0.50
To see DNS entries:
dnsmasq configure 0 dns
To add a DNS entry:
dnsmasq configure 0 dns 172.17.0.50 example.com
To see upstream DNS servers:
dnsmasq configure 0 upstream
To add an upstream DNS server:
dnsmasq configure 0 upstream server 1.1.1.1
To see a list of all DHCP options:
dnsmasq configure 0 options
To add a DHCP option:
dnsmasq configure 0 options option:dns-server,172.17.0.254
dnsmasq_kill(id)
¶
Variants:
dnsmasq kill
Start a dhcp/dns server on a specified IP with a specified range. For example, to start a DHCP server on IP 10.0.0.1 serving the range 10.0.0.2 - 10.0.254.254:
dnsmasq start 10.0.0.1 10.0.0.2 10.0.254.254
To start only a from a config file:
dnsmasq start /path/to/config
To list running dnsmasq servers, invoke dnsmasq with no arguments. To kill a running dnsmasq server, specify its ID from the list of running servers. For example, to kill dnsmasq server 2:
dnsmasq kill 2
To kill all running dnsmasq servers, pass all as the ID:
dnsmasq kill all
dnsmasq will provide DNS service from the host, as well as from /etc/hosts. You can specify an additional config file for dnsmasq by providing a file as an additional argument.
dnsmasq start 10.0.0.1 10.0.0.2 10.0.254.254 /tmp/dnsmasq-extra.conf
NOTE: If specifying an additional config file, you must provide the full path to the file.
dnsmasq_start(listen=None, low=None, high=None, config=None)
¶
Variants:
dnsmasq start
Start a dhcp/dns server on a specified IP with a specified range. For example, to start a DHCP server on IP 10.0.0.1 serving the range 10.0.0.2 - 10.0.254.254:
dnsmasq start 10.0.0.1 10.0.0.2 10.0.254.254
To start only a from a config file:
dnsmasq start /path/to/config
To list running dnsmasq servers, invoke dnsmasq with no arguments. To kill a running dnsmasq server, specify its ID from the list of running servers. For example, to kill dnsmasq server 2:
dnsmasq kill 2
To kill all running dnsmasq servers, pass all as the ID:
dnsmasq kill all
dnsmasq will provide DNS service from the host, as well as from /etc/hosts. You can specify an additional config file for dnsmasq by providing a file as an additional argument.
dnsmasq start 10.0.0.1 10.0.0.2 10.0.254.254 /tmp/dnsmasq-extra.conf
NOTE: If specifying an additional config file, you must provide the full path to the file.
echo(args=None)
¶
Variants:
echo
display input text after comment removal
file_delete(file)
¶
Variants:
file delete
file allows you to transfer and manage files served by minimega in the directory set by the -filepath flag (default is 'base'/files).
To list files currently being served, issue the list command with a directory relative to the served directory:
file list /foo
Issuing "file list /" will list the contents of the served directory.
Files can be deleted with the delete command:
file delete /foo
If a directory is given, the directory will be recursively deleted.
Files are transferred using the get command. When a get command is issued, the node will begin searching for a file matching the path and name within the mesh. If the file exists, it will be transferred to the requesting node. Which file is transferred over the mesh depends on the mode minimega is running in (see the "File transfer with minimega" article for details). When a file transfer begins, control will return to minimega while the transfer completes. If the -hashfiles flag is disabled (the default), and multiple files with the same name but different content exist across the mesh, the "file get" behavior for the file is undefined.
If a directory is specified, that directory will be recursively transferred to the node.
To see files that are currently being transferred, use the status command:
file status
You can also supply globs (wildcards) with the * operator. For example:
file get *.qcow2
file delete *.qcow2
The stream command allows users to stream files through the Response. Each part of the file is returned as a separate response which can then be combined to form the original file. This command blocks until the stream is complete.
file_get(file)
¶
Variants:
file get
file allows you to transfer and manage files served by minimega in the directory set by the -filepath flag (default is 'base'/files).
To list files currently being served, issue the list command with a directory relative to the served directory:
file list /foo
Issuing "file list /" will list the contents of the served directory.
Files can be deleted with the delete command:
file delete /foo
If a directory is given, the directory will be recursively deleted.
Files are transferred using the get command. When a get command is issued, the node will begin searching for a file matching the path and name within the mesh. If the file exists, it will be transferred to the requesting node. Which file is transferred over the mesh depends on the mode minimega is running in (see the "File transfer with minimega" article for details). When a file transfer begins, control will return to minimega while the transfer completes. If the -hashfiles flag is disabled (the default), and multiple files with the same name but different content exist across the mesh, the "file get" behavior for the file is undefined.
If a directory is specified, that directory will be recursively transferred to the node.
To see files that are currently being transferred, use the status command:
file status
You can also supply globs (wildcards) with the * operator. For example:
file get *.qcow2
file delete *.qcow2
The stream command allows users to stream files through the Response. Each part of the file is returned as a separate response which can then be combined to form the original file. This command blocks until the stream is complete.
file_list(path=None, recursive=None)
¶
Variants:
file list
file allows you to transfer and manage files served by minimega in the directory set by the -filepath flag (default is 'base'/files).
To list files currently being served, issue the list command with a directory relative to the served directory:
file list /foo
Issuing "file list /" will list the contents of the served directory.
Files can be deleted with the delete command:
file delete /foo
If a directory is given, the directory will be recursively deleted.
Files are transferred using the get command. When a get command is issued, the node will begin searching for a file matching the path and name within the mesh. If the file exists, it will be transferred to the requesting node. Which file is transferred over the mesh depends on the mode minimega is running in (see the "File transfer with minimega" article for details). When a file transfer begins, control will return to minimega while the transfer completes. If the -hashfiles flag is disabled (the default), and multiple files with the same name but different content exist across the mesh, the "file get" behavior for the file is undefined.
If a directory is specified, that directory will be recursively transferred to the node.
To see files that are currently being transferred, use the status command:
file status
You can also supply globs (wildcards) with the * operator. For example:
file get *.qcow2
file delete *.qcow2
The stream command allows users to stream files through the Response. Each part of the file is returned as a separate response which can then be combined to form the original file. This command blocks until the stream is complete.
file_status()
¶
Variants: file status
file allows you to transfer and manage files served by minimega in the directory set by the -filepath flag (default is 'base'/files).
To list files currently being served, issue the list command with a directory relative to the served directory:
file list /foo
Issuing "file list /" will list the contents of the served directory.
Files can be deleted with the delete command:
file delete /foo
If a directory is given, the directory will be recursively deleted.
Files are transferred using the get command. When a get command is issued, the node will begin searching for a file matching the path and name within the mesh. If the file exists, it will be transferred to the requesting node. Which file is transferred over the mesh depends on the mode minimega is running in (see the "File transfer with minimega" article for details). When a file transfer begins, control will return to minimega while the transfer completes. If the -hashfiles flag is disabled (the default), and multiple files with the same name but different content exist across the mesh, the "file get" behavior for the file is undefined.
If a directory is specified, that directory will be recursively transferred to the node.
To see files that are currently being transferred, use the status command:
file status
You can also supply globs (wildcards) with the * operator. For example:
file get *.qcow2
file delete *.qcow2
The stream command allows users to stream files through the Response. Each part of the file is returned as a separate response which can then be combined to form the original file. This command blocks until the stream is complete.
file_stream(file)
¶
Variants:
file stream
file allows you to transfer and manage files served by minimega in the directory set by the -filepath flag (default is 'base'/files).
To list files currently being served, issue the list command with a directory relative to the served directory:
file list /foo
Issuing "file list /" will list the contents of the served directory.
Files can be deleted with the delete command:
file delete /foo
If a directory is given, the directory will be recursively deleted.
Files are transferred using the get command. When a get command is issued, the node will begin searching for a file matching the path and name within the mesh. If the file exists, it will be transferred to the requesting node. Which file is transferred over the mesh depends on the mode minimega is running in (see the "File transfer with minimega" article for details). When a file transfer begins, control will return to minimega while the transfer completes. If the -hashfiles flag is disabled (the default), and multiple files with the same name but different content exist across the mesh, the "file get" behavior for the file is undefined.
If a directory is specified, that directory will be recursively transferred to the node.
To see files that are currently being transferred, use the status command:
file status
You can also supply globs (wildcards) with the * operator. For example:
file get *.qcow2
file delete *.qcow2
The stream command allows users to stream files through the Response. Each part of the file is returned as a separate response which can then be combined to form the original file. This command blocks until the stream is complete.
history()
¶
Variants: history
history displays a list of all the commands that have been invoked since minimega started on this host, or since the last time the history was cleared. History includes only valid commands and comments. Invalid lines and blank lines are not recorded. There are some commands that interact differently with history, namely read. Instead of recording the "read" command in the history, minimega records all the valid commands executed from the read file in the history. This allows the full execution history to be listed using history.
host()
¶
Variants: host
Report information about hosts in the current namespace:
- cpucommit : total cpu commit
- cpus : number of cpus
- load : system load average
- memcommit : total memory commit in MB
- memtotal : total memory in MB
- memused : memory used in MB
- name : name of the machine
- netcommit : total network interface commit
- rx : RX bandwidth stats (MB/s)
- tx : TX bandwidth stats (MB/s)
- uptime : uptime
- vms : number of VMs
- androidvms : number of active Android VMs counted against the per-host Android port limit
- vmlimit : limit based on coschedule values (-1 is no limit)
All VM-based stats are computed across namespaces.
host_androidvms()
¶
Variants: host androidvms
Report information about hosts in the current namespace:
- cpucommit : total cpu commit
- cpus : number of cpus
- load : system load average
- memcommit : total memory commit in MB
- memtotal : total memory in MB
- memused : memory used in MB
- name : name of the machine
- netcommit : total network interface commit
- rx : RX bandwidth stats (MB/s)
- tx : TX bandwidth stats (MB/s)
- uptime : uptime
- vms : number of VMs
- androidvms : number of active Android VMs counted against the per-host Android port limit
- vmlimit : limit based on coschedule values (-1 is no limit)
All VM-based stats are computed across namespaces.
host_cpucommit()
¶
Variants: host cpucommit
Report information about hosts in the current namespace:
- cpucommit : total cpu commit
- cpus : number of cpus
- load : system load average
- memcommit : total memory commit in MB
- memtotal : total memory in MB
- memused : memory used in MB
- name : name of the machine
- netcommit : total network interface commit
- rx : RX bandwidth stats (MB/s)
- tx : TX bandwidth stats (MB/s)
- uptime : uptime
- vms : number of VMs
- androidvms : number of active Android VMs counted against the per-host Android port limit
- vmlimit : limit based on coschedule values (-1 is no limit)
All VM-based stats are computed across namespaces.
host_cpus()
¶
Variants: host cpus
Report information about hosts in the current namespace:
- cpucommit : total cpu commit
- cpus : number of cpus
- load : system load average
- memcommit : total memory commit in MB
- memtotal : total memory in MB
- memused : memory used in MB
- name : name of the machine
- netcommit : total network interface commit
- rx : RX bandwidth stats (MB/s)
- tx : TX bandwidth stats (MB/s)
- uptime : uptime
- vms : number of VMs
- androidvms : number of active Android VMs counted against the per-host Android port limit
- vmlimit : limit based on coschedule values (-1 is no limit)
All VM-based stats are computed across namespaces.
host_load()
¶
Variants: host load
Report information about hosts in the current namespace:
- cpucommit : total cpu commit
- cpus : number of cpus
- load : system load average
- memcommit : total memory commit in MB
- memtotal : total memory in MB
- memused : memory used in MB
- name : name of the machine
- netcommit : total network interface commit
- rx : RX bandwidth stats (MB/s)
- tx : TX bandwidth stats (MB/s)
- uptime : uptime
- vms : number of VMs
- androidvms : number of active Android VMs counted against the per-host Android port limit
- vmlimit : limit based on coschedule values (-1 is no limit)
All VM-based stats are computed across namespaces.
host_memcommit()
¶
Variants: host memcommit
Report information about hosts in the current namespace:
- cpucommit : total cpu commit
- cpus : number of cpus
- load : system load average
- memcommit : total memory commit in MB
- memtotal : total memory in MB
- memused : memory used in MB
- name : name of the machine
- netcommit : total network interface commit
- rx : RX bandwidth stats (MB/s)
- tx : TX bandwidth stats (MB/s)
- uptime : uptime
- vms : number of VMs
- androidvms : number of active Android VMs counted against the per-host Android port limit
- vmlimit : limit based on coschedule values (-1 is no limit)
All VM-based stats are computed across namespaces.
host_memtotal()
¶
Variants: host memtotal
Report information about hosts in the current namespace:
- cpucommit : total cpu commit
- cpus : number of cpus
- load : system load average
- memcommit : total memory commit in MB
- memtotal : total memory in MB
- memused : memory used in MB
- name : name of the machine
- netcommit : total network interface commit
- rx : RX bandwidth stats (MB/s)
- tx : TX bandwidth stats (MB/s)
- uptime : uptime
- vms : number of VMs
- androidvms : number of active Android VMs counted against the per-host Android port limit
- vmlimit : limit based on coschedule values (-1 is no limit)
All VM-based stats are computed across namespaces.
host_memused()
¶
Variants: host memused
Report information about hosts in the current namespace:
- cpucommit : total cpu commit
- cpus : number of cpus
- load : system load average
- memcommit : total memory commit in MB
- memtotal : total memory in MB
- memused : memory used in MB
- name : name of the machine
- netcommit : total network interface commit
- rx : RX bandwidth stats (MB/s)
- tx : TX bandwidth stats (MB/s)
- uptime : uptime
- vms : number of VMs
- androidvms : number of active Android VMs counted against the per-host Android port limit
- vmlimit : limit based on coschedule values (-1 is no limit)
All VM-based stats are computed across namespaces.
host_name()
¶
Variants: host name
Report information about hosts in the current namespace:
- cpucommit : total cpu commit
- cpus : number of cpus
- load : system load average
- memcommit : total memory commit in MB
- memtotal : total memory in MB
- memused : memory used in MB
- name : name of the machine
- netcommit : total network interface commit
- rx : RX bandwidth stats (MB/s)
- tx : TX bandwidth stats (MB/s)
- uptime : uptime
- vms : number of VMs
- androidvms : number of active Android VMs counted against the per-host Android port limit
- vmlimit : limit based on coschedule values (-1 is no limit)
All VM-based stats are computed across namespaces.
host_netcommit()
¶
Variants: host netcommit
Report information about hosts in the current namespace:
- cpucommit : total cpu commit
- cpus : number of cpus
- load : system load average
- memcommit : total memory commit in MB
- memtotal : total memory in MB
- memused : memory used in MB
- name : name of the machine
- netcommit : total network interface commit
- rx : RX bandwidth stats (MB/s)
- tx : TX bandwidth stats (MB/s)
- uptime : uptime
- vms : number of VMs
- androidvms : number of active Android VMs counted against the per-host Android port limit
- vmlimit : limit based on coschedule values (-1 is no limit)
All VM-based stats are computed across namespaces.
host_rx()
¶
Variants: host rx
Report information about hosts in the current namespace:
- cpucommit : total cpu commit
- cpus : number of cpus
- load : system load average
- memcommit : total memory commit in MB
- memtotal : total memory in MB
- memused : memory used in MB
- name : name of the machine
- netcommit : total network interface commit
- rx : RX bandwidth stats (MB/s)
- tx : TX bandwidth stats (MB/s)
- uptime : uptime
- vms : number of VMs
- androidvms : number of active Android VMs counted against the per-host Android port limit
- vmlimit : limit based on coschedule values (-1 is no limit)
All VM-based stats are computed across namespaces.
host_tx()
¶
Variants: host tx
Report information about hosts in the current namespace:
- cpucommit : total cpu commit
- cpus : number of cpus
- load : system load average
- memcommit : total memory commit in MB
- memtotal : total memory in MB
- memused : memory used in MB
- name : name of the machine
- netcommit : total network interface commit
- rx : RX bandwidth stats (MB/s)
- tx : TX bandwidth stats (MB/s)
- uptime : uptime
- vms : number of VMs
- androidvms : number of active Android VMs counted against the per-host Android port limit
- vmlimit : limit based on coschedule values (-1 is no limit)
All VM-based stats are computed across namespaces.
host_uptime()
¶
Variants: host uptime
Report information about hosts in the current namespace:
- cpucommit : total cpu commit
- cpus : number of cpus
- load : system load average
- memcommit : total memory commit in MB
- memtotal : total memory in MB
- memused : memory used in MB
- name : name of the machine
- netcommit : total network interface commit
- rx : RX bandwidth stats (MB/s)
- tx : TX bandwidth stats (MB/s)
- uptime : uptime
- vms : number of VMs
- androidvms : number of active Android VMs counted against the per-host Android port limit
- vmlimit : limit based on coschedule values (-1 is no limit)
All VM-based stats are computed across namespaces.
host_vmlimit()
¶
Variants: host vmlimit
Report information about hosts in the current namespace:
- cpucommit : total cpu commit
- cpus : number of cpus
- load : system load average
- memcommit : total memory commit in MB
- memtotal : total memory in MB
- memused : memory used in MB
- name : name of the machine
- netcommit : total network interface commit
- rx : RX bandwidth stats (MB/s)
- tx : TX bandwidth stats (MB/s)
- uptime : uptime
- vms : number of VMs
- androidvms : number of active Android VMs counted against the per-host Android port limit
- vmlimit : limit based on coschedule values (-1 is no limit)
All VM-based stats are computed across namespaces.
host_vms()
¶
Variants: host vms
Report information about hosts in the current namespace:
- cpucommit : total cpu commit
- cpus : number of cpus
- load : system load average
- memcommit : total memory commit in MB
- memtotal : total memory in MB
- memused : memory used in MB
- name : name of the machine
- netcommit : total network interface commit
- rx : RX bandwidth stats (MB/s)
- tx : TX bandwidth stats (MB/s)
- uptime : uptime
- vms : number of VMs
- androidvms : number of active Android VMs counted against the per-host Android port limit
- vmlimit : limit based on coschedule values (-1 is no limit)
All VM-based stats are computed across namespaces.
log_file(file=None)
¶
Variants:
log file
Log to a file. To disable file logging, call "clear log file".
log_filter(filter=None)
¶
Variants:
log filter
Control what data gets logged based on matching text. For example, to filter out all logging messages containing the word "foo":
log filter foo
log_level(debug_or_info_or_warn_or_error_or_fatal=None)
¶
Variants:
log level
Set the log level to one of [debug,info,warn,error,fatal]. Log levels inherit lower levels, so setting the level to error will also log fatal, and setting the mode to debug will log everything.
log_mesh(node=None)
¶
Variants:
log mesh
Log to a mesh node. To disable mesh logging, call "clear log mesh".
log_ring(size=None)
¶
Variants:
log ring
The log ring contains recent log messages, if it is enabled. By default the ring is not enabled. When enabling it, the user can specify a size. The larger the size, the more memory the logs will consume. The log ring can be cleared by re-enabling it with the same (or different) size.
To disable the log ring, call "clear log ring".
log_stderr(true_or_false=None)
¶
Variants:
log stderr
enable or disable logging to stderr
log_syslog_local()
¶
Variants: log syslog local
Log to a syslog daemon on the provided network and address. For example, to log over UDP to a syslog server foo on port 514:
log syslog udp foo:514
log_syslog_remote(tcp_or_udp, address)
¶
Variants:
log syslog remote
Log to a syslog daemon on the provided network and address. For example, to log over UDP to a syslog server foo on port 514:
log syslog udp foo:514
mesh_degree(degree=None)
¶
Variants:
mesh degree
view or set the current degree for this mesh node
mesh_dial(hostname)
¶
Variants:
mesh dial
attempt to connect this node to another node
mesh_dot(filename)
¶
Variants:
mesh dot
Output a graphviz formatted dot file representing the connected topology.
mesh_hangup(hostname)
¶
Variants:
mesh hangup
disconnect from a client
mesh_list(all_or_peers=None)
¶
Variants:
mesh list
Without "all" or "peers", displays the mesh adjacency list. If "all" is specified, the hostnames of all nodes in the list are printed. If "peers" is specified, the hostnames of all peers are printed (the local node is not included).
mesh_send(hostname, command)
¶
Variants:
mesh send
Send a command to one or more connected clients. For example, to get the vm info from nodes kn1 and kn2:
mesh send kn[1-2] vm info
You can use 'all' to send a command to all connected clients.
mesh_status()
¶
Variants: mesh status
display a short status report of the mesh
mesh_timeout(timeout=None)
¶
Variants:
mesh timeout
View or set the timeout on sending mesh commands.
When a mesh command is issued, if a response isn't sent within mesh timeout seconds, the command will be dropped and any future response will be discarded. Note that this does not cancel the outstanding command - the node receiving the command may still complete - but rather this node will stop waiting on a response.
By default, the mesh timeout is 0 which disables timeouts.
namespace(name)
¶
Returns a new instance for use in a with statement:
with mm.namespace("name") as mm:
mm.vm_info(...)
Note that this wraps the existing minimega connection so multiple instances can be used concurrently but the commands themselves will be executed serially.
ns_add_hosts(hostname)
¶
Variants:
ns add-hosts
Display or modify the active namespace.
- hosts : list hosts
- add-hosts : add comma-separated list of hosts to the namespace
- del-hosts : delete comma-separated list of hosts from the namespace
- load : display or change host load is computed for scheduler, based on:
- cpucommit : total CPU commit divided by number of CPUs (default)
- netcommit : total NIC
- memcommit : total memory commit divided by total memory
- queue : display VM queue
- flush : clear the VM queue
- queueing : toggle VMs queueing when launching (default false)
- schedule : run scheduler (same as "vm launch")
- dry-run : determine VM placement and print out VM -> host assignments
- dump : print out VM -> host assignments (after dry-run)
- mv : manually edit VM placement in schedule (after dry-run)
- status : display scheduling status
- bridge : create a bridge, defaults to GRE mesh between hosts
- del-bridge: destroy a bridge
- snapshot : DEPRECATED: Use 'ns save'
- save : Save all supported VMs in the namespace or print save progress
- run : run a command on all nodes in the namespace
Note: namespace save records Android VM configuration so Android VMs can be relaunched, but it does not capture Android Emulator runtime state, AVD data changes, guest IP addresses, guest policy routing, or guest firewall state.
ns_bridge(bridge, vxlan_or_gre=None)
¶
Variants:
ns bridge
Display or modify the active namespace.
- hosts : list hosts
- add-hosts : add comma-separated list of hosts to the namespace
- del-hosts : delete comma-separated list of hosts from the namespace
- load : display or change host load is computed for scheduler, based on:
- cpucommit : total CPU commit divided by number of CPUs (default)
- netcommit : total NIC
- memcommit : total memory commit divided by total memory
- queue : display VM queue
- flush : clear the VM queue
- queueing : toggle VMs queueing when launching (default false)
- schedule : run scheduler (same as "vm launch")
- dry-run : determine VM placement and print out VM -> host assignments
- dump : print out VM -> host assignments (after dry-run)
- mv : manually edit VM placement in schedule (after dry-run)
- status : display scheduling status
- bridge : create a bridge, defaults to GRE mesh between hosts
- del-bridge: destroy a bridge
- snapshot : DEPRECATED: Use 'ns save'
- save : Save all supported VMs in the namespace or print save progress
- run : run a command on all nodes in the namespace
Note: namespace save records Android VM configuration so Android VMs can be relaunched, but it does not capture Android Emulator runtime state, AVD data changes, guest IP addresses, guest policy routing, or guest firewall state.
ns_del_bridge(bridge)
¶
Variants:
ns del-bridge
Display or modify the active namespace.
- hosts : list hosts
- add-hosts : add comma-separated list of hosts to the namespace
- del-hosts : delete comma-separated list of hosts from the namespace
- load : display or change host load is computed for scheduler, based on:
- cpucommit : total CPU commit divided by number of CPUs (default)
- netcommit : total NIC
- memcommit : total memory commit divided by total memory
- queue : display VM queue
- flush : clear the VM queue
- queueing : toggle VMs queueing when launching (default false)
- schedule : run scheduler (same as "vm launch")
- dry-run : determine VM placement and print out VM -> host assignments
- dump : print out VM -> host assignments (after dry-run)
- mv : manually edit VM placement in schedule (after dry-run)
- status : display scheduling status
- bridge : create a bridge, defaults to GRE mesh between hosts
- del-bridge: destroy a bridge
- snapshot : DEPRECATED: Use 'ns save'
- save : Save all supported VMs in the namespace or print save progress
- run : run a command on all nodes in the namespace
Note: namespace save records Android VM configuration so Android VMs can be relaunched, but it does not capture Android Emulator runtime state, AVD data changes, guest IP addresses, guest policy routing, or guest firewall state.
ns_del_hosts(hostname)
¶
Variants:
ns del-hosts
Display or modify the active namespace.
- hosts : list hosts
- add-hosts : add comma-separated list of hosts to the namespace
- del-hosts : delete comma-separated list of hosts from the namespace
- load : display or change host load is computed for scheduler, based on:
- cpucommit : total CPU commit divided by number of CPUs (default)
- netcommit : total NIC
- memcommit : total memory commit divided by total memory
- queue : display VM queue
- flush : clear the VM queue
- queueing : toggle VMs queueing when launching (default false)
- schedule : run scheduler (same as "vm launch")
- dry-run : determine VM placement and print out VM -> host assignments
- dump : print out VM -> host assignments (after dry-run)
- mv : manually edit VM placement in schedule (after dry-run)
- status : display scheduling status
- bridge : create a bridge, defaults to GRE mesh between hosts
- del-bridge: destroy a bridge
- snapshot : DEPRECATED: Use 'ns save'
- save : Save all supported VMs in the namespace or print save progress
- run : run a command on all nodes in the namespace
Note: namespace save records Android VM configuration so Android VMs can be relaunched, but it does not capture Android Emulator runtime state, AVD data changes, guest IP addresses, guest policy routing, or guest firewall state.
ns_flush()
¶
Variants: ns flush
Display or modify the active namespace.
- hosts : list hosts
- add-hosts : add comma-separated list of hosts to the namespace
- del-hosts : delete comma-separated list of hosts from the namespace
- load : display or change host load is computed for scheduler, based on:
- cpucommit : total CPU commit divided by number of CPUs (default)
- netcommit : total NIC
- memcommit : total memory commit divided by total memory
- queue : display VM queue
- flush : clear the VM queue
- queueing : toggle VMs queueing when launching (default false)
- schedule : run scheduler (same as "vm launch")
- dry-run : determine VM placement and print out VM -> host assignments
- dump : print out VM -> host assignments (after dry-run)
- mv : manually edit VM placement in schedule (after dry-run)
- status : display scheduling status
- bridge : create a bridge, defaults to GRE mesh between hosts
- del-bridge: destroy a bridge
- snapshot : DEPRECATED: Use 'ns save'
- save : Save all supported VMs in the namespace or print save progress
- run : run a command on all nodes in the namespace
Note: namespace save records Android VM configuration so Android VMs can be relaunched, but it does not capture Android Emulator runtime state, AVD data changes, guest IP addresses, guest policy routing, or guest firewall state.
ns_hosts()
¶
Variants: ns hosts
Display or modify the active namespace.
- hosts : list hosts
- add-hosts : add comma-separated list of hosts to the namespace
- del-hosts : delete comma-separated list of hosts from the namespace
- load : display or change host load is computed for scheduler, based on:
- cpucommit : total CPU commit divided by number of CPUs (default)
- netcommit : total NIC
- memcommit : total memory commit divided by total memory
- queue : display VM queue
- flush : clear the VM queue
- queueing : toggle VMs queueing when launching (default false)
- schedule : run scheduler (same as "vm launch")
- dry-run : determine VM placement and print out VM -> host assignments
- dump : print out VM -> host assignments (after dry-run)
- mv : manually edit VM placement in schedule (after dry-run)
- status : display scheduling status
- bridge : create a bridge, defaults to GRE mesh between hosts
- del-bridge: destroy a bridge
- snapshot : DEPRECATED: Use 'ns save'
- save : Save all supported VMs in the namespace or print save progress
- run : run a command on all nodes in the namespace
Note: namespace save records Android VM configuration so Android VMs can be relaunched, but it does not capture Android Emulator runtime state, AVD data changes, guest IP addresses, guest policy routing, or guest firewall state.
ns_load()
¶
Variants: ns load
Display or modify the active namespace.
- hosts : list hosts
- add-hosts : add comma-separated list of hosts to the namespace
- del-hosts : delete comma-separated list of hosts from the namespace
- load : display or change host load is computed for scheduler, based on:
- cpucommit : total CPU commit divided by number of CPUs (default)
- netcommit : total NIC
- memcommit : total memory commit divided by total memory
- queue : display VM queue
- flush : clear the VM queue
- queueing : toggle VMs queueing when launching (default false)
- schedule : run scheduler (same as "vm launch")
- dry-run : determine VM placement and print out VM -> host assignments
- dump : print out VM -> host assignments (after dry-run)
- mv : manually edit VM placement in schedule (after dry-run)
- status : display scheduling status
- bridge : create a bridge, defaults to GRE mesh between hosts
- del-bridge: destroy a bridge
- snapshot : DEPRECATED: Use 'ns save'
- save : Save all supported VMs in the namespace or print save progress
- run : run a command on all nodes in the namespace
Note: namespace save records Android VM configuration so Android VMs can be relaunched, but it does not capture Android Emulator runtime state, AVD data changes, guest IP addresses, guest policy routing, or guest firewall state.
ns_load_cpucommit()
¶
Variants: ns load cpucommit
Display or modify the active namespace.
- hosts : list hosts
- add-hosts : add comma-separated list of hosts to the namespace
- del-hosts : delete comma-separated list of hosts from the namespace
- load : display or change host load is computed for scheduler, based on:
- cpucommit : total CPU commit divided by number of CPUs (default)
- netcommit : total NIC
- memcommit : total memory commit divided by total memory
- queue : display VM queue
- flush : clear the VM queue
- queueing : toggle VMs queueing when launching (default false)
- schedule : run scheduler (same as "vm launch")
- dry-run : determine VM placement and print out VM -> host assignments
- dump : print out VM -> host assignments (after dry-run)
- mv : manually edit VM placement in schedule (after dry-run)
- status : display scheduling status
- bridge : create a bridge, defaults to GRE mesh between hosts
- del-bridge: destroy a bridge
- snapshot : DEPRECATED: Use 'ns save'
- save : Save all supported VMs in the namespace or print save progress
- run : run a command on all nodes in the namespace
Note: namespace save records Android VM configuration so Android VMs can be relaunched, but it does not capture Android Emulator runtime state, AVD data changes, guest IP addresses, guest policy routing, or guest firewall state.
ns_load_memcommit()
¶
Variants: ns load memcommit
Display or modify the active namespace.
- hosts : list hosts
- add-hosts : add comma-separated list of hosts to the namespace
- del-hosts : delete comma-separated list of hosts from the namespace
- load : display or change host load is computed for scheduler, based on:
- cpucommit : total CPU commit divided by number of CPUs (default)
- netcommit : total NIC
- memcommit : total memory commit divided by total memory
- queue : display VM queue
- flush : clear the VM queue
- queueing : toggle VMs queueing when launching (default false)
- schedule : run scheduler (same as "vm launch")
- dry-run : determine VM placement and print out VM -> host assignments
- dump : print out VM -> host assignments (after dry-run)
- mv : manually edit VM placement in schedule (after dry-run)
- status : display scheduling status
- bridge : create a bridge, defaults to GRE mesh between hosts
- del-bridge: destroy a bridge
- snapshot : DEPRECATED: Use 'ns save'
- save : Save all supported VMs in the namespace or print save progress
- run : run a command on all nodes in the namespace
Note: namespace save records Android VM configuration so Android VMs can be relaunched, but it does not capture Android Emulator runtime state, AVD data changes, guest IP addresses, guest policy routing, or guest firewall state.
ns_load_netcommit()
¶
Variants: ns load netcommit
Display or modify the active namespace.
- hosts : list hosts
- add-hosts : add comma-separated list of hosts to the namespace
- del-hosts : delete comma-separated list of hosts from the namespace
- load : display or change host load is computed for scheduler, based on:
- cpucommit : total CPU commit divided by number of CPUs (default)
- netcommit : total NIC
- memcommit : total memory commit divided by total memory
- queue : display VM queue
- flush : clear the VM queue
- queueing : toggle VMs queueing when launching (default false)
- schedule : run scheduler (same as "vm launch")
- dry-run : determine VM placement and print out VM -> host assignments
- dump : print out VM -> host assignments (after dry-run)
- mv : manually edit VM placement in schedule (after dry-run)
- status : display scheduling status
- bridge : create a bridge, defaults to GRE mesh between hosts
- del-bridge: destroy a bridge
- snapshot : DEPRECATED: Use 'ns save'
- save : Save all supported VMs in the namespace or print save progress
- run : run a command on all nodes in the namespace
Note: namespace save records Android VM configuration so Android VMs can be relaunched, but it does not capture Android Emulator runtime state, AVD data changes, guest IP addresses, guest policy routing, or guest firewall state.
ns_queue()
¶
Variants: ns queue
Display or modify the active namespace.
- hosts : list hosts
- add-hosts : add comma-separated list of hosts to the namespace
- del-hosts : delete comma-separated list of hosts from the namespace
- load : display or change host load is computed for scheduler, based on:
- cpucommit : total CPU commit divided by number of CPUs (default)
- netcommit : total NIC
- memcommit : total memory commit divided by total memory
- queue : display VM queue
- flush : clear the VM queue
- queueing : toggle VMs queueing when launching (default false)
- schedule : run scheduler (same as "vm launch")
- dry-run : determine VM placement and print out VM -> host assignments
- dump : print out VM -> host assignments (after dry-run)
- mv : manually edit VM placement in schedule (after dry-run)
- status : display scheduling status
- bridge : create a bridge, defaults to GRE mesh between hosts
- del-bridge: destroy a bridge
- snapshot : DEPRECATED: Use 'ns save'
- save : Save all supported VMs in the namespace or print save progress
- run : run a command on all nodes in the namespace
Note: namespace save records Android VM configuration so Android VMs can be relaunched, but it does not capture Android Emulator runtime state, AVD data changes, guest IP addresses, guest policy routing, or guest firewall state.
ns_queueing(true_or_false=None)
¶
Variants:
ns queueing
Display or modify the active namespace.
- hosts : list hosts
- add-hosts : add comma-separated list of hosts to the namespace
- del-hosts : delete comma-separated list of hosts from the namespace
- load : display or change host load is computed for scheduler, based on:
- cpucommit : total CPU commit divided by number of CPUs (default)
- netcommit : total NIC
- memcommit : total memory commit divided by total memory
- queue : display VM queue
- flush : clear the VM queue
- queueing : toggle VMs queueing when launching (default false)
- schedule : run scheduler (same as "vm launch")
- dry-run : determine VM placement and print out VM -> host assignments
- dump : print out VM -> host assignments (after dry-run)
- mv : manually edit VM placement in schedule (after dry-run)
- status : display scheduling status
- bridge : create a bridge, defaults to GRE mesh between hosts
- del-bridge: destroy a bridge
- snapshot : DEPRECATED: Use 'ns save'
- save : Save all supported VMs in the namespace or print save progress
- run : run a command on all nodes in the namespace
Note: namespace save records Android VM configuration so Android VMs can be relaunched, but it does not capture Android Emulator runtime state, AVD data changes, guest IP addresses, guest policy routing, or guest firewall state.
ns_run(command)
¶
Variants: ns run (command)
Display or modify the active namespace.
- hosts : list hosts
- add-hosts : add comma-separated list of hosts to the namespace
- del-hosts : delete comma-separated list of hosts from the namespace
- load : display or change host load is computed for scheduler, based on:
- cpucommit : total CPU commit divided by number of CPUs (default)
- netcommit : total NIC
- memcommit : total memory commit divided by total memory
- queue : display VM queue
- flush : clear the VM queue
- queueing : toggle VMs queueing when launching (default false)
- schedule : run scheduler (same as "vm launch")
- dry-run : determine VM placement and print out VM -> host assignments
- dump : print out VM -> host assignments (after dry-run)
- mv : manually edit VM placement in schedule (after dry-run)
- status : display scheduling status
- bridge : create a bridge, defaults to GRE mesh between hosts
- del-bridge: destroy a bridge
- snapshot : DEPRECATED: Use 'ns save'
- save : Save all supported VMs in the namespace or print save progress
- run : run a command on all nodes in the namespace
Note: namespace save records Android VM configuration so Android VMs can be relaunched, but it does not capture Android Emulator runtime state, AVD data changes, guest IP addresses, guest policy routing, or guest firewall state.
ns_save(name=None)
¶
Variants:
ns save
Display or modify the active namespace.
- hosts : list hosts
- add-hosts : add comma-separated list of hosts to the namespace
- del-hosts : delete comma-separated list of hosts from the namespace
- load : display or change host load is computed for scheduler, based on:
- cpucommit : total CPU commit divided by number of CPUs (default)
- netcommit : total NIC
- memcommit : total memory commit divided by total memory
- queue : display VM queue
- flush : clear the VM queue
- queueing : toggle VMs queueing when launching (default false)
- schedule : run scheduler (same as "vm launch")
- dry-run : determine VM placement and print out VM -> host assignments
- dump : print out VM -> host assignments (after dry-run)
- mv : manually edit VM placement in schedule (after dry-run)
- status : display scheduling status
- bridge : create a bridge, defaults to GRE mesh between hosts
- del-bridge: destroy a bridge
- snapshot : DEPRECATED: Use 'ns save'
- save : Save all supported VMs in the namespace or print save progress
- run : run a command on all nodes in the namespace
Note: namespace save records Android VM configuration so Android VMs can be relaunched, but it does not capture Android Emulator runtime state, AVD data changes, guest IP addresses, guest policy routing, or guest firewall state.
ns_schedule()
¶
Variants: ns schedule
Display or modify the active namespace.
- hosts : list hosts
- add-hosts : add comma-separated list of hosts to the namespace
- del-hosts : delete comma-separated list of hosts from the namespace
- load : display or change host load is computed for scheduler, based on:
- cpucommit : total CPU commit divided by number of CPUs (default)
- netcommit : total NIC
- memcommit : total memory commit divided by total memory
- queue : display VM queue
- flush : clear the VM queue
- queueing : toggle VMs queueing when launching (default false)
- schedule : run scheduler (same as "vm launch")
- dry-run : determine VM placement and print out VM -> host assignments
- dump : print out VM -> host assignments (after dry-run)
- mv : manually edit VM placement in schedule (after dry-run)
- status : display scheduling status
- bridge : create a bridge, defaults to GRE mesh between hosts
- del-bridge: destroy a bridge
- snapshot : DEPRECATED: Use 'ns save'
- save : Save all supported VMs in the namespace or print save progress
- run : run a command on all nodes in the namespace
Note: namespace save records Android VM configuration so Android VMs can be relaunched, but it does not capture Android Emulator runtime state, AVD data changes, guest IP addresses, guest policy routing, or guest firewall state.
ns_schedule_dry_run()
¶
Variants: ns schedule dry-run
Display or modify the active namespace.
- hosts : list hosts
- add-hosts : add comma-separated list of hosts to the namespace
- del-hosts : delete comma-separated list of hosts from the namespace
- load : display or change host load is computed for scheduler, based on:
- cpucommit : total CPU commit divided by number of CPUs (default)
- netcommit : total NIC
- memcommit : total memory commit divided by total memory
- queue : display VM queue
- flush : clear the VM queue
- queueing : toggle VMs queueing when launching (default false)
- schedule : run scheduler (same as "vm launch")
- dry-run : determine VM placement and print out VM -> host assignments
- dump : print out VM -> host assignments (after dry-run)
- mv : manually edit VM placement in schedule (after dry-run)
- status : display scheduling status
- bridge : create a bridge, defaults to GRE mesh between hosts
- del-bridge: destroy a bridge
- snapshot : DEPRECATED: Use 'ns save'
- save : Save all supported VMs in the namespace or print save progress
- run : run a command on all nodes in the namespace
Note: namespace save records Android VM configuration so Android VMs can be relaunched, but it does not capture Android Emulator runtime state, AVD data changes, guest IP addresses, guest policy routing, or guest firewall state.
ns_schedule_dump()
¶
Variants: ns schedule dump
Display or modify the active namespace.
- hosts : list hosts
- add-hosts : add comma-separated list of hosts to the namespace
- del-hosts : delete comma-separated list of hosts from the namespace
- load : display or change host load is computed for scheduler, based on:
- cpucommit : total CPU commit divided by number of CPUs (default)
- netcommit : total NIC
- memcommit : total memory commit divided by total memory
- queue : display VM queue
- flush : clear the VM queue
- queueing : toggle VMs queueing when launching (default false)
- schedule : run scheduler (same as "vm launch")
- dry-run : determine VM placement and print out VM -> host assignments
- dump : print out VM -> host assignments (after dry-run)
- mv : manually edit VM placement in schedule (after dry-run)
- status : display scheduling status
- bridge : create a bridge, defaults to GRE mesh between hosts
- del-bridge: destroy a bridge
- snapshot : DEPRECATED: Use 'ns save'
- save : Save all supported VMs in the namespace or print save progress
- run : run a command on all nodes in the namespace
Note: namespace save records Android VM configuration so Android VMs can be relaunched, but it does not capture Android Emulator runtime state, AVD data changes, guest IP addresses, guest policy routing, or guest firewall state.
ns_schedule_mv(vm, dst)
¶
Variants:
ns schedule mv
Display or modify the active namespace.
- hosts : list hosts
- add-hosts : add comma-separated list of hosts to the namespace
- del-hosts : delete comma-separated list of hosts from the namespace
- load : display or change host load is computed for scheduler, based on:
- cpucommit : total CPU commit divided by number of CPUs (default)
- netcommit : total NIC
- memcommit : total memory commit divided by total memory
- queue : display VM queue
- flush : clear the VM queue
- queueing : toggle VMs queueing when launching (default false)
- schedule : run scheduler (same as "vm launch")
- dry-run : determine VM placement and print out VM -> host assignments
- dump : print out VM -> host assignments (after dry-run)
- mv : manually edit VM placement in schedule (after dry-run)
- status : display scheduling status
- bridge : create a bridge, defaults to GRE mesh between hosts
- del-bridge: destroy a bridge
- snapshot : DEPRECATED: Use 'ns save'
- save : Save all supported VMs in the namespace or print save progress
- run : run a command on all nodes in the namespace
Note: namespace save records Android VM configuration so Android VMs can be relaunched, but it does not capture Android Emulator runtime state, AVD data changes, guest IP addresses, guest policy routing, or guest firewall state.
ns_schedule_status()
¶
Variants: ns schedule status
Display or modify the active namespace.
- hosts : list hosts
- add-hosts : add comma-separated list of hosts to the namespace
- del-hosts : delete comma-separated list of hosts from the namespace
- load : display or change host load is computed for scheduler, based on:
- cpucommit : total CPU commit divided by number of CPUs (default)
- netcommit : total NIC
- memcommit : total memory commit divided by total memory
- queue : display VM queue
- flush : clear the VM queue
- queueing : toggle VMs queueing when launching (default false)
- schedule : run scheduler (same as "vm launch")
- dry-run : determine VM placement and print out VM -> host assignments
- dump : print out VM -> host assignments (after dry-run)
- mv : manually edit VM placement in schedule (after dry-run)
- status : display scheduling status
- bridge : create a bridge, defaults to GRE mesh between hosts
- del-bridge: destroy a bridge
- snapshot : DEPRECATED: Use 'ns save'
- save : Save all supported VMs in the namespace or print save progress
- run : run a command on all nodes in the namespace
Note: namespace save records Android VM configuration so Android VMs can be relaunched, but it does not capture Android Emulator runtime state, AVD data changes, guest IP addresses, guest policy routing, or guest firewall state.
ns_snapshot(name=None)
¶
Variants:
ns snapshot
Display or modify the active namespace.
- hosts : list hosts
- add-hosts : add comma-separated list of hosts to the namespace
- del-hosts : delete comma-separated list of hosts from the namespace
- load : display or change host load is computed for scheduler, based on:
- cpucommit : total CPU commit divided by number of CPUs (default)
- netcommit : total NIC
- memcommit : total memory commit divided by total memory
- queue : display VM queue
- flush : clear the VM queue
- queueing : toggle VMs queueing when launching (default false)
- schedule : run scheduler (same as "vm launch")
- dry-run : determine VM placement and print out VM -> host assignments
- dump : print out VM -> host assignments (after dry-run)
- mv : manually edit VM placement in schedule (after dry-run)
- status : display scheduling status
- bridge : create a bridge, defaults to GRE mesh between hosts
- del-bridge: destroy a bridge
- snapshot : DEPRECATED: Use 'ns save'
- save : Save all supported VMs in the namespace or print save progress
- run : run a command on all nodes in the namespace
Note: namespace save records Android VM configuration so Android VMs can be relaunched, but it does not capture Android Emulator runtime state, AVD data changes, guest IP addresses, guest policy routing, or guest firewall state.
nuke()
¶
Variants: nuke
After a crash, the VM state on the machine can be difficult to recover from. nuke attempts to kill all instances of QEMU, remove all taps and bridges, and removes the temporary minimega state on the harddisk.
Should be run with caution.
optimize()
¶
Variants: optimize
Enable or disable several virtualization optimizations, including Kernel Samepage Merging, CPU affinity for VMs, and the use of hugepages.
To enable/disable Kernel Samepage Merging (KSM):
optimize ksm [true,false]
To enable hugepage support for future VM launches:
optimize hugepages </path/to/hugepages_mount>
To disable hugepage support:
clear optimize hugepages
To enable/disable CPU affinity support for VMs in the namespace:
optimize affinity [true,false]
To set a CPU set filter for the affinity scheduler, for example (to use only CPUs 1, 2-20):
optimize affinity filter [1,2-20]
If affinity is already enabled, will cause reassignment of affinity for all running VMs to match the new filter.
To clear a CPU set filter:
clear optimize affinity filter
See note above about reassigning affinity.
To view current CPU affinity mappings (by PID):
optimize affinity
To disable all optimizations, use "clear optimize".
Note: affinity and hugepages can be selectively enabled in particular namespaces. KSM affects VMs across all namespaces.
optimize_affinity(true_or_false=None)
¶
Variants:
optimize affinity
Enable or disable several virtualization optimizations, including Kernel Samepage Merging, CPU affinity for VMs, and the use of hugepages.
To enable/disable Kernel Samepage Merging (KSM):
optimize ksm [true,false]
To enable hugepage support for future VM launches:
optimize hugepages </path/to/hugepages_mount>
To disable hugepage support:
clear optimize hugepages
To enable/disable CPU affinity support for VMs in the namespace:
optimize affinity [true,false]
To set a CPU set filter for the affinity scheduler, for example (to use only CPUs 1, 2-20):
optimize affinity filter [1,2-20]
If affinity is already enabled, will cause reassignment of affinity for all running VMs to match the new filter.
To clear a CPU set filter:
clear optimize affinity filter
See note above about reassigning affinity.
To view current CPU affinity mappings (by PID):
optimize affinity
To disable all optimizations, use "clear optimize".
Note: affinity and hugepages can be selectively enabled in particular namespaces. KSM affects VMs across all namespaces.
optimize_affinity_filter(filter)
¶
Variants:
optimize affinity filter
Enable or disable several virtualization optimizations, including Kernel Samepage Merging, CPU affinity for VMs, and the use of hugepages.
To enable/disable Kernel Samepage Merging (KSM):
optimize ksm [true,false]
To enable hugepage support for future VM launches:
optimize hugepages </path/to/hugepages_mount>
To disable hugepage support:
clear optimize hugepages
To enable/disable CPU affinity support for VMs in the namespace:
optimize affinity [true,false]
To set a CPU set filter for the affinity scheduler, for example (to use only CPUs 1, 2-20):
optimize affinity filter [1,2-20]
If affinity is already enabled, will cause reassignment of affinity for all running VMs to match the new filter.
To clear a CPU set filter:
clear optimize affinity filter
See note above about reassigning affinity.
To view current CPU affinity mappings (by PID):
optimize affinity
To disable all optimizations, use "clear optimize".
Note: affinity and hugepages can be selectively enabled in particular namespaces. KSM affects VMs across all namespaces.
optimize_hugepages(path=None)
¶
Variants:
optimize hugepages
Enable or disable several virtualization optimizations, including Kernel Samepage Merging, CPU affinity for VMs, and the use of hugepages.
To enable/disable Kernel Samepage Merging (KSM):
optimize ksm [true,false]
To enable hugepage support for future VM launches:
optimize hugepages </path/to/hugepages_mount>
To disable hugepage support:
clear optimize hugepages
To enable/disable CPU affinity support for VMs in the namespace:
optimize affinity [true,false]
To set a CPU set filter for the affinity scheduler, for example (to use only CPUs 1, 2-20):
optimize affinity filter [1,2-20]
If affinity is already enabled, will cause reassignment of affinity for all running VMs to match the new filter.
To clear a CPU set filter:
clear optimize affinity filter
See note above about reassigning affinity.
To view current CPU affinity mappings (by PID):
optimize affinity
To disable all optimizations, use "clear optimize".
Note: affinity and hugepages can be selectively enabled in particular namespaces. KSM affects VMs across all namespaces.
optimize_ksm(true_or_false=None)
¶
Variants:
optimize ksm
Enable or disable several virtualization optimizations, including Kernel Samepage Merging, CPU affinity for VMs, and the use of hugepages.
To enable/disable Kernel Samepage Merging (KSM):
optimize ksm [true,false]
To enable hugepage support for future VM launches:
optimize hugepages </path/to/hugepages_mount>
To disable hugepage support:
clear optimize hugepages
To enable/disable CPU affinity support for VMs in the namespace:
optimize affinity [true,false]
To set a CPU set filter for the affinity scheduler, for example (to use only CPUs 1, 2-20):
optimize affinity filter [1,2-20]
If affinity is already enabled, will cause reassignment of affinity for all running VMs to match the new filter.
To clear a CPU set filter:
clear optimize affinity filter
See note above about reassigning affinity.
To view current CPU affinity mappings (by PID):
optimize affinity
To disable all optimizations, use "clear optimize".
Note: affinity and hugepages can be selectively enabled in particular namespaces. KSM affects VMs across all namespaces.
pipe(pipe=None, data=None)
¶
Variants:
pipe
Interact with named pipes. To write to a pipe, simply invoke the pipe API with the pipe name and value:
pipe foo Hello pipes!
Pipes have several message delivery modes. Based on the mode, messages written to a pipe will be delivered to one or more readers. Mode "all" copies messages to all readers, "round-robin" chooses a single reader, in-order, and "random" selects a random reader.
Pipes can also have "vias", programs through which all written data is passed before being sent to readers. Unlike pipelines, vias are run for every reader. This allows for mutating data on a per-reader basis with a single write. For example, to send a unique floating-point value on a normal distribution with a written mean to all readers:
pipe foo via normal -stddev 5.0
pipe foo 1.5
Pipes in other namespaces can be referenced with the syntax
pipe_log(pipe, true_or_false)
¶
Variants:
pipe
Interact with named pipes. To write to a pipe, simply invoke the pipe API with the pipe name and value:
pipe foo Hello pipes!
Pipes have several message delivery modes. Based on the mode, messages written to a pipe will be delivered to one or more readers. Mode "all" copies messages to all readers, "round-robin" chooses a single reader, in-order, and "random" selects a random reader.
Pipes can also have "vias", programs through which all written data is passed before being sent to readers. Unlike pipelines, vias are run for every reader. This allows for mutating data on a per-reader basis with a single write. For example, to send a unique floating-point value on a normal distribution with a written mean to all readers:
pipe foo via normal -stddev 5.0
pipe foo 1.5
Pipes in other namespaces can be referenced with the syntax
pipe_mode(pipe, all_or_round_robin_or_random)
¶
Variants:
pipe
Interact with named pipes. To write to a pipe, simply invoke the pipe API with the pipe name and value:
pipe foo Hello pipes!
Pipes have several message delivery modes. Based on the mode, messages written to a pipe will be delivered to one or more readers. Mode "all" copies messages to all readers, "round-robin" chooses a single reader, in-order, and "random" selects a random reader.
Pipes can also have "vias", programs through which all written data is passed before being sent to readers. Unlike pipelines, vias are run for every reader. This allows for mutating data on a per-reader basis with a single write. For example, to send a unique floating-point value on a normal distribution with a written mean to all readers:
pipe foo via normal -stddev 5.0
pipe foo 1.5
Pipes in other namespaces can be referenced with the syntax
pipe_via(pipe, command)
¶
Variants:
pipe
plumb(src=None, dst=None)
¶
Variants:
plumb
Create pipelines composed of named pipes and external programs. Pipelines pass data on standard I/O, with messages split on newlines. Pipelines are constructed similar to that of UNIX pipelines. For example, to pipeline named pipe "foo" through "sed" and into another pipe "bar":
plumb foo "sed -u s/foo/moo/" bar
When specifying pipelines, strings that are not found in $PATH are considered named pipes.
Pipelines can be composed into larger, nonlinear pipelines. For example, to create a simple tree rooted at A with leaves B and C, simply specify multiple pipelines:
plumb a b
plumb a c
qos_add_delay(vm, interface, duration)
¶
Variants:
qos add
Add quality-of-service (qos) constraints on mega interfaces to emulate real
networks. Currently only applies qos constraints on the egress side / transmit
direction. Qos constraints can be stacked with multiple calls to
Note that qos is namespace aware, and any qos commands will be matched to target vms within the currently active namespace.
qos constraints include:
- loss : packets will be randomly dropped with a specified probability
- delay : delay packets for specified unit of time (ms, ns, etc)
- rate : impose a maximum bandwidth on an interface in kbit, mbit, or gbit
Note: due to limitations of the underlying tool, "tc", you can only add rate or loss/delay to a VM. Enabling loss or delay will disable rate and vice versa.
Note: qos applies only to traffic received by the VM (which is "egress" traffic on the mega_tap interface on the host) -- traffic sent by the VM ("ingress" on the mega_tap interface on the host) is not policed to the desired rate.
Examples:
Randomly drop packets on the 0th interface for vms foo0, 1, and 2 with
probability 25%
qos add foo[0-2] 0 loss 25
Add a 100ms delay to every packet on the 0th interface for vm foo and bar
qos add foo,bar 0 delay 100ms
Rate limit the 0th interface on all vms in the active namespace to 1mbit/s
qos add all 0 rate 1 mbit
To clear active qos settings, use:
clear qos <vm> <interface|all>
Example:
clear qos foo all
qos_add_loss(vm, interface, percent)
¶
Variants:
qos add
Add quality-of-service (qos) constraints on mega interfaces to emulate real
networks. Currently only applies qos constraints on the egress side / transmit
direction. Qos constraints can be stacked with multiple calls to
Note that qos is namespace aware, and any qos commands will be matched to target vms within the currently active namespace.
qos constraints include:
- loss : packets will be randomly dropped with a specified probability
- delay : delay packets for specified unit of time (ms, ns, etc)
- rate : impose a maximum bandwidth on an interface in kbit, mbit, or gbit
Note: due to limitations of the underlying tool, "tc", you can only add rate or loss/delay to a VM. Enabling loss or delay will disable rate and vice versa.
Note: qos applies only to traffic received by the VM (which is "egress" traffic on the mega_tap interface on the host) -- traffic sent by the VM ("ingress" on the mega_tap interface on the host) is not policed to the desired rate.
Examples:
Randomly drop packets on the 0th interface for vms foo0, 1, and 2 with
probability 25%
qos add foo[0-2] 0 loss 25
Add a 100ms delay to every packet on the 0th interface for vm foo and bar
qos add foo,bar 0 delay 100ms
Rate limit the 0th interface on all vms in the active namespace to 1mbit/s
qos add all 0 rate 1 mbit
To clear active qos settings, use:
clear qos <vm> <interface|all>
Example:
clear qos foo all
qos_add_rate(vm, interface, bw, kbit_or_mbit_or_gbit)
¶
Variants:
qos add
Add quality-of-service (qos) constraints on mega interfaces to emulate real
networks. Currently only applies qos constraints on the egress side / transmit
direction. Qos constraints can be stacked with multiple calls to
Note that qos is namespace aware, and any qos commands will be matched to target vms within the currently active namespace.
qos constraints include:
- loss : packets will be randomly dropped with a specified probability
- delay : delay packets for specified unit of time (ms, ns, etc)
- rate : impose a maximum bandwidth on an interface in kbit, mbit, or gbit
Note: due to limitations of the underlying tool, "tc", you can only add rate or loss/delay to a VM. Enabling loss or delay will disable rate and vice versa.
Note: qos applies only to traffic received by the VM (which is "egress" traffic on the mega_tap interface on the host) -- traffic sent by the VM ("ingress" on the mega_tap interface on the host) is not policed to the desired rate.
Examples:
Randomly drop packets on the 0th interface for vms foo0, 1, and 2 with
probability 25%
qos add foo[0-2] 0 loss 25
Add a 100ms delay to every packet on the 0th interface for vm foo and bar
qos add foo,bar 0 delay 100ms
Rate limit the 0th interface on all vms in the active namespace to 1mbit/s
qos add all 0 rate 1 mbit
To clear active qos settings, use:
clear qos <vm> <interface|all>
Example:
clear qos foo all
quit(delay=None)
¶
Variants:
quit
Quit minimega. An optional integer argument X allows deferring the quit call for X seconds. This is useful for telling a mesh of minimega nodes to quit.
quit will not return a response to the cli, control socket, or meshage, it will simply exit. meshage connected nodes catch this and will remove the quit node from the mesh. External tools interfacing minimega must check for EOF on stdout or the control socket as an indication that minimega has quit.
read(file, check=None)
¶
Variants:
read
Read a command file and execute it. This has the same behavior as if you typed the file in manually. read stops if it reads an invalid command. read does not stop if a command returns an error. Nested reads are not permitted.
To prevent issues with another script changing the namespace and commands being run in a different namespace than originally intended, read records the active namespace when it starts and prepends that namespace to all commands that it reads from the file. If it reads a command that would change the active namespace, read updates its state so that the new namespace is prepended instead.
If the optional argument check is specified then read doesn't execute any of the commands in the file. Instead, it checks that all the commands are syntactically valid. This can identify mistyped commands in scripts before you read them. It cannot check for semantic errors (e.g. killing a non-existent VM). The check stops at the first invalid command.
router(vm)
¶
Variants:
router
Configure running minirouter VMs running minirouter and miniccc.
Routers are configured by specifying or updating a configuration, and then applying that configuration with a commit command. For example, to configure a router on a running VM named 'foo' to serve DHCP on 10.0.0.0/24 with a range of IPs:
router foo dhcp 10.0.0.0 range 10.0.0.100 10.0.0.200
router foo commit
router takes a number of subcommands:
-
'log': Change the log level of the minirouter tool on the VM.
-
'interface': Set IPv4 or IPv6 addresses, or configure an interface to assign using DHCP. The interface field is an integer index of the interface defined with 'vm config net'. You could also specify if that interface will be a loopback interface For example, to configure the second interface of the router with a static IP and a loopback with a different IP:
vm config net 100 200 # ... router foo interface 1 10.0.0.1/24 router foo interface 2 11.0.0.1/32 lo -
'dhcp': Configure one or more DHCP servers on the router. The API allows you to set several options including static IP assignments and the default route and DNS server. For example, to serve a range of IPs, with 2 static IPs explicitly called out on router with IP 10.0.0.1:
router vm foo dhcp 10.0.0.0 range 10.0.0.2 10.0.0.254 router vm foo dhcp 10.0.0.0 static 00:11:22:33:44:55 10.0.0.10 router vm foo dhcp 10.0.0.0 static 00:11:22:33:44:56 10.0.0.11 -
'dns': Set DNS records for IPv4 or IPv6 hosts.
-
'upstream': Set upstream server for DNS.
-
'gw': Set default gateway which will be used if there is no matching route.
-
'ra': Enable neighbor discovery protocol router advertisements for a given subnet.
-
'route': Set static, OSPF, or BGP routes. Static routes include a subnet, next-hop, and optionally a name for this router. For example to specify a static route(s):
router foo route static 0.0.0.0/0 10.0.0.1 default-route
OSPF routes include an area and a network index corresponding to the interface described in 'vm config net'. You can also specify what networks to advertise using the export command.
For example, to enable OSPF on area 0 for both interfaces of a router:
vm config net 100 200
# ...
router foo route ospf 0 0
router foo route ospf 0 1
For example, to advertise specific networks, advertise a static route or use a static route as a filter:
router foo route static 11.0.0.0/24 0 bar-route
router foo route static 12.0.0.0/24 0 bar-route
router foo route ospf 0 export 10.0.0.0/24
router foo route ospf 0 export default-route
router foo route ospf 0 export bar-route
To configure BGP must specify the process name for the specific bgp context, local ip address and AS, Neighbor ip address and AS, and what networks need to be advertised
For example, local router is in AS 100 with an ip 10.0.0.1 and bgp peer is in AS 200 with an ip of 20.0.0.1 and you want to advertise network 10.0.0.0/24:
router foo route static 10.0.0.0/24 0 foo_out
router foo bgp bar local 10.0.0.1 100
router foo bgp bar neighbor 20.0.0.1 200
router foo bgp bar export filter foo_out
You can set up route reflection for BGP by using the rrclient command for that process. By using the command it indicates that the peer is a bgp client:
router foo bgp bar rrclient
-
'rid': Sets the 32 bit router ID for the router. Typically this ID is unique across the organization's network and is used for various routing protocols ie OSPF
router foo rid 1.1.1.1 -
'fw': specify flows to accept/drop/reject via iptables. For example, to globally globally drop all forwarded packets and accept HTTP traffic from any IP address to host 192.168.0.5 on the interface at index 0 (which is on the 192.168.0.0/24 network):
router foo fw default drop router foo fw accept out 0 192.168.0.5:80 tcp
Note that we use 'out' here since we're applying the rule to the interface that's on the same network as the destination. The source and destination does not have to include a port.
New iptables chains can also be created, providing a method for grouping rules together instead of adding rules at the global level. Chains are then applied to one or more interfaces using the interface index. For example, one could put the previous rule into a chain named "allow-http" and apply it to the interface at index 0 via the following:
router foo fw chain allow-http default action drop
router foo fw chain allow-http action accept 192.168.0.5:80 tcp
router foo fw chain allow-http apply out 0
router_commit(vm)
¶
Variants:
router
Configure running minirouter VMs running minirouter and miniccc.
Routers are configured by specifying or updating a configuration, and then applying that configuration with a commit command. For example, to configure a router on a running VM named 'foo' to serve DHCP on 10.0.0.0/24 with a range of IPs:
router foo dhcp 10.0.0.0 range 10.0.0.100 10.0.0.200
router foo commit
router takes a number of subcommands:
-
'log': Change the log level of the minirouter tool on the VM.
-
'interface': Set IPv4 or IPv6 addresses, or configure an interface to assign using DHCP. The interface field is an integer index of the interface defined with 'vm config net'. You could also specify if that interface will be a loopback interface For example, to configure the second interface of the router with a static IP and a loopback with a different IP:
vm config net 100 200 # ... router foo interface 1 10.0.0.1/24 router foo interface 2 11.0.0.1/32 lo -
'dhcp': Configure one or more DHCP servers on the router. The API allows you to set several options including static IP assignments and the default route and DNS server. For example, to serve a range of IPs, with 2 static IPs explicitly called out on router with IP 10.0.0.1:
router vm foo dhcp 10.0.0.0 range 10.0.0.2 10.0.0.254 router vm foo dhcp 10.0.0.0 static 00:11:22:33:44:55 10.0.0.10 router vm foo dhcp 10.0.0.0 static 00:11:22:33:44:56 10.0.0.11 -
'dns': Set DNS records for IPv4 or IPv6 hosts.
-
'upstream': Set upstream server for DNS.
-
'gw': Set default gateway which will be used if there is no matching route.
-
'ra': Enable neighbor discovery protocol router advertisements for a given subnet.
-
'route': Set static, OSPF, or BGP routes. Static routes include a subnet, next-hop, and optionally a name for this router. For example to specify a static route(s):
router foo route static 0.0.0.0/0 10.0.0.1 default-route
OSPF routes include an area and a network index corresponding to the interface described in 'vm config net'. You can also specify what networks to advertise using the export command.
For example, to enable OSPF on area 0 for both interfaces of a router:
vm config net 100 200
# ...
router foo route ospf 0 0
router foo route ospf 0 1
For example, to advertise specific networks, advertise a static route or use a static route as a filter:
router foo route static 11.0.0.0/24 0 bar-route
router foo route static 12.0.0.0/24 0 bar-route
router foo route ospf 0 export 10.0.0.0/24
router foo route ospf 0 export default-route
router foo route ospf 0 export bar-route
To configure BGP must specify the process name for the specific bgp context, local ip address and AS, Neighbor ip address and AS, and what networks need to be advertised
For example, local router is in AS 100 with an ip 10.0.0.1 and bgp peer is in AS 200 with an ip of 20.0.0.1 and you want to advertise network 10.0.0.0/24:
router foo route static 10.0.0.0/24 0 foo_out
router foo bgp bar local 10.0.0.1 100
router foo bgp bar neighbor 20.0.0.1 200
router foo bgp bar export filter foo_out
You can set up route reflection for BGP by using the rrclient command for that process. By using the command it indicates that the peer is a bgp client:
router foo bgp bar rrclient
-
'rid': Sets the 32 bit router ID for the router. Typically this ID is unique across the organization's network and is used for various routing protocols ie OSPF
router foo rid 1.1.1.1 -
'fw': specify flows to accept/drop/reject via iptables. For example, to globally globally drop all forwarded packets and accept HTTP traffic from any IP address to host 192.168.0.5 on the interface at index 0 (which is on the 192.168.0.0/24 network):
router foo fw default drop router foo fw accept out 0 192.168.0.5:80 tcp
Note that we use 'out' here since we're applying the rule to the interface that's on the same network as the destination. The source and destination does not have to include a port.
New iptables chains can also be created, providing a method for grouping rules together instead of adding rules at the global level. Chains are then applied to one or more interfaces using the interface index. For example, one could put the previous rule into a chain named "allow-http" and apply it to the interface at index 0 via the following:
router foo fw chain allow-http default action drop
router foo fw chain allow-http action accept 192.168.0.5:80 tcp
router foo fw chain allow-http apply out 0
router_dhcp_dns(vm, listen, address)
¶
Variants:
router
Configure running minirouter VMs running minirouter and miniccc.
Routers are configured by specifying or updating a configuration, and then applying that configuration with a commit command. For example, to configure a router on a running VM named 'foo' to serve DHCP on 10.0.0.0/24 with a range of IPs:
router foo dhcp 10.0.0.0 range 10.0.0.100 10.0.0.200
router foo commit
router takes a number of subcommands:
-
'log': Change the log level of the minirouter tool on the VM.
-
'interface': Set IPv4 or IPv6 addresses, or configure an interface to assign using DHCP. The interface field is an integer index of the interface defined with 'vm config net'. You could also specify if that interface will be a loopback interface For example, to configure the second interface of the router with a static IP and a loopback with a different IP:
vm config net 100 200 # ... router foo interface 1 10.0.0.1/24 router foo interface 2 11.0.0.1/32 lo -
'dhcp': Configure one or more DHCP servers on the router. The API allows you to set several options including static IP assignments and the default route and DNS server. For example, to serve a range of IPs, with 2 static IPs explicitly called out on router with IP 10.0.0.1:
router vm foo dhcp 10.0.0.0 range 10.0.0.2 10.0.0.254 router vm foo dhcp 10.0.0.0 static 00:11:22:33:44:55 10.0.0.10 router vm foo dhcp 10.0.0.0 static 00:11:22:33:44:56 10.0.0.11 -
'dns': Set DNS records for IPv4 or IPv6 hosts.
-
'upstream': Set upstream server for DNS.
-
'gw': Set default gateway which will be used if there is no matching route.
-
'ra': Enable neighbor discovery protocol router advertisements for a given subnet.
-
'route': Set static, OSPF, or BGP routes. Static routes include a subnet, next-hop, and optionally a name for this router. For example to specify a static route(s):
router foo route static 0.0.0.0/0 10.0.0.1 default-route
OSPF routes include an area and a network index corresponding to the interface described in 'vm config net'. You can also specify what networks to advertise using the export command.
For example, to enable OSPF on area 0 for both interfaces of a router:
vm config net 100 200
# ...
router foo route ospf 0 0
router foo route ospf 0 1
For example, to advertise specific networks, advertise a static route or use a static route as a filter:
router foo route static 11.0.0.0/24 0 bar-route
router foo route static 12.0.0.0/24 0 bar-route
router foo route ospf 0 export 10.0.0.0/24
router foo route ospf 0 export default-route
router foo route ospf 0 export bar-route
To configure BGP must specify the process name for the specific bgp context, local ip address and AS, Neighbor ip address and AS, and what networks need to be advertised
For example, local router is in AS 100 with an ip 10.0.0.1 and bgp peer is in AS 200 with an ip of 20.0.0.1 and you want to advertise network 10.0.0.0/24:
router foo route static 10.0.0.0/24 0 foo_out
router foo bgp bar local 10.0.0.1 100
router foo bgp bar neighbor 20.0.0.1 200
router foo bgp bar export filter foo_out
You can set up route reflection for BGP by using the rrclient command for that process. By using the command it indicates that the peer is a bgp client:
router foo bgp bar rrclient
-
'rid': Sets the 32 bit router ID for the router. Typically this ID is unique across the organization's network and is used for various routing protocols ie OSPF
router foo rid 1.1.1.1 -
'fw': specify flows to accept/drop/reject via iptables. For example, to globally globally drop all forwarded packets and accept HTTP traffic from any IP address to host 192.168.0.5 on the interface at index 0 (which is on the 192.168.0.0/24 network):
router foo fw default drop router foo fw accept out 0 192.168.0.5:80 tcp
Note that we use 'out' here since we're applying the rule to the interface that's on the same network as the destination. The source and destination does not have to include a port.
New iptables chains can also be created, providing a method for grouping rules together instead of adding rules at the global level. Chains are then applied to one or more interfaces using the interface index. For example, one could put the previous rule into a chain named "allow-http" and apply it to the interface at index 0 via the following:
router foo fw chain allow-http default action drop
router foo fw chain allow-http action accept 192.168.0.5:80 tcp
router foo fw chain allow-http apply out 0
router_dhcp_range(vm, listen, low, high)
¶
Variants:
router
Configure running minirouter VMs running minirouter and miniccc.
Routers are configured by specifying or updating a configuration, and then applying that configuration with a commit command. For example, to configure a router on a running VM named 'foo' to serve DHCP on 10.0.0.0/24 with a range of IPs:
router foo dhcp 10.0.0.0 range 10.0.0.100 10.0.0.200
router foo commit
router takes a number of subcommands:
-
'log': Change the log level of the minirouter tool on the VM.
-
'interface': Set IPv4 or IPv6 addresses, or configure an interface to assign using DHCP. The interface field is an integer index of the interface defined with 'vm config net'. You could also specify if that interface will be a loopback interface For example, to configure the second interface of the router with a static IP and a loopback with a different IP:
vm config net 100 200 # ... router foo interface 1 10.0.0.1/24 router foo interface 2 11.0.0.1/32 lo -
'dhcp': Configure one or more DHCP servers on the router. The API allows you to set several options including static IP assignments and the default route and DNS server. For example, to serve a range of IPs, with 2 static IPs explicitly called out on router with IP 10.0.0.1:
router vm foo dhcp 10.0.0.0 range 10.0.0.2 10.0.0.254 router vm foo dhcp 10.0.0.0 static 00:11:22:33:44:55 10.0.0.10 router vm foo dhcp 10.0.0.0 static 00:11:22:33:44:56 10.0.0.11 -
'dns': Set DNS records for IPv4 or IPv6 hosts.
-
'upstream': Set upstream server for DNS.
-
'gw': Set default gateway which will be used if there is no matching route.
-
'ra': Enable neighbor discovery protocol router advertisements for a given subnet.
-
'route': Set static, OSPF, or BGP routes. Static routes include a subnet, next-hop, and optionally a name for this router. For example to specify a static route(s):
router foo route static 0.0.0.0/0 10.0.0.1 default-route
OSPF routes include an area and a network index corresponding to the interface described in 'vm config net'. You can also specify what networks to advertise using the export command.
For example, to enable OSPF on area 0 for both interfaces of a router:
vm config net 100 200
# ...
router foo route ospf 0 0
router foo route ospf 0 1
For example, to advertise specific networks, advertise a static route or use a static route as a filter:
router foo route static 11.0.0.0/24 0 bar-route
router foo route static 12.0.0.0/24 0 bar-route
router foo route ospf 0 export 10.0.0.0/24
router foo route ospf 0 export default-route
router foo route ospf 0 export bar-route
To configure BGP must specify the process name for the specific bgp context, local ip address and AS, Neighbor ip address and AS, and what networks need to be advertised
For example, local router is in AS 100 with an ip 10.0.0.1 and bgp peer is in AS 200 with an ip of 20.0.0.1 and you want to advertise network 10.0.0.0/24:
router foo route static 10.0.0.0/24 0 foo_out
router foo bgp bar local 10.0.0.1 100
router foo bgp bar neighbor 20.0.0.1 200
router foo bgp bar export filter foo_out
You can set up route reflection for BGP by using the rrclient command for that process. By using the command it indicates that the peer is a bgp client:
router foo bgp bar rrclient
-
'rid': Sets the 32 bit router ID for the router. Typically this ID is unique across the organization's network and is used for various routing protocols ie OSPF
router foo rid 1.1.1.1 -
'fw': specify flows to accept/drop/reject via iptables. For example, to globally globally drop all forwarded packets and accept HTTP traffic from any IP address to host 192.168.0.5 on the interface at index 0 (which is on the 192.168.0.0/24 network):
router foo fw default drop router foo fw accept out 0 192.168.0.5:80 tcp
Note that we use 'out' here since we're applying the rule to the interface that's on the same network as the destination. The source and destination does not have to include a port.
New iptables chains can also be created, providing a method for grouping rules together instead of adding rules at the global level. Chains are then applied to one or more interfaces using the interface index. For example, one could put the previous rule into a chain named "allow-http" and apply it to the interface at index 0 via the following:
router foo fw chain allow-http default action drop
router foo fw chain allow-http action accept 192.168.0.5:80 tcp
router foo fw chain allow-http apply out 0
router_dhcp_router(vm, listen, router)
¶
Variants:
router
Configure running minirouter VMs running minirouter and miniccc.
Routers are configured by specifying or updating a configuration, and then applying that configuration with a commit command. For example, to configure a router on a running VM named 'foo' to serve DHCP on 10.0.0.0/24 with a range of IPs:
router foo dhcp 10.0.0.0 range 10.0.0.100 10.0.0.200
router foo commit
router takes a number of subcommands:
-
'log': Change the log level of the minirouter tool on the VM.
-
'interface': Set IPv4 or IPv6 addresses, or configure an interface to assign using DHCP. The interface field is an integer index of the interface defined with 'vm config net'. You could also specify if that interface will be a loopback interface For example, to configure the second interface of the router with a static IP and a loopback with a different IP:
vm config net 100 200 # ... router foo interface 1 10.0.0.1/24 router foo interface 2 11.0.0.1/32 lo -
'dhcp': Configure one or more DHCP servers on the router. The API allows you to set several options including static IP assignments and the default route and DNS server. For example, to serve a range of IPs, with 2 static IPs explicitly called out on router with IP 10.0.0.1:
router vm foo dhcp 10.0.0.0 range 10.0.0.2 10.0.0.254 router vm foo dhcp 10.0.0.0 static 00:11:22:33:44:55 10.0.0.10 router vm foo dhcp 10.0.0.0 static 00:11:22:33:44:56 10.0.0.11 -
'dns': Set DNS records for IPv4 or IPv6 hosts.
-
'upstream': Set upstream server for DNS.
-
'gw': Set default gateway which will be used if there is no matching route.
-
'ra': Enable neighbor discovery protocol router advertisements for a given subnet.
-
'route': Set static, OSPF, or BGP routes. Static routes include a subnet, next-hop, and optionally a name for this router. For example to specify a static route(s):
router foo route static 0.0.0.0/0 10.0.0.1 default-route
OSPF routes include an area and a network index corresponding to the interface described in 'vm config net'. You can also specify what networks to advertise using the export command.
For example, to enable OSPF on area 0 for both interfaces of a router:
vm config net 100 200
# ...
router foo route ospf 0 0
router foo route ospf 0 1
For example, to advertise specific networks, advertise a static route or use a static route as a filter:
router foo route static 11.0.0.0/24 0 bar-route
router foo route static 12.0.0.0/24 0 bar-route
router foo route ospf 0 export 10.0.0.0/24
router foo route ospf 0 export default-route
router foo route ospf 0 export bar-route
To configure BGP must specify the process name for the specific bgp context, local ip address and AS, Neighbor ip address and AS, and what networks need to be advertised
For example, local router is in AS 100 with an ip 10.0.0.1 and bgp peer is in AS 200 with an ip of 20.0.0.1 and you want to advertise network 10.0.0.0/24:
router foo route static 10.0.0.0/24 0 foo_out
router foo bgp bar local 10.0.0.1 100
router foo bgp bar neighbor 20.0.0.1 200
router foo bgp bar export filter foo_out
You can set up route reflection for BGP by using the rrclient command for that process. By using the command it indicates that the peer is a bgp client:
router foo bgp bar rrclient
-
'rid': Sets the 32 bit router ID for the router. Typically this ID is unique across the organization's network and is used for various routing protocols ie OSPF
router foo rid 1.1.1.1 -
'fw': specify flows to accept/drop/reject via iptables. For example, to globally globally drop all forwarded packets and accept HTTP traffic from any IP address to host 192.168.0.5 on the interface at index 0 (which is on the 192.168.0.0/24 network):
router foo fw default drop router foo fw accept out 0 192.168.0.5:80 tcp
Note that we use 'out' here since we're applying the rule to the interface that's on the same network as the destination. The source and destination does not have to include a port.
New iptables chains can also be created, providing a method for grouping rules together instead of adding rules at the global level. Chains are then applied to one or more interfaces using the interface index. For example, one could put the previous rule into a chain named "allow-http" and apply it to the interface at index 0 via the following:
router foo fw chain allow-http default action drop
router foo fw chain allow-http action accept 192.168.0.5:80 tcp
router foo fw chain allow-http apply out 0
router_dhcp_static(vm, listen, mac, ip)
¶
Variants:
router
Configure running minirouter VMs running minirouter and miniccc.
Routers are configured by specifying or updating a configuration, and then applying that configuration with a commit command. For example, to configure a router on a running VM named 'foo' to serve DHCP on 10.0.0.0/24 with a range of IPs:
router foo dhcp 10.0.0.0 range 10.0.0.100 10.0.0.200
router foo commit
router takes a number of subcommands:
-
'log': Change the log level of the minirouter tool on the VM.
-
'interface': Set IPv4 or IPv6 addresses, or configure an interface to assign using DHCP. The interface field is an integer index of the interface defined with 'vm config net'. You could also specify if that interface will be a loopback interface For example, to configure the second interface of the router with a static IP and a loopback with a different IP:
vm config net 100 200 # ... router foo interface 1 10.0.0.1/24 router foo interface 2 11.0.0.1/32 lo -
'dhcp': Configure one or more DHCP servers on the router. The API allows you to set several options including static IP assignments and the default route and DNS server. For example, to serve a range of IPs, with 2 static IPs explicitly called out on router with IP 10.0.0.1:
router vm foo dhcp 10.0.0.0 range 10.0.0.2 10.0.0.254 router vm foo dhcp 10.0.0.0 static 00:11:22:33:44:55 10.0.0.10 router vm foo dhcp 10.0.0.0 static 00:11:22:33:44:56 10.0.0.11 -
'dns': Set DNS records for IPv4 or IPv6 hosts.
-
'upstream': Set upstream server for DNS.
-
'gw': Set default gateway which will be used if there is no matching route.
-
'ra': Enable neighbor discovery protocol router advertisements for a given subnet.
-
'route': Set static, OSPF, or BGP routes. Static routes include a subnet, next-hop, and optionally a name for this router. For example to specify a static route(s):
router foo route static 0.0.0.0/0 10.0.0.1 default-route
OSPF routes include an area and a network index corresponding to the interface described in 'vm config net'. You can also specify what networks to advertise using the export command.
For example, to enable OSPF on area 0 for both interfaces of a router:
vm config net 100 200
# ...
router foo route ospf 0 0
router foo route ospf 0 1
For example, to advertise specific networks, advertise a static route or use a static route as a filter:
router foo route static 11.0.0.0/24 0 bar-route
router foo route static 12.0.0.0/24 0 bar-route
router foo route ospf 0 export 10.0.0.0/24
router foo route ospf 0 export default-route
router foo route ospf 0 export bar-route
To configure BGP must specify the process name for the specific bgp context, local ip address and AS, Neighbor ip address and AS, and what networks need to be advertised
For example, local router is in AS 100 with an ip 10.0.0.1 and bgp peer is in AS 200 with an ip of 20.0.0.1 and you want to advertise network 10.0.0.0/24:
router foo route static 10.0.0.0/24 0 foo_out
router foo bgp bar local 10.0.0.1 100
router foo bgp bar neighbor 20.0.0.1 200
router foo bgp bar export filter foo_out
You can set up route reflection for BGP by using the rrclient command for that process. By using the command it indicates that the peer is a bgp client:
router foo bgp bar rrclient
-
'rid': Sets the 32 bit router ID for the router. Typically this ID is unique across the organization's network and is used for various routing protocols ie OSPF
router foo rid 1.1.1.1 -
'fw': specify flows to accept/drop/reject via iptables. For example, to globally globally drop all forwarded packets and accept HTTP traffic from any IP address to host 192.168.0.5 on the interface at index 0 (which is on the 192.168.0.0/24 network):
router foo fw default drop router foo fw accept out 0 192.168.0.5:80 tcp
Note that we use 'out' here since we're applying the rule to the interface that's on the same network as the destination. The source and destination does not have to include a port.
New iptables chains can also be created, providing a method for grouping rules together instead of adding rules at the global level. Chains are then applied to one or more interfaces using the interface index. For example, one could put the previous rule into a chain named "allow-http" and apply it to the interface at index 0 via the following:
router foo fw chain allow-http default action drop
router foo fw chain allow-http action accept 192.168.0.5:80 tcp
router foo fw chain allow-http apply out 0
router_dns(vm, ip, hostname)
¶
Variants:
router
Configure running minirouter VMs running minirouter and miniccc.
Routers are configured by specifying or updating a configuration, and then applying that configuration with a commit command. For example, to configure a router on a running VM named 'foo' to serve DHCP on 10.0.0.0/24 with a range of IPs:
router foo dhcp 10.0.0.0 range 10.0.0.100 10.0.0.200
router foo commit
router takes a number of subcommands:
-
'log': Change the log level of the minirouter tool on the VM.
-
'interface': Set IPv4 or IPv6 addresses, or configure an interface to assign using DHCP. The interface field is an integer index of the interface defined with 'vm config net'. You could also specify if that interface will be a loopback interface For example, to configure the second interface of the router with a static IP and a loopback with a different IP:
vm config net 100 200 # ... router foo interface 1 10.0.0.1/24 router foo interface 2 11.0.0.1/32 lo -
'dhcp': Configure one or more DHCP servers on the router. The API allows you to set several options including static IP assignments and the default route and DNS server. For example, to serve a range of IPs, with 2 static IPs explicitly called out on router with IP 10.0.0.1:
router vm foo dhcp 10.0.0.0 range 10.0.0.2 10.0.0.254 router vm foo dhcp 10.0.0.0 static 00:11:22:33:44:55 10.0.0.10 router vm foo dhcp 10.0.0.0 static 00:11:22:33:44:56 10.0.0.11 -
'dns': Set DNS records for IPv4 or IPv6 hosts.
-
'upstream': Set upstream server for DNS.
-
'gw': Set default gateway which will be used if there is no matching route.
-
'ra': Enable neighbor discovery protocol router advertisements for a given subnet.
-
'route': Set static, OSPF, or BGP routes. Static routes include a subnet, next-hop, and optionally a name for this router. For example to specify a static route(s):
router foo route static 0.0.0.0/0 10.0.0.1 default-route
OSPF routes include an area and a network index corresponding to the interface described in 'vm config net'. You can also specify what networks to advertise using the export command.
For example, to enable OSPF on area 0 for both interfaces of a router:
vm config net 100 200
# ...
router foo route ospf 0 0
router foo route ospf 0 1
For example, to advertise specific networks, advertise a static route or use a static route as a filter:
router foo route static 11.0.0.0/24 0 bar-route
router foo route static 12.0.0.0/24 0 bar-route
router foo route ospf 0 export 10.0.0.0/24
router foo route ospf 0 export default-route
router foo route ospf 0 export bar-route
To configure BGP must specify the process name for the specific bgp context, local ip address and AS, Neighbor ip address and AS, and what networks need to be advertised
For example, local router is in AS 100 with an ip 10.0.0.1 and bgp peer is in AS 200 with an ip of 20.0.0.1 and you want to advertise network 10.0.0.0/24:
router foo route static 10.0.0.0/24 0 foo_out
router foo bgp bar local 10.0.0.1 100
router foo bgp bar neighbor 20.0.0.1 200
router foo bgp bar export filter foo_out
You can set up route reflection for BGP by using the rrclient command for that process. By using the command it indicates that the peer is a bgp client:
router foo bgp bar rrclient
-
'rid': Sets the 32 bit router ID for the router. Typically this ID is unique across the organization's network and is used for various routing protocols ie OSPF
router foo rid 1.1.1.1 -
'fw': specify flows to accept/drop/reject via iptables. For example, to globally globally drop all forwarded packets and accept HTTP traffic from any IP address to host 192.168.0.5 on the interface at index 0 (which is on the 192.168.0.0/24 network):
router foo fw default drop router foo fw accept out 0 192.168.0.5:80 tcp
Note that we use 'out' here since we're applying the rule to the interface that's on the same network as the destination. The source and destination does not have to include a port.
New iptables chains can also be created, providing a method for grouping rules together instead of adding rules at the global level. Chains are then applied to one or more interfaces using the interface index. For example, one could put the previous rule into a chain named "allow-http" and apply it to the interface at index 0 via the following:
router foo fw chain allow-http default action drop
router foo fw chain allow-http action accept 192.168.0.5:80 tcp
router foo fw chain allow-http apply out 0
router_fw(vm, accept_or_drop_or_reject, in_or_out, index, dst, proto, src=None)
¶
Variants:
router
Configure running minirouter VMs running minirouter and miniccc.
Routers are configured by specifying or updating a configuration, and then applying that configuration with a commit command. For example, to configure a router on a running VM named 'foo' to serve DHCP on 10.0.0.0/24 with a range of IPs:
router foo dhcp 10.0.0.0 range 10.0.0.100 10.0.0.200
router foo commit
router takes a number of subcommands:
-
'log': Change the log level of the minirouter tool on the VM.
-
'interface': Set IPv4 or IPv6 addresses, or configure an interface to assign using DHCP. The interface field is an integer index of the interface defined with 'vm config net'. You could also specify if that interface will be a loopback interface For example, to configure the second interface of the router with a static IP and a loopback with a different IP:
vm config net 100 200 # ... router foo interface 1 10.0.0.1/24 router foo interface 2 11.0.0.1/32 lo -
'dhcp': Configure one or more DHCP servers on the router. The API allows you to set several options including static IP assignments and the default route and DNS server. For example, to serve a range of IPs, with 2 static IPs explicitly called out on router with IP 10.0.0.1:
router vm foo dhcp 10.0.0.0 range 10.0.0.2 10.0.0.254 router vm foo dhcp 10.0.0.0 static 00:11:22:33:44:55 10.0.0.10 router vm foo dhcp 10.0.0.0 static 00:11:22:33:44:56 10.0.0.11 -
'dns': Set DNS records for IPv4 or IPv6 hosts.
-
'upstream': Set upstream server for DNS.
-
'gw': Set default gateway which will be used if there is no matching route.
-
'ra': Enable neighbor discovery protocol router advertisements for a given subnet.
-
'route': Set static, OSPF, or BGP routes. Static routes include a subnet, next-hop, and optionally a name for this router. For example to specify a static route(s):
router foo route static 0.0.0.0/0 10.0.0.1 default-route
OSPF routes include an area and a network index corresponding to the interface described in 'vm config net'. You can also specify what networks to advertise using the export command.
For example, to enable OSPF on area 0 for both interfaces of a router:
vm config net 100 200
# ...
router foo route ospf 0 0
router foo route ospf 0 1
For example, to advertise specific networks, advertise a static route or use a static route as a filter:
router foo route static 11.0.0.0/24 0 bar-route
router foo route static 12.0.0.0/24 0 bar-route
router foo route ospf 0 export 10.0.0.0/24
router foo route ospf 0 export default-route
router foo route ospf 0 export bar-route
To configure BGP must specify the process name for the specific bgp context, local ip address and AS, Neighbor ip address and AS, and what networks need to be advertised
For example, local router is in AS 100 with an ip 10.0.0.1 and bgp peer is in AS 200 with an ip of 20.0.0.1 and you want to advertise network 10.0.0.0/24:
router foo route static 10.0.0.0/24 0 foo_out
router foo bgp bar local 10.0.0.1 100
router foo bgp bar neighbor 20.0.0.1 200
router foo bgp bar export filter foo_out
You can set up route reflection for BGP by using the rrclient command for that process. By using the command it indicates that the peer is a bgp client:
router foo bgp bar rrclient
-
'rid': Sets the 32 bit router ID for the router. Typically this ID is unique across the organization's network and is used for various routing protocols ie OSPF
router foo rid 1.1.1.1 -
'fw': specify flows to accept/drop/reject via iptables. For example, to globally globally drop all forwarded packets and accept HTTP traffic from any IP address to host 192.168.0.5 on the interface at index 0 (which is on the 192.168.0.0/24 network):
router foo fw default drop router foo fw accept out 0 192.168.0.5:80 tcp
Note that we use 'out' here since we're applying the rule to the interface that's on the same network as the destination. The source and destination does not have to include a port.
New iptables chains can also be created, providing a method for grouping rules together instead of adding rules at the global level. Chains are then applied to one or more interfaces using the interface index. For example, one could put the previous rule into a chain named "allow-http" and apply it to the interface at index 0 via the following:
router foo fw chain allow-http default action drop
router foo fw chain allow-http action accept 192.168.0.5:80 tcp
router foo fw chain allow-http apply out 0
router_fw_chain_action(vm, chain, accept_or_drop_or_reject, dst, proto, src=None)
¶
Variants:
router
Configure running minirouter VMs running minirouter and miniccc.
Routers are configured by specifying or updating a configuration, and then applying that configuration with a commit command. For example, to configure a router on a running VM named 'foo' to serve DHCP on 10.0.0.0/24 with a range of IPs:
router foo dhcp 10.0.0.0 range 10.0.0.100 10.0.0.200
router foo commit
router takes a number of subcommands:
-
'log': Change the log level of the minirouter tool on the VM.
-
'interface': Set IPv4 or IPv6 addresses, or configure an interface to assign using DHCP. The interface field is an integer index of the interface defined with 'vm config net'. You could also specify if that interface will be a loopback interface For example, to configure the second interface of the router with a static IP and a loopback with a different IP:
vm config net 100 200 # ... router foo interface 1 10.0.0.1/24 router foo interface 2 11.0.0.1/32 lo -
'dhcp': Configure one or more DHCP servers on the router. The API allows you to set several options including static IP assignments and the default route and DNS server. For example, to serve a range of IPs, with 2 static IPs explicitly called out on router with IP 10.0.0.1:
router vm foo dhcp 10.0.0.0 range 10.0.0.2 10.0.0.254 router vm foo dhcp 10.0.0.0 static 00:11:22:33:44:55 10.0.0.10 router vm foo dhcp 10.0.0.0 static 00:11:22:33:44:56 10.0.0.11 -
'dns': Set DNS records for IPv4 or IPv6 hosts.
-
'upstream': Set upstream server for DNS.
-
'gw': Set default gateway which will be used if there is no matching route.
-
'ra': Enable neighbor discovery protocol router advertisements for a given subnet.
-
'route': Set static, OSPF, or BGP routes. Static routes include a subnet, next-hop, and optionally a name for this router. For example to specify a static route(s):
router foo route static 0.0.0.0/0 10.0.0.1 default-route
OSPF routes include an area and a network index corresponding to the interface described in 'vm config net'. You can also specify what networks to advertise using the export command.
For example, to enable OSPF on area 0 for both interfaces of a router:
vm config net 100 200
# ...
router foo route ospf 0 0
router foo route ospf 0 1
For example, to advertise specific networks, advertise a static route or use a static route as a filter:
router foo route static 11.0.0.0/24 0 bar-route
router foo route static 12.0.0.0/24 0 bar-route
router foo route ospf 0 export 10.0.0.0/24
router foo route ospf 0 export default-route
router foo route ospf 0 export bar-route
To configure BGP must specify the process name for the specific bgp context, local ip address and AS, Neighbor ip address and AS, and what networks need to be advertised
For example, local router is in AS 100 with an ip 10.0.0.1 and bgp peer is in AS 200 with an ip of 20.0.0.1 and you want to advertise network 10.0.0.0/24:
router foo route static 10.0.0.0/24 0 foo_out
router foo bgp bar local 10.0.0.1 100
router foo bgp bar neighbor 20.0.0.1 200
router foo bgp bar export filter foo_out
You can set up route reflection for BGP by using the rrclient command for that process. By using the command it indicates that the peer is a bgp client:
router foo bgp bar rrclient
-
'rid': Sets the 32 bit router ID for the router. Typically this ID is unique across the organization's network and is used for various routing protocols ie OSPF
router foo rid 1.1.1.1 -
'fw': specify flows to accept/drop/reject via iptables. For example, to globally globally drop all forwarded packets and accept HTTP traffic from any IP address to host 192.168.0.5 on the interface at index 0 (which is on the 192.168.0.0/24 network):
router foo fw default drop router foo fw accept out 0 192.168.0.5:80 tcp
Note that we use 'out' here since we're applying the rule to the interface that's on the same network as the destination. The source and destination does not have to include a port.
New iptables chains can also be created, providing a method for grouping rules together instead of adding rules at the global level. Chains are then applied to one or more interfaces using the interface index. For example, one could put the previous rule into a chain named "allow-http" and apply it to the interface at index 0 via the following:
router foo fw chain allow-http default action drop
router foo fw chain allow-http action accept 192.168.0.5:80 tcp
router foo fw chain allow-http apply out 0
router_fw_chain_apply(vm, chain, in_or_out, index)
¶
Variants:
router
Configure running minirouter VMs running minirouter and miniccc.
Routers are configured by specifying or updating a configuration, and then applying that configuration with a commit command. For example, to configure a router on a running VM named 'foo' to serve DHCP on 10.0.0.0/24 with a range of IPs:
router foo dhcp 10.0.0.0 range 10.0.0.100 10.0.0.200
router foo commit
router takes a number of subcommands:
-
'log': Change the log level of the minirouter tool on the VM.
-
'interface': Set IPv4 or IPv6 addresses, or configure an interface to assign using DHCP. The interface field is an integer index of the interface defined with 'vm config net'. You could also specify if that interface will be a loopback interface For example, to configure the second interface of the router with a static IP and a loopback with a different IP:
vm config net 100 200 # ... router foo interface 1 10.0.0.1/24 router foo interface 2 11.0.0.1/32 lo -
'dhcp': Configure one or more DHCP servers on the router. The API allows you to set several options including static IP assignments and the default route and DNS server. For example, to serve a range of IPs, with 2 static IPs explicitly called out on router with IP 10.0.0.1:
router vm foo dhcp 10.0.0.0 range 10.0.0.2 10.0.0.254 router vm foo dhcp 10.0.0.0 static 00:11:22:33:44:55 10.0.0.10 router vm foo dhcp 10.0.0.0 static 00:11:22:33:44:56 10.0.0.11 -
'dns': Set DNS records for IPv4 or IPv6 hosts.
-
'upstream': Set upstream server for DNS.
-
'gw': Set default gateway which will be used if there is no matching route.
-
'ra': Enable neighbor discovery protocol router advertisements for a given subnet.
-
'route': Set static, OSPF, or BGP routes. Static routes include a subnet, next-hop, and optionally a name for this router. For example to specify a static route(s):
router foo route static 0.0.0.0/0 10.0.0.1 default-route
OSPF routes include an area and a network index corresponding to the interface described in 'vm config net'. You can also specify what networks to advertise using the export command.
For example, to enable OSPF on area 0 for both interfaces of a router:
vm config net 100 200
# ...
router foo route ospf 0 0
router foo route ospf 0 1
For example, to advertise specific networks, advertise a static route or use a static route as a filter:
router foo route static 11.0.0.0/24 0 bar-route
router foo route static 12.0.0.0/24 0 bar-route
router foo route ospf 0 export 10.0.0.0/24
router foo route ospf 0 export default-route
router foo route ospf 0 export bar-route
To configure BGP must specify the process name for the specific bgp context, local ip address and AS, Neighbor ip address and AS, and what networks need to be advertised
For example, local router is in AS 100 with an ip 10.0.0.1 and bgp peer is in AS 200 with an ip of 20.0.0.1 and you want to advertise network 10.0.0.0/24:
router foo route static 10.0.0.0/24 0 foo_out
router foo bgp bar local 10.0.0.1 100
router foo bgp bar neighbor 20.0.0.1 200
router foo bgp bar export filter foo_out
You can set up route reflection for BGP by using the rrclient command for that process. By using the command it indicates that the peer is a bgp client:
router foo bgp bar rrclient
-
'rid': Sets the 32 bit router ID for the router. Typically this ID is unique across the organization's network and is used for various routing protocols ie OSPF
router foo rid 1.1.1.1 -
'fw': specify flows to accept/drop/reject via iptables. For example, to globally globally drop all forwarded packets and accept HTTP traffic from any IP address to host 192.168.0.5 on the interface at index 0 (which is on the 192.168.0.0/24 network):
router foo fw default drop router foo fw accept out 0 192.168.0.5:80 tcp
Note that we use 'out' here since we're applying the rule to the interface that's on the same network as the destination. The source and destination does not have to include a port.
New iptables chains can also be created, providing a method for grouping rules together instead of adding rules at the global level. Chains are then applied to one or more interfaces using the interface index. For example, one could put the previous rule into a chain named "allow-http" and apply it to the interface at index 0 via the following:
router foo fw chain allow-http default action drop
router foo fw chain allow-http action accept 192.168.0.5:80 tcp
router foo fw chain allow-http apply out 0
router_fw_chain_default_action(vm, chain, accept_or_drop_or_reject)
¶
Variants:
router
Configure running minirouter VMs running minirouter and miniccc.
Routers are configured by specifying or updating a configuration, and then applying that configuration with a commit command. For example, to configure a router on a running VM named 'foo' to serve DHCP on 10.0.0.0/24 with a range of IPs:
router foo dhcp 10.0.0.0 range 10.0.0.100 10.0.0.200
router foo commit
router takes a number of subcommands:
-
'log': Change the log level of the minirouter tool on the VM.
-
'interface': Set IPv4 or IPv6 addresses, or configure an interface to assign using DHCP. The interface field is an integer index of the interface defined with 'vm config net'. You could also specify if that interface will be a loopback interface For example, to configure the second interface of the router with a static IP and a loopback with a different IP:
vm config net 100 200 # ... router foo interface 1 10.0.0.1/24 router foo interface 2 11.0.0.1/32 lo -
'dhcp': Configure one or more DHCP servers on the router. The API allows you to set several options including static IP assignments and the default route and DNS server. For example, to serve a range of IPs, with 2 static IPs explicitly called out on router with IP 10.0.0.1:
router vm foo dhcp 10.0.0.0 range 10.0.0.2 10.0.0.254 router vm foo dhcp 10.0.0.0 static 00:11:22:33:44:55 10.0.0.10 router vm foo dhcp 10.0.0.0 static 00:11:22:33:44:56 10.0.0.11 -
'dns': Set DNS records for IPv4 or IPv6 hosts.
-
'upstream': Set upstream server for DNS.
-
'gw': Set default gateway which will be used if there is no matching route.
-
'ra': Enable neighbor discovery protocol router advertisements for a given subnet.
-
'route': Set static, OSPF, or BGP routes. Static routes include a subnet, next-hop, and optionally a name for this router. For example to specify a static route(s):
router foo route static 0.0.0.0/0 10.0.0.1 default-route
OSPF routes include an area and a network index corresponding to the interface described in 'vm config net'. You can also specify what networks to advertise using the export command.
For example, to enable OSPF on area 0 for both interfaces of a router:
vm config net 100 200
# ...
router foo route ospf 0 0
router foo route ospf 0 1
For example, to advertise specific networks, advertise a static route or use a static route as a filter:
router foo route static 11.0.0.0/24 0 bar-route
router foo route static 12.0.0.0/24 0 bar-route
router foo route ospf 0 export 10.0.0.0/24
router foo route ospf 0 export default-route
router foo route ospf 0 export bar-route
To configure BGP must specify the process name for the specific bgp context, local ip address and AS, Neighbor ip address and AS, and what networks need to be advertised
For example, local router is in AS 100 with an ip 10.0.0.1 and bgp peer is in AS 200 with an ip of 20.0.0.1 and you want to advertise network 10.0.0.0/24:
router foo route static 10.0.0.0/24 0 foo_out
router foo bgp bar local 10.0.0.1 100
router foo bgp bar neighbor 20.0.0.1 200
router foo bgp bar export filter foo_out
You can set up route reflection for BGP by using the rrclient command for that process. By using the command it indicates that the peer is a bgp client:
router foo bgp bar rrclient
-
'rid': Sets the 32 bit router ID for the router. Typically this ID is unique across the organization's network and is used for various routing protocols ie OSPF
router foo rid 1.1.1.1 -
'fw': specify flows to accept/drop/reject via iptables. For example, to globally globally drop all forwarded packets and accept HTTP traffic from any IP address to host 192.168.0.5 on the interface at index 0 (which is on the 192.168.0.0/24 network):
router foo fw default drop router foo fw accept out 0 192.168.0.5:80 tcp
Note that we use 'out' here since we're applying the rule to the interface that's on the same network as the destination. The source and destination does not have to include a port.
New iptables chains can also be created, providing a method for grouping rules together instead of adding rules at the global level. Chains are then applied to one or more interfaces using the interface index. For example, one could put the previous rule into a chain named "allow-http" and apply it to the interface at index 0 via the following:
router foo fw chain allow-http default action drop
router foo fw chain allow-http action accept 192.168.0.5:80 tcp
router foo fw chain allow-http apply out 0
router_fw_default(vm, accept_or_drop)
¶
Variants:
router
Configure running minirouter VMs running minirouter and miniccc.
Routers are configured by specifying or updating a configuration, and then applying that configuration with a commit command. For example, to configure a router on a running VM named 'foo' to serve DHCP on 10.0.0.0/24 with a range of IPs:
router foo dhcp 10.0.0.0 range 10.0.0.100 10.0.0.200
router foo commit
router takes a number of subcommands:
-
'log': Change the log level of the minirouter tool on the VM.
-
'interface': Set IPv4 or IPv6 addresses, or configure an interface to assign using DHCP. The interface field is an integer index of the interface defined with 'vm config net'. You could also specify if that interface will be a loopback interface For example, to configure the second interface of the router with a static IP and a loopback with a different IP:
vm config net 100 200 # ... router foo interface 1 10.0.0.1/24 router foo interface 2 11.0.0.1/32 lo -
'dhcp': Configure one or more DHCP servers on the router. The API allows you to set several options including static IP assignments and the default route and DNS server. For example, to serve a range of IPs, with 2 static IPs explicitly called out on router with IP 10.0.0.1:
router vm foo dhcp 10.0.0.0 range 10.0.0.2 10.0.0.254 router vm foo dhcp 10.0.0.0 static 00:11:22:33:44:55 10.0.0.10 router vm foo dhcp 10.0.0.0 static 00:11:22:33:44:56 10.0.0.11 -
'dns': Set DNS records for IPv4 or IPv6 hosts.
-
'upstream': Set upstream server for DNS.
-
'gw': Set default gateway which will be used if there is no matching route.
-
'ra': Enable neighbor discovery protocol router advertisements for a given subnet.
-
'route': Set static, OSPF, or BGP routes. Static routes include a subnet, next-hop, and optionally a name for this router. For example to specify a static route(s):
router foo route static 0.0.0.0/0 10.0.0.1 default-route
OSPF routes include an area and a network index corresponding to the interface described in 'vm config net'. You can also specify what networks to advertise using the export command.
For example, to enable OSPF on area 0 for both interfaces of a router:
vm config net 100 200
# ...
router foo route ospf 0 0
router foo route ospf 0 1
For example, to advertise specific networks, advertise a static route or use a static route as a filter:
router foo route static 11.0.0.0/24 0 bar-route
router foo route static 12.0.0.0/24 0 bar-route
router foo route ospf 0 export 10.0.0.0/24
router foo route ospf 0 export default-route
router foo route ospf 0 export bar-route
To configure BGP must specify the process name for the specific bgp context, local ip address and AS, Neighbor ip address and AS, and what networks need to be advertised
For example, local router is in AS 100 with an ip 10.0.0.1 and bgp peer is in AS 200 with an ip of 20.0.0.1 and you want to advertise network 10.0.0.0/24:
router foo route static 10.0.0.0/24 0 foo_out
router foo bgp bar local 10.0.0.1 100
router foo bgp bar neighbor 20.0.0.1 200
router foo bgp bar export filter foo_out
You can set up route reflection for BGP by using the rrclient command for that process. By using the command it indicates that the peer is a bgp client:
router foo bgp bar rrclient
-
'rid': Sets the 32 bit router ID for the router. Typically this ID is unique across the organization's network and is used for various routing protocols ie OSPF
router foo rid 1.1.1.1 -
'fw': specify flows to accept/drop/reject via iptables. For example, to globally globally drop all forwarded packets and accept HTTP traffic from any IP address to host 192.168.0.5 on the interface at index 0 (which is on the 192.168.0.0/24 network):
router foo fw default drop router foo fw accept out 0 192.168.0.5:80 tcp
Note that we use 'out' here since we're applying the rule to the interface that's on the same network as the destination. The source and destination does not have to include a port.
New iptables chains can also be created, providing a method for grouping rules together instead of adding rules at the global level. Chains are then applied to one or more interfaces using the interface index. For example, one could put the previous rule into a chain named "allow-http" and apply it to the interface at index 0 via the following:
router foo fw chain allow-http default action drop
router foo fw chain allow-http action accept 192.168.0.5:80 tcp
router foo fw chain allow-http apply out 0
router_gw(vm, gw)
¶
Variants:
router
Configure running minirouter VMs running minirouter and miniccc.
Routers are configured by specifying or updating a configuration, and then applying that configuration with a commit command. For example, to configure a router on a running VM named 'foo' to serve DHCP on 10.0.0.0/24 with a range of IPs:
router foo dhcp 10.0.0.0 range 10.0.0.100 10.0.0.200
router foo commit
router takes a number of subcommands:
-
'log': Change the log level of the minirouter tool on the VM.
-
'interface': Set IPv4 or IPv6 addresses, or configure an interface to assign using DHCP. The interface field is an integer index of the interface defined with 'vm config net'. You could also specify if that interface will be a loopback interface For example, to configure the second interface of the router with a static IP and a loopback with a different IP:
vm config net 100 200 # ... router foo interface 1 10.0.0.1/24 router foo interface 2 11.0.0.1/32 lo -
'dhcp': Configure one or more DHCP servers on the router. The API allows you to set several options including static IP assignments and the default route and DNS server. For example, to serve a range of IPs, with 2 static IPs explicitly called out on router with IP 10.0.0.1:
router vm foo dhcp 10.0.0.0 range 10.0.0.2 10.0.0.254 router vm foo dhcp 10.0.0.0 static 00:11:22:33:44:55 10.0.0.10 router vm foo dhcp 10.0.0.0 static 00:11:22:33:44:56 10.0.0.11 -
'dns': Set DNS records for IPv4 or IPv6 hosts.
-
'upstream': Set upstream server for DNS.
-
'gw': Set default gateway which will be used if there is no matching route.
-
'ra': Enable neighbor discovery protocol router advertisements for a given subnet.
-
'route': Set static, OSPF, or BGP routes. Static routes include a subnet, next-hop, and optionally a name for this router. For example to specify a static route(s):
router foo route static 0.0.0.0/0 10.0.0.1 default-route
OSPF routes include an area and a network index corresponding to the interface described in 'vm config net'. You can also specify what networks to advertise using the export command.
For example, to enable OSPF on area 0 for both interfaces of a router:
vm config net 100 200
# ...
router foo route ospf 0 0
router foo route ospf 0 1
For example, to advertise specific networks, advertise a static route or use a static route as a filter:
router foo route static 11.0.0.0/24 0 bar-route
router foo route static 12.0.0.0/24 0 bar-route
router foo route ospf 0 export 10.0.0.0/24
router foo route ospf 0 export default-route
router foo route ospf 0 export bar-route
To configure BGP must specify the process name for the specific bgp context, local ip address and AS, Neighbor ip address and AS, and what networks need to be advertised
For example, local router is in AS 100 with an ip 10.0.0.1 and bgp peer is in AS 200 with an ip of 20.0.0.1 and you want to advertise network 10.0.0.0/24:
router foo route static 10.0.0.0/24 0 foo_out
router foo bgp bar local 10.0.0.1 100
router foo bgp bar neighbor 20.0.0.1 200
router foo bgp bar export filter foo_out
You can set up route reflection for BGP by using the rrclient command for that process. By using the command it indicates that the peer is a bgp client:
router foo bgp bar rrclient
-
'rid': Sets the 32 bit router ID for the router. Typically this ID is unique across the organization's network and is used for various routing protocols ie OSPF
router foo rid 1.1.1.1 -
'fw': specify flows to accept/drop/reject via iptables. For example, to globally globally drop all forwarded packets and accept HTTP traffic from any IP address to host 192.168.0.5 on the interface at index 0 (which is on the 192.168.0.0/24 network):
router foo fw default drop router foo fw accept out 0 192.168.0.5:80 tcp
Note that we use 'out' here since we're applying the rule to the interface that's on the same network as the destination. The source and destination does not have to include a port.
New iptables chains can also be created, providing a method for grouping rules together instead of adding rules at the global level. Chains are then applied to one or more interfaces using the interface index. For example, one could put the previous rule into a chain named "allow-http" and apply it to the interface at index 0 via the following:
router foo fw chain allow-http default action drop
router foo fw chain allow-http action accept 192.168.0.5:80 tcp
router foo fw chain allow-http apply out 0
router_interface(vm, network, IPv4_MASK, lo=None)
¶
Variants:
router
Configure running minirouter VMs running minirouter and miniccc.
Routers are configured by specifying or updating a configuration, and then applying that configuration with a commit command. For example, to configure a router on a running VM named 'foo' to serve DHCP on 10.0.0.0/24 with a range of IPs:
router foo dhcp 10.0.0.0 range 10.0.0.100 10.0.0.200
router foo commit
router takes a number of subcommands:
-
'log': Change the log level of the minirouter tool on the VM.
-
'interface': Set IPv4 or IPv6 addresses, or configure an interface to assign using DHCP. The interface field is an integer index of the interface defined with 'vm config net'. You could also specify if that interface will be a loopback interface For example, to configure the second interface of the router with a static IP and a loopback with a different IP:
vm config net 100 200 # ... router foo interface 1 10.0.0.1/24 router foo interface 2 11.0.0.1/32 lo -
'dhcp': Configure one or more DHCP servers on the router. The API allows you to set several options including static IP assignments and the default route and DNS server. For example, to serve a range of IPs, with 2 static IPs explicitly called out on router with IP 10.0.0.1:
router vm foo dhcp 10.0.0.0 range 10.0.0.2 10.0.0.254 router vm foo dhcp 10.0.0.0 static 00:11:22:33:44:55 10.0.0.10 router vm foo dhcp 10.0.0.0 static 00:11:22:33:44:56 10.0.0.11 -
'dns': Set DNS records for IPv4 or IPv6 hosts.
-
'upstream': Set upstream server for DNS.
-
'gw': Set default gateway which will be used if there is no matching route.
-
'ra': Enable neighbor discovery protocol router advertisements for a given subnet.
-
'route': Set static, OSPF, or BGP routes. Static routes include a subnet, next-hop, and optionally a name for this router. For example to specify a static route(s):
router foo route static 0.0.0.0/0 10.0.0.1 default-route
OSPF routes include an area and a network index corresponding to the interface described in 'vm config net'. You can also specify what networks to advertise using the export command.
For example, to enable OSPF on area 0 for both interfaces of a router:
vm config net 100 200
# ...
router foo route ospf 0 0
router foo route ospf 0 1
For example, to advertise specific networks, advertise a static route or use a static route as a filter:
router foo route static 11.0.0.0/24 0 bar-route
router foo route static 12.0.0.0/24 0 bar-route
router foo route ospf 0 export 10.0.0.0/24
router foo route ospf 0 export default-route
router foo route ospf 0 export bar-route
To configure BGP must specify the process name for the specific bgp context, local ip address and AS, Neighbor ip address and AS, and what networks need to be advertised
For example, local router is in AS 100 with an ip 10.0.0.1 and bgp peer is in AS 200 with an ip of 20.0.0.1 and you want to advertise network 10.0.0.0/24:
router foo route static 10.0.0.0/24 0 foo_out
router foo bgp bar local 10.0.0.1 100
router foo bgp bar neighbor 20.0.0.1 200
router foo bgp bar export filter foo_out
You can set up route reflection for BGP by using the rrclient command for that process. By using the command it indicates that the peer is a bgp client:
router foo bgp bar rrclient
-
'rid': Sets the 32 bit router ID for the router. Typically this ID is unique across the organization's network and is used for various routing protocols ie OSPF
router foo rid 1.1.1.1 -
'fw': specify flows to accept/drop/reject via iptables. For example, to globally globally drop all forwarded packets and accept HTTP traffic from any IP address to host 192.168.0.5 on the interface at index 0 (which is on the 192.168.0.0/24 network):
router foo fw default drop router foo fw accept out 0 192.168.0.5:80 tcp
Note that we use 'out' here since we're applying the rule to the interface that's on the same network as the destination. The source and destination does not have to include a port.
New iptables chains can also be created, providing a method for grouping rules together instead of adding rules at the global level. Chains are then applied to one or more interfaces using the interface index. For example, one could put the previous rule into a chain named "allow-http" and apply it to the interface at index 0 via the following:
router foo fw chain allow-http default action drop
router foo fw chain allow-http action accept 192.168.0.5:80 tcp
router foo fw chain allow-http apply out 0
router_log_level(vm, fatal_or_error_or_warn_or_info_or_debug)
¶
Variants:
router
Configure running minirouter VMs running minirouter and miniccc.
Routers are configured by specifying or updating a configuration, and then applying that configuration with a commit command. For example, to configure a router on a running VM named 'foo' to serve DHCP on 10.0.0.0/24 with a range of IPs:
router foo dhcp 10.0.0.0 range 10.0.0.100 10.0.0.200
router foo commit
router takes a number of subcommands:
-
'log': Change the log level of the minirouter tool on the VM.
-
'interface': Set IPv4 or IPv6 addresses, or configure an interface to assign using DHCP. The interface field is an integer index of the interface defined with 'vm config net'. You could also specify if that interface will be a loopback interface For example, to configure the second interface of the router with a static IP and a loopback with a different IP:
vm config net 100 200 # ... router foo interface 1 10.0.0.1/24 router foo interface 2 11.0.0.1/32 lo -
'dhcp': Configure one or more DHCP servers on the router. The API allows you to set several options including static IP assignments and the default route and DNS server. For example, to serve a range of IPs, with 2 static IPs explicitly called out on router with IP 10.0.0.1:
router vm foo dhcp 10.0.0.0 range 10.0.0.2 10.0.0.254 router vm foo dhcp 10.0.0.0 static 00:11:22:33:44:55 10.0.0.10 router vm foo dhcp 10.0.0.0 static 00:11:22:33:44:56 10.0.0.11 -
'dns': Set DNS records for IPv4 or IPv6 hosts.
-
'upstream': Set upstream server for DNS.
-
'gw': Set default gateway which will be used if there is no matching route.
-
'ra': Enable neighbor discovery protocol router advertisements for a given subnet.
-
'route': Set static, OSPF, or BGP routes. Static routes include a subnet, next-hop, and optionally a name for this router. For example to specify a static route(s):
router foo route static 0.0.0.0/0 10.0.0.1 default-route
OSPF routes include an area and a network index corresponding to the interface described in 'vm config net'. You can also specify what networks to advertise using the export command.
For example, to enable OSPF on area 0 for both interfaces of a router:
vm config net 100 200
# ...
router foo route ospf 0 0
router foo route ospf 0 1
For example, to advertise specific networks, advertise a static route or use a static route as a filter:
router foo route static 11.0.0.0/24 0 bar-route
router foo route static 12.0.0.0/24 0 bar-route
router foo route ospf 0 export 10.0.0.0/24
router foo route ospf 0 export default-route
router foo route ospf 0 export bar-route
To configure BGP must specify the process name for the specific bgp context, local ip address and AS, Neighbor ip address and AS, and what networks need to be advertised
For example, local router is in AS 100 with an ip 10.0.0.1 and bgp peer is in AS 200 with an ip of 20.0.0.1 and you want to advertise network 10.0.0.0/24:
router foo route static 10.0.0.0/24 0 foo_out
router foo bgp bar local 10.0.0.1 100
router foo bgp bar neighbor 20.0.0.1 200
router foo bgp bar export filter foo_out
You can set up route reflection for BGP by using the rrclient command for that process. By using the command it indicates that the peer is a bgp client:
router foo bgp bar rrclient
-
'rid': Sets the 32 bit router ID for the router. Typically this ID is unique across the organization's network and is used for various routing protocols ie OSPF
router foo rid 1.1.1.1 -
'fw': specify flows to accept/drop/reject via iptables. For example, to globally globally drop all forwarded packets and accept HTTP traffic from any IP address to host 192.168.0.5 on the interface at index 0 (which is on the 192.168.0.0/24 network):
router foo fw default drop router foo fw accept out 0 192.168.0.5:80 tcp
Note that we use 'out' here since we're applying the rule to the interface that's on the same network as the destination. The source and destination does not have to include a port.
New iptables chains can also be created, providing a method for grouping rules together instead of adding rules at the global level. Chains are then applied to one or more interfaces using the interface index. For example, one could put the previous rule into a chain named "allow-http" and apply it to the interface at index 0 via the following:
router foo fw chain allow-http default action drop
router foo fw chain allow-http action accept 192.168.0.5:80 tcp
router foo fw chain allow-http apply out 0
router_ra(vm, subnet)
¶
Variants:
router
Configure running minirouter VMs running minirouter and miniccc.
Routers are configured by specifying or updating a configuration, and then applying that configuration with a commit command. For example, to configure a router on a running VM named 'foo' to serve DHCP on 10.0.0.0/24 with a range of IPs:
router foo dhcp 10.0.0.0 range 10.0.0.100 10.0.0.200
router foo commit
router takes a number of subcommands:
-
'log': Change the log level of the minirouter tool on the VM.
-
'interface': Set IPv4 or IPv6 addresses, or configure an interface to assign using DHCP. The interface field is an integer index of the interface defined with 'vm config net'. You could also specify if that interface will be a loopback interface For example, to configure the second interface of the router with a static IP and a loopback with a different IP:
vm config net 100 200 # ... router foo interface 1 10.0.0.1/24 router foo interface 2 11.0.0.1/32 lo -
'dhcp': Configure one or more DHCP servers on the router. The API allows you to set several options including static IP assignments and the default route and DNS server. For example, to serve a range of IPs, with 2 static IPs explicitly called out on router with IP 10.0.0.1:
router vm foo dhcp 10.0.0.0 range 10.0.0.2 10.0.0.254 router vm foo dhcp 10.0.0.0 static 00:11:22:33:44:55 10.0.0.10 router vm foo dhcp 10.0.0.0 static 00:11:22:33:44:56 10.0.0.11 -
'dns': Set DNS records for IPv4 or IPv6 hosts.
-
'upstream': Set upstream server for DNS.
-
'gw': Set default gateway which will be used if there is no matching route.
-
'ra': Enable neighbor discovery protocol router advertisements for a given subnet.
-
'route': Set static, OSPF, or BGP routes. Static routes include a subnet, next-hop, and optionally a name for this router. For example to specify a static route(s):
router foo route static 0.0.0.0/0 10.0.0.1 default-route
OSPF routes include an area and a network index corresponding to the interface described in 'vm config net'. You can also specify what networks to advertise using the export command.
For example, to enable OSPF on area 0 for both interfaces of a router:
vm config net 100 200
# ...
router foo route ospf 0 0
router foo route ospf 0 1
For example, to advertise specific networks, advertise a static route or use a static route as a filter:
router foo route static 11.0.0.0/24 0 bar-route
router foo route static 12.0.0.0/24 0 bar-route
router foo route ospf 0 export 10.0.0.0/24
router foo route ospf 0 export default-route
router foo route ospf 0 export bar-route
To configure BGP must specify the process name for the specific bgp context, local ip address and AS, Neighbor ip address and AS, and what networks need to be advertised
For example, local router is in AS 100 with an ip 10.0.0.1 and bgp peer is in AS 200 with an ip of 20.0.0.1 and you want to advertise network 10.0.0.0/24:
router foo route static 10.0.0.0/24 0 foo_out
router foo bgp bar local 10.0.0.1 100
router foo bgp bar neighbor 20.0.0.1 200
router foo bgp bar export filter foo_out
You can set up route reflection for BGP by using the rrclient command for that process. By using the command it indicates that the peer is a bgp client:
router foo bgp bar rrclient
-
'rid': Sets the 32 bit router ID for the router. Typically this ID is unique across the organization's network and is used for various routing protocols ie OSPF
router foo rid 1.1.1.1 -
'fw': specify flows to accept/drop/reject via iptables. For example, to globally globally drop all forwarded packets and accept HTTP traffic from any IP address to host 192.168.0.5 on the interface at index 0 (which is on the 192.168.0.0/24 network):
router foo fw default drop router foo fw accept out 0 192.168.0.5:80 tcp
Note that we use 'out' here since we're applying the rule to the interface that's on the same network as the destination. The source and destination does not have to include a port.
New iptables chains can also be created, providing a method for grouping rules together instead of adding rules at the global level. Chains are then applied to one or more interfaces using the interface index. For example, one could put the previous rule into a chain named "allow-http" and apply it to the interface at index 0 via the following:
router foo fw chain allow-http default action drop
router foo fw chain allow-http action accept 192.168.0.5:80 tcp
router foo fw chain allow-http apply out 0
router_rid(vm, id)
¶
Variants:
router
Configure running minirouter VMs running minirouter and miniccc.
Routers are configured by specifying or updating a configuration, and then applying that configuration with a commit command. For example, to configure a router on a running VM named 'foo' to serve DHCP on 10.0.0.0/24 with a range of IPs:
router foo dhcp 10.0.0.0 range 10.0.0.100 10.0.0.200
router foo commit
router takes a number of subcommands:
-
'log': Change the log level of the minirouter tool on the VM.
-
'interface': Set IPv4 or IPv6 addresses, or configure an interface to assign using DHCP. The interface field is an integer index of the interface defined with 'vm config net'. You could also specify if that interface will be a loopback interface For example, to configure the second interface of the router with a static IP and a loopback with a different IP:
vm config net 100 200 # ... router foo interface 1 10.0.0.1/24 router foo interface 2 11.0.0.1/32 lo -
'dhcp': Configure one or more DHCP servers on the router. The API allows you to set several options including static IP assignments and the default route and DNS server. For example, to serve a range of IPs, with 2 static IPs explicitly called out on router with IP 10.0.0.1:
router vm foo dhcp 10.0.0.0 range 10.0.0.2 10.0.0.254 router vm foo dhcp 10.0.0.0 static 00:11:22:33:44:55 10.0.0.10 router vm foo dhcp 10.0.0.0 static 00:11:22:33:44:56 10.0.0.11 -
'dns': Set DNS records for IPv4 or IPv6 hosts.
-
'upstream': Set upstream server for DNS.
-
'gw': Set default gateway which will be used if there is no matching route.
-
'ra': Enable neighbor discovery protocol router advertisements for a given subnet.
-
'route': Set static, OSPF, or BGP routes. Static routes include a subnet, next-hop, and optionally a name for this router. For example to specify a static route(s):
router foo route static 0.0.0.0/0 10.0.0.1 default-route
OSPF routes include an area and a network index corresponding to the interface described in 'vm config net'. You can also specify what networks to advertise using the export command.
For example, to enable OSPF on area 0 for both interfaces of a router:
vm config net 100 200
# ...
router foo route ospf 0 0
router foo route ospf 0 1
For example, to advertise specific networks, advertise a static route or use a static route as a filter:
router foo route static 11.0.0.0/24 0 bar-route
router foo route static 12.0.0.0/24 0 bar-route
router foo route ospf 0 export 10.0.0.0/24
router foo route ospf 0 export default-route
router foo route ospf 0 export bar-route
To configure BGP must specify the process name for the specific bgp context, local ip address and AS, Neighbor ip address and AS, and what networks need to be advertised
For example, local router is in AS 100 with an ip 10.0.0.1 and bgp peer is in AS 200 with an ip of 20.0.0.1 and you want to advertise network 10.0.0.0/24:
router foo route static 10.0.0.0/24 0 foo_out
router foo bgp bar local 10.0.0.1 100
router foo bgp bar neighbor 20.0.0.1 200
router foo bgp bar export filter foo_out
You can set up route reflection for BGP by using the rrclient command for that process. By using the command it indicates that the peer is a bgp client:
router foo bgp bar rrclient
-
'rid': Sets the 32 bit router ID for the router. Typically this ID is unique across the organization's network and is used for various routing protocols ie OSPF
router foo rid 1.1.1.1 -
'fw': specify flows to accept/drop/reject via iptables. For example, to globally globally drop all forwarded packets and accept HTTP traffic from any IP address to host 192.168.0.5 on the interface at index 0 (which is on the 192.168.0.0/24 network):
router foo fw default drop router foo fw accept out 0 192.168.0.5:80 tcp
Note that we use 'out' here since we're applying the rule to the interface that's on the same network as the destination. The source and destination does not have to include a port.
New iptables chains can also be created, providing a method for grouping rules together instead of adding rules at the global level. Chains are then applied to one or more interfaces using the interface index. For example, one could put the previous rule into a chain named "allow-http" and apply it to the interface at index 0 via the following:
router foo fw chain allow-http default action drop
router foo fw chain allow-http action accept 192.168.0.5:80 tcp
router foo fw chain allow-http apply out 0
router_route_bgp(vm, processname, local_or_neighbor, IPv4, asnumber)
¶
Variants:
router
Configure running minirouter VMs running minirouter and miniccc.
Routers are configured by specifying or updating a configuration, and then applying that configuration with a commit command. For example, to configure a router on a running VM named 'foo' to serve DHCP on 10.0.0.0/24 with a range of IPs:
router foo dhcp 10.0.0.0 range 10.0.0.100 10.0.0.200
router foo commit
router takes a number of subcommands:
-
'log': Change the log level of the minirouter tool on the VM.
-
'interface': Set IPv4 or IPv6 addresses, or configure an interface to assign using DHCP. The interface field is an integer index of the interface defined with 'vm config net'. You could also specify if that interface will be a loopback interface For example, to configure the second interface of the router with a static IP and a loopback with a different IP:
vm config net 100 200 # ... router foo interface 1 10.0.0.1/24 router foo interface 2 11.0.0.1/32 lo -
'dhcp': Configure one or more DHCP servers on the router. The API allows you to set several options including static IP assignments and the default route and DNS server. For example, to serve a range of IPs, with 2 static IPs explicitly called out on router with IP 10.0.0.1:
router vm foo dhcp 10.0.0.0 range 10.0.0.2 10.0.0.254 router vm foo dhcp 10.0.0.0 static 00:11:22:33:44:55 10.0.0.10 router vm foo dhcp 10.0.0.0 static 00:11:22:33:44:56 10.0.0.11 -
'dns': Set DNS records for IPv4 or IPv6 hosts.
-
'upstream': Set upstream server for DNS.
-
'gw': Set default gateway which will be used if there is no matching route.
-
'ra': Enable neighbor discovery protocol router advertisements for a given subnet.
-
'route': Set static, OSPF, or BGP routes. Static routes include a subnet, next-hop, and optionally a name for this router. For example to specify a static route(s):
router foo route static 0.0.0.0/0 10.0.0.1 default-route
OSPF routes include an area and a network index corresponding to the interface described in 'vm config net'. You can also specify what networks to advertise using the export command.
For example, to enable OSPF on area 0 for both interfaces of a router:
vm config net 100 200
# ...
router foo route ospf 0 0
router foo route ospf 0 1
For example, to advertise specific networks, advertise a static route or use a static route as a filter:
router foo route static 11.0.0.0/24 0 bar-route
router foo route static 12.0.0.0/24 0 bar-route
router foo route ospf 0 export 10.0.0.0/24
router foo route ospf 0 export default-route
router foo route ospf 0 export bar-route
To configure BGP must specify the process name for the specific bgp context, local ip address and AS, Neighbor ip address and AS, and what networks need to be advertised
For example, local router is in AS 100 with an ip 10.0.0.1 and bgp peer is in AS 200 with an ip of 20.0.0.1 and you want to advertise network 10.0.0.0/24:
router foo route static 10.0.0.0/24 0 foo_out
router foo bgp bar local 10.0.0.1 100
router foo bgp bar neighbor 20.0.0.1 200
router foo bgp bar export filter foo_out
You can set up route reflection for BGP by using the rrclient command for that process. By using the command it indicates that the peer is a bgp client:
router foo bgp bar rrclient
-
'rid': Sets the 32 bit router ID for the router. Typically this ID is unique across the organization's network and is used for various routing protocols ie OSPF
router foo rid 1.1.1.1 -
'fw': specify flows to accept/drop/reject via iptables. For example, to globally globally drop all forwarded packets and accept HTTP traffic from any IP address to host 192.168.0.5 on the interface at index 0 (which is on the 192.168.0.0/24 network):
router foo fw default drop router foo fw accept out 0 192.168.0.5:80 tcp
Note that we use 'out' here since we're applying the rule to the interface that's on the same network as the destination. The source and destination does not have to include a port.
New iptables chains can also be created, providing a method for grouping rules together instead of adding rules at the global level. Chains are then applied to one or more interfaces using the interface index. For example, one could put the previous rule into a chain named "allow-http" and apply it to the interface at index 0 via the following:
router foo fw chain allow-http default action drop
router foo fw chain allow-http action accept 192.168.0.5:80 tcp
router foo fw chain allow-http apply out 0
router_route_bgp_export(vm, processname, all_or_filter, filtername)
¶
Variants:
router
Configure running minirouter VMs running minirouter and miniccc.
Routers are configured by specifying or updating a configuration, and then applying that configuration with a commit command. For example, to configure a router on a running VM named 'foo' to serve DHCP on 10.0.0.0/24 with a range of IPs:
router foo dhcp 10.0.0.0 range 10.0.0.100 10.0.0.200
router foo commit
router takes a number of subcommands:
-
'log': Change the log level of the minirouter tool on the VM.
-
'interface': Set IPv4 or IPv6 addresses, or configure an interface to assign using DHCP. The interface field is an integer index of the interface defined with 'vm config net'. You could also specify if that interface will be a loopback interface For example, to configure the second interface of the router with a static IP and a loopback with a different IP:
vm config net 100 200 # ... router foo interface 1 10.0.0.1/24 router foo interface 2 11.0.0.1/32 lo -
'dhcp': Configure one or more DHCP servers on the router. The API allows you to set several options including static IP assignments and the default route and DNS server. For example, to serve a range of IPs, with 2 static IPs explicitly called out on router with IP 10.0.0.1:
router vm foo dhcp 10.0.0.0 range 10.0.0.2 10.0.0.254 router vm foo dhcp 10.0.0.0 static 00:11:22:33:44:55 10.0.0.10 router vm foo dhcp 10.0.0.0 static 00:11:22:33:44:56 10.0.0.11 -
'dns': Set DNS records for IPv4 or IPv6 hosts.
-
'upstream': Set upstream server for DNS.
-
'gw': Set default gateway which will be used if there is no matching route.
-
'ra': Enable neighbor discovery protocol router advertisements for a given subnet.
-
'route': Set static, OSPF, or BGP routes. Static routes include a subnet, next-hop, and optionally a name for this router. For example to specify a static route(s):
router foo route static 0.0.0.0/0 10.0.0.1 default-route
OSPF routes include an area and a network index corresponding to the interface described in 'vm config net'. You can also specify what networks to advertise using the export command.
For example, to enable OSPF on area 0 for both interfaces of a router:
vm config net 100 200
# ...
router foo route ospf 0 0
router foo route ospf 0 1
For example, to advertise specific networks, advertise a static route or use a static route as a filter:
router foo route static 11.0.0.0/24 0 bar-route
router foo route static 12.0.0.0/24 0 bar-route
router foo route ospf 0 export 10.0.0.0/24
router foo route ospf 0 export default-route
router foo route ospf 0 export bar-route
To configure BGP must specify the process name for the specific bgp context, local ip address and AS, Neighbor ip address and AS, and what networks need to be advertised
For example, local router is in AS 100 with an ip 10.0.0.1 and bgp peer is in AS 200 with an ip of 20.0.0.1 and you want to advertise network 10.0.0.0/24:
router foo route static 10.0.0.0/24 0 foo_out
router foo bgp bar local 10.0.0.1 100
router foo bgp bar neighbor 20.0.0.1 200
router foo bgp bar export filter foo_out
You can set up route reflection for BGP by using the rrclient command for that process. By using the command it indicates that the peer is a bgp client:
router foo bgp bar rrclient
-
'rid': Sets the 32 bit router ID for the router. Typically this ID is unique across the organization's network and is used for various routing protocols ie OSPF
router foo rid 1.1.1.1 -
'fw': specify flows to accept/drop/reject via iptables. For example, to globally globally drop all forwarded packets and accept HTTP traffic from any IP address to host 192.168.0.5 on the interface at index 0 (which is on the 192.168.0.0/24 network):
router foo fw default drop router foo fw accept out 0 192.168.0.5:80 tcp
Note that we use 'out' here since we're applying the rule to the interface that's on the same network as the destination. The source and destination does not have to include a port.
New iptables chains can also be created, providing a method for grouping rules together instead of adding rules at the global level. Chains are then applied to one or more interfaces using the interface index. For example, one could put the previous rule into a chain named "allow-http" and apply it to the interface at index 0 via the following:
router foo fw chain allow-http default action drop
router foo fw chain allow-http action accept 192.168.0.5:80 tcp
router foo fw chain allow-http apply out 0
router_route_bgp_rrclient(vm, processname)
¶
Variants:
router
Configure running minirouter VMs running minirouter and miniccc.
Routers are configured by specifying or updating a configuration, and then applying that configuration with a commit command. For example, to configure a router on a running VM named 'foo' to serve DHCP on 10.0.0.0/24 with a range of IPs:
router foo dhcp 10.0.0.0 range 10.0.0.100 10.0.0.200
router foo commit
router takes a number of subcommands:
-
'log': Change the log level of the minirouter tool on the VM.
-
'interface': Set IPv4 or IPv6 addresses, or configure an interface to assign using DHCP. The interface field is an integer index of the interface defined with 'vm config net'. You could also specify if that interface will be a loopback interface For example, to configure the second interface of the router with a static IP and a loopback with a different IP:
vm config net 100 200 # ... router foo interface 1 10.0.0.1/24 router foo interface 2 11.0.0.1/32 lo -
'dhcp': Configure one or more DHCP servers on the router. The API allows you to set several options including static IP assignments and the default route and DNS server. For example, to serve a range of IPs, with 2 static IPs explicitly called out on router with IP 10.0.0.1:
router vm foo dhcp 10.0.0.0 range 10.0.0.2 10.0.0.254 router vm foo dhcp 10.0.0.0 static 00:11:22:33:44:55 10.0.0.10 router vm foo dhcp 10.0.0.0 static 00:11:22:33:44:56 10.0.0.11 -
'dns': Set DNS records for IPv4 or IPv6 hosts.
-
'upstream': Set upstream server for DNS.
-
'gw': Set default gateway which will be used if there is no matching route.
-
'ra': Enable neighbor discovery protocol router advertisements for a given subnet.
-
'route': Set static, OSPF, or BGP routes. Static routes include a subnet, next-hop, and optionally a name for this router. For example to specify a static route(s):
router foo route static 0.0.0.0/0 10.0.0.1 default-route
OSPF routes include an area and a network index corresponding to the interface described in 'vm config net'. You can also specify what networks to advertise using the export command.
For example, to enable OSPF on area 0 for both interfaces of a router:
vm config net 100 200
# ...
router foo route ospf 0 0
router foo route ospf 0 1
For example, to advertise specific networks, advertise a static route or use a static route as a filter:
router foo route static 11.0.0.0/24 0 bar-route
router foo route static 12.0.0.0/24 0 bar-route
router foo route ospf 0 export 10.0.0.0/24
router foo route ospf 0 export default-route
router foo route ospf 0 export bar-route
To configure BGP must specify the process name for the specific bgp context, local ip address and AS, Neighbor ip address and AS, and what networks need to be advertised
For example, local router is in AS 100 with an ip 10.0.0.1 and bgp peer is in AS 200 with an ip of 20.0.0.1 and you want to advertise network 10.0.0.0/24:
router foo route static 10.0.0.0/24 0 foo_out
router foo bgp bar local 10.0.0.1 100
router foo bgp bar neighbor 20.0.0.1 200
router foo bgp bar export filter foo_out
You can set up route reflection for BGP by using the rrclient command for that process. By using the command it indicates that the peer is a bgp client:
router foo bgp bar rrclient
-
'rid': Sets the 32 bit router ID for the router. Typically this ID is unique across the organization's network and is used for various routing protocols ie OSPF
router foo rid 1.1.1.1 -
'fw': specify flows to accept/drop/reject via iptables. For example, to globally globally drop all forwarded packets and accept HTTP traffic from any IP address to host 192.168.0.5 on the interface at index 0 (which is on the 192.168.0.0/24 network):
router foo fw default drop router foo fw accept out 0 192.168.0.5:80 tcp
Note that we use 'out' here since we're applying the rule to the interface that's on the same network as the destination. The source and destination does not have to include a port.
New iptables chains can also be created, providing a method for grouping rules together instead of adding rules at the global level. Chains are then applied to one or more interfaces using the interface index. For example, one could put the previous rule into a chain named "allow-http" and apply it to the interface at index 0 via the following:
router foo fw chain allow-http default action drop
router foo fw chain allow-http action accept 192.168.0.5:80 tcp
router foo fw chain allow-http apply out 0
router_route_ospf(vm, area, network, option=None, value=None)
¶
Variants:
router
Configure running minirouter VMs running minirouter and miniccc.
Routers are configured by specifying or updating a configuration, and then applying that configuration with a commit command. For example, to configure a router on a running VM named 'foo' to serve DHCP on 10.0.0.0/24 with a range of IPs:
router foo dhcp 10.0.0.0 range 10.0.0.100 10.0.0.200
router foo commit
router takes a number of subcommands:
-
'log': Change the log level of the minirouter tool on the VM.
-
'interface': Set IPv4 or IPv6 addresses, or configure an interface to assign using DHCP. The interface field is an integer index of the interface defined with 'vm config net'. You could also specify if that interface will be a loopback interface For example, to configure the second interface of the router with a static IP and a loopback with a different IP:
vm config net 100 200 # ... router foo interface 1 10.0.0.1/24 router foo interface 2 11.0.0.1/32 lo -
'dhcp': Configure one or more DHCP servers on the router. The API allows you to set several options including static IP assignments and the default route and DNS server. For example, to serve a range of IPs, with 2 static IPs explicitly called out on router with IP 10.0.0.1:
router vm foo dhcp 10.0.0.0 range 10.0.0.2 10.0.0.254 router vm foo dhcp 10.0.0.0 static 00:11:22:33:44:55 10.0.0.10 router vm foo dhcp 10.0.0.0 static 00:11:22:33:44:56 10.0.0.11 -
'dns': Set DNS records for IPv4 or IPv6 hosts.
-
'upstream': Set upstream server for DNS.
-
'gw': Set default gateway which will be used if there is no matching route.
-
'ra': Enable neighbor discovery protocol router advertisements for a given subnet.
-
'route': Set static, OSPF, or BGP routes. Static routes include a subnet, next-hop, and optionally a name for this router. For example to specify a static route(s):
router foo route static 0.0.0.0/0 10.0.0.1 default-route
OSPF routes include an area and a network index corresponding to the interface described in 'vm config net'. You can also specify what networks to advertise using the export command.
For example, to enable OSPF on area 0 for both interfaces of a router:
vm config net 100 200
# ...
router foo route ospf 0 0
router foo route ospf 0 1
For example, to advertise specific networks, advertise a static route or use a static route as a filter:
router foo route static 11.0.0.0/24 0 bar-route
router foo route static 12.0.0.0/24 0 bar-route
router foo route ospf 0 export 10.0.0.0/24
router foo route ospf 0 export default-route
router foo route ospf 0 export bar-route
To configure BGP must specify the process name for the specific bgp context, local ip address and AS, Neighbor ip address and AS, and what networks need to be advertised
For example, local router is in AS 100 with an ip 10.0.0.1 and bgp peer is in AS 200 with an ip of 20.0.0.1 and you want to advertise network 10.0.0.0/24:
router foo route static 10.0.0.0/24 0 foo_out
router foo bgp bar local 10.0.0.1 100
router foo bgp bar neighbor 20.0.0.1 200
router foo bgp bar export filter foo_out
You can set up route reflection for BGP by using the rrclient command for that process. By using the command it indicates that the peer is a bgp client:
router foo bgp bar rrclient
-
'rid': Sets the 32 bit router ID for the router. Typically this ID is unique across the organization's network and is used for various routing protocols ie OSPF
router foo rid 1.1.1.1 -
'fw': specify flows to accept/drop/reject via iptables. For example, to globally globally drop all forwarded packets and accept HTTP traffic from any IP address to host 192.168.0.5 on the interface at index 0 (which is on the 192.168.0.0/24 network):
router foo fw default drop router foo fw accept out 0 192.168.0.5:80 tcp
Note that we use 'out' here since we're applying the rule to the interface that's on the same network as the destination. The source and destination does not have to include a port.
New iptables chains can also be created, providing a method for grouping rules together instead of adding rules at the global level. Chains are then applied to one or more interfaces using the interface index. For example, one could put the previous rule into a chain named "allow-http" and apply it to the interface at index 0 via the following:
router foo fw chain allow-http default action drop
router foo fw chain allow-http action accept 192.168.0.5:80 tcp
router foo fw chain allow-http apply out 0
router_route_ospf_export(vm, area, Ipv4_Mask)
¶
Variants:
router
Configure running minirouter VMs running minirouter and miniccc.
Routers are configured by specifying or updating a configuration, and then applying that configuration with a commit command. For example, to configure a router on a running VM named 'foo' to serve DHCP on 10.0.0.0/24 with a range of IPs:
router foo dhcp 10.0.0.0 range 10.0.0.100 10.0.0.200
router foo commit
router takes a number of subcommands:
-
'log': Change the log level of the minirouter tool on the VM.
-
'interface': Set IPv4 or IPv6 addresses, or configure an interface to assign using DHCP. The interface field is an integer index of the interface defined with 'vm config net'. You could also specify if that interface will be a loopback interface For example, to configure the second interface of the router with a static IP and a loopback with a different IP:
vm config net 100 200 # ... router foo interface 1 10.0.0.1/24 router foo interface 2 11.0.0.1/32 lo -
'dhcp': Configure one or more DHCP servers on the router. The API allows you to set several options including static IP assignments and the default route and DNS server. For example, to serve a range of IPs, with 2 static IPs explicitly called out on router with IP 10.0.0.1:
router vm foo dhcp 10.0.0.0 range 10.0.0.2 10.0.0.254 router vm foo dhcp 10.0.0.0 static 00:11:22:33:44:55 10.0.0.10 router vm foo dhcp 10.0.0.0 static 00:11:22:33:44:56 10.0.0.11 -
'dns': Set DNS records for IPv4 or IPv6 hosts.
-
'upstream': Set upstream server for DNS.
-
'gw': Set default gateway which will be used if there is no matching route.
-
'ra': Enable neighbor discovery protocol router advertisements for a given subnet.
-
'route': Set static, OSPF, or BGP routes. Static routes include a subnet, next-hop, and optionally a name for this router. For example to specify a static route(s):
router foo route static 0.0.0.0/0 10.0.0.1 default-route
OSPF routes include an area and a network index corresponding to the interface described in 'vm config net'. You can also specify what networks to advertise using the export command.
For example, to enable OSPF on area 0 for both interfaces of a router:
vm config net 100 200
# ...
router foo route ospf 0 0
router foo route ospf 0 1
For example, to advertise specific networks, advertise a static route or use a static route as a filter:
router foo route static 11.0.0.0/24 0 bar-route
router foo route static 12.0.0.0/24 0 bar-route
router foo route ospf 0 export 10.0.0.0/24
router foo route ospf 0 export default-route
router foo route ospf 0 export bar-route
To configure BGP must specify the process name for the specific bgp context, local ip address and AS, Neighbor ip address and AS, and what networks need to be advertised
For example, local router is in AS 100 with an ip 10.0.0.1 and bgp peer is in AS 200 with an ip of 20.0.0.1 and you want to advertise network 10.0.0.0/24:
router foo route static 10.0.0.0/24 0 foo_out
router foo bgp bar local 10.0.0.1 100
router foo bgp bar neighbor 20.0.0.1 200
router foo bgp bar export filter foo_out
You can set up route reflection for BGP by using the rrclient command for that process. By using the command it indicates that the peer is a bgp client:
router foo bgp bar rrclient
-
'rid': Sets the 32 bit router ID for the router. Typically this ID is unique across the organization's network and is used for various routing protocols ie OSPF
router foo rid 1.1.1.1 -
'fw': specify flows to accept/drop/reject via iptables. For example, to globally globally drop all forwarded packets and accept HTTP traffic from any IP address to host 192.168.0.5 on the interface at index 0 (which is on the 192.168.0.0/24 network):
router foo fw default drop router foo fw accept out 0 192.168.0.5:80 tcp
Note that we use 'out' here since we're applying the rule to the interface that's on the same network as the destination. The source and destination does not have to include a port.
New iptables chains can also be created, providing a method for grouping rules together instead of adding rules at the global level. Chains are then applied to one or more interfaces using the interface index. For example, one could put the previous rule into a chain named "allow-http" and apply it to the interface at index 0 via the following:
router foo fw chain allow-http default action drop
router foo fw chain allow-http action accept 192.168.0.5:80 tcp
router foo fw chain allow-http apply out 0
router_route_static(vm, network, next_hop, staticroutename=None)
¶
Variants:
router
Configure running minirouter VMs running minirouter and miniccc.
Routers are configured by specifying or updating a configuration, and then applying that configuration with a commit command. For example, to configure a router on a running VM named 'foo' to serve DHCP on 10.0.0.0/24 with a range of IPs:
router foo dhcp 10.0.0.0 range 10.0.0.100 10.0.0.200
router foo commit
router takes a number of subcommands:
-
'log': Change the log level of the minirouter tool on the VM.
-
'interface': Set IPv4 or IPv6 addresses, or configure an interface to assign using DHCP. The interface field is an integer index of the interface defined with 'vm config net'. You could also specify if that interface will be a loopback interface For example, to configure the second interface of the router with a static IP and a loopback with a different IP:
vm config net 100 200 # ... router foo interface 1 10.0.0.1/24 router foo interface 2 11.0.0.1/32 lo -
'dhcp': Configure one or more DHCP servers on the router. The API allows you to set several options including static IP assignments and the default route and DNS server. For example, to serve a range of IPs, with 2 static IPs explicitly called out on router with IP 10.0.0.1:
router vm foo dhcp 10.0.0.0 range 10.0.0.2 10.0.0.254 router vm foo dhcp 10.0.0.0 static 00:11:22:33:44:55 10.0.0.10 router vm foo dhcp 10.0.0.0 static 00:11:22:33:44:56 10.0.0.11 -
'dns': Set DNS records for IPv4 or IPv6 hosts.
-
'upstream': Set upstream server for DNS.
-
'gw': Set default gateway which will be used if there is no matching route.
-
'ra': Enable neighbor discovery protocol router advertisements for a given subnet.
-
'route': Set static, OSPF, or BGP routes. Static routes include a subnet, next-hop, and optionally a name for this router. For example to specify a static route(s):
router foo route static 0.0.0.0/0 10.0.0.1 default-route
OSPF routes include an area and a network index corresponding to the interface described in 'vm config net'. You can also specify what networks to advertise using the export command.
For example, to enable OSPF on area 0 for both interfaces of a router:
vm config net 100 200
# ...
router foo route ospf 0 0
router foo route ospf 0 1
For example, to advertise specific networks, advertise a static route or use a static route as a filter:
router foo route static 11.0.0.0/24 0 bar-route
router foo route static 12.0.0.0/24 0 bar-route
router foo route ospf 0 export 10.0.0.0/24
router foo route ospf 0 export default-route
router foo route ospf 0 export bar-route
To configure BGP must specify the process name for the specific bgp context, local ip address and AS, Neighbor ip address and AS, and what networks need to be advertised
For example, local router is in AS 100 with an ip 10.0.0.1 and bgp peer is in AS 200 with an ip of 20.0.0.1 and you want to advertise network 10.0.0.0/24:
router foo route static 10.0.0.0/24 0 foo_out
router foo bgp bar local 10.0.0.1 100
router foo bgp bar neighbor 20.0.0.1 200
router foo bgp bar export filter foo_out
You can set up route reflection for BGP by using the rrclient command for that process. By using the command it indicates that the peer is a bgp client:
router foo bgp bar rrclient
-
'rid': Sets the 32 bit router ID for the router. Typically this ID is unique across the organization's network and is used for various routing protocols ie OSPF
router foo rid 1.1.1.1 -
'fw': specify flows to accept/drop/reject via iptables. For example, to globally globally drop all forwarded packets and accept HTTP traffic from any IP address to host 192.168.0.5 on the interface at index 0 (which is on the 192.168.0.0/24 network):
router foo fw default drop router foo fw accept out 0 192.168.0.5:80 tcp
Note that we use 'out' here since we're applying the rule to the interface that's on the same network as the destination. The source and destination does not have to include a port.
New iptables chains can also be created, providing a method for grouping rules together instead of adding rules at the global level. Chains are then applied to one or more interfaces using the interface index. For example, one could put the previous rule into a chain named "allow-http" and apply it to the interface at index 0 via the following:
router foo fw chain allow-http default action drop
router foo fw chain allow-http action accept 192.168.0.5:80 tcp
router foo fw chain allow-http apply out 0
router_upstream(vm, ip)
¶
Variants:
router
Configure running minirouter VMs running minirouter and miniccc.
Routers are configured by specifying or updating a configuration, and then applying that configuration with a commit command. For example, to configure a router on a running VM named 'foo' to serve DHCP on 10.0.0.0/24 with a range of IPs:
router foo dhcp 10.0.0.0 range 10.0.0.100 10.0.0.200
router foo commit
router takes a number of subcommands:
-
'log': Change the log level of the minirouter tool on the VM.
-
'interface': Set IPv4 or IPv6 addresses, or configure an interface to assign using DHCP. The interface field is an integer index of the interface defined with 'vm config net'. You could also specify if that interface will be a loopback interface For example, to configure the second interface of the router with a static IP and a loopback with a different IP:
vm config net 100 200 # ... router foo interface 1 10.0.0.1/24 router foo interface 2 11.0.0.1/32 lo -
'dhcp': Configure one or more DHCP servers on the router. The API allows you to set several options including static IP assignments and the default route and DNS server. For example, to serve a range of IPs, with 2 static IPs explicitly called out on router with IP 10.0.0.1:
router vm foo dhcp 10.0.0.0 range 10.0.0.2 10.0.0.254 router vm foo dhcp 10.0.0.0 static 00:11:22:33:44:55 10.0.0.10 router vm foo dhcp 10.0.0.0 static 00:11:22:33:44:56 10.0.0.11 -
'dns': Set DNS records for IPv4 or IPv6 hosts.
-
'upstream': Set upstream server for DNS.
-
'gw': Set default gateway which will be used if there is no matching route.
-
'ra': Enable neighbor discovery protocol router advertisements for a given subnet.
-
'route': Set static, OSPF, or BGP routes. Static routes include a subnet, next-hop, and optionally a name for this router. For example to specify a static route(s):
router foo route static 0.0.0.0/0 10.0.0.1 default-route
OSPF routes include an area and a network index corresponding to the interface described in 'vm config net'. You can also specify what networks to advertise using the export command.
For example, to enable OSPF on area 0 for both interfaces of a router:
vm config net 100 200
# ...
router foo route ospf 0 0
router foo route ospf 0 1
For example, to advertise specific networks, advertise a static route or use a static route as a filter:
router foo route static 11.0.0.0/24 0 bar-route
router foo route static 12.0.0.0/24 0 bar-route
router foo route ospf 0 export 10.0.0.0/24
router foo route ospf 0 export default-route
router foo route ospf 0 export bar-route
To configure BGP must specify the process name for the specific bgp context, local ip address and AS, Neighbor ip address and AS, and what networks need to be advertised
For example, local router is in AS 100 with an ip 10.0.0.1 and bgp peer is in AS 200 with an ip of 20.0.0.1 and you want to advertise network 10.0.0.0/24:
router foo route static 10.0.0.0/24 0 foo_out
router foo bgp bar local 10.0.0.1 100
router foo bgp bar neighbor 20.0.0.1 200
router foo bgp bar export filter foo_out
You can set up route reflection for BGP by using the rrclient command for that process. By using the command it indicates that the peer is a bgp client:
router foo bgp bar rrclient
-
'rid': Sets the 32 bit router ID for the router. Typically this ID is unique across the organization's network and is used for various routing protocols ie OSPF
router foo rid 1.1.1.1 -
'fw': specify flows to accept/drop/reject via iptables. For example, to globally globally drop all forwarded packets and accept HTTP traffic from any IP address to host 192.168.0.5 on the interface at index 0 (which is on the 192.168.0.0/24 network):
router foo fw default drop router foo fw accept out 0 192.168.0.5:80 tcp
Note that we use 'out' here since we're applying the rule to the interface that's on the same network as the destination. The source and destination does not have to include a port.
New iptables chains can also be created, providing a method for grouping rules together instead of adding rules at the global level. Chains are then applied to one or more interfaces using the interface index. For example, one could put the previous rule into a chain named "allow-http" and apply it to the interface at index 0 via the following:
router foo fw chain allow-http default action drop
router foo fw chain allow-http action accept 192.168.0.5:80 tcp
router foo fw chain allow-http apply out 0
shell(command)
¶
Variants:
shell
Execute a command under the credentials of the running user.
Commands run until they complete or error, so take care not to execute a command that does not return.
status_updates(frequency=None)
¶
Variants:
status updates
View or set how often status updates should be published by long running commands.
Long running commands, like launching a VM that requires the VM's disk image to be transferred, can periodically publish status updates back to the original caller to show progress.
By default, the status update frequency is 3s. Status updates can be disabled by setting this value to 0. Otherwise, when setting update frequency, valid Go time units must be used ("5s", "1m", etc.).
streamResponses()
¶
streamResponses returns a generator for additional responses to a previous command.
tap()
¶
Variants: tap
Control host taps on a named vlan for communicating between a host and any VMs on that vlan.
Calling tap with no arguments will list all created taps.
To create a tap on a particular vlan, invoke tap with the create command:
tap create <vlan>
For example, to create a host tap with ip and netmask 10.0.0.1/24 on VLAN 5:
tap create 5 ip 10.0.0.1/24
Optionally, you can specify the bridge to create the host tap on:
tap create <vlan> bridge <bridge> ip <ip>
You can also optionally specify the tap name, otherwise the tap will be in the form of mega_tapX.
Additionally, you can bring the tap up with DHCP by using "dhcp" instead of a ip/netmask:
tap create 5 dhcp
Tap mirror mirrors packets that traverse the source tap to the destination tap. Both taps should already exist. You can use taps for VMs from "vm info" or host taps. For example, to mirror traffic that traverse mega_tapX to mega_tapY on the default bridge:
tap mirror mega_tapX mega_tapY
Mirroring is also supported via vm names/interface indices. The VM interfaces should already be on the same bridge. VMs must be colocated.
To delete a host tap, use the delete command and tap name from the tap list:
tap delete <id>
To delete all host taps, use id all, or 'clear tap':
tap delete all
Note: taps created while a namespace is active belong to that namespace and will only be listed when that namespace is active (or no namespace is active). Similarly, delete only applies to the taps in the active namespace. Unlike the "vlans" API, taps with the same name cannot exist in different namespaces.
tap_create(vlan)
¶
Variants:
tap create
Control host taps on a named vlan for communicating between a host and any VMs on that vlan.
Calling tap with no arguments will list all created taps.
To create a tap on a particular vlan, invoke tap with the create command:
tap create <vlan>
For example, to create a host tap with ip and netmask 10.0.0.1/24 on VLAN 5:
tap create 5 ip 10.0.0.1/24
Optionally, you can specify the bridge to create the host tap on:
tap create <vlan> bridge <bridge> ip <ip>
You can also optionally specify the tap name, otherwise the tap will be in the form of mega_tapX.
Additionally, you can bring the tap up with DHCP by using "dhcp" instead of a ip/netmask:
tap create 5 dhcp
Tap mirror mirrors packets that traverse the source tap to the destination tap. Both taps should already exist. You can use taps for VMs from "vm info" or host taps. For example, to mirror traffic that traverse mega_tapX to mega_tapY on the default bridge:
tap mirror mega_tapX mega_tapY
Mirroring is also supported via vm names/interface indices. The VM interfaces should already be on the same bridge. VMs must be colocated.
To delete a host tap, use the delete command and tap name from the tap list:
tap delete <id>
To delete all host taps, use id all, or 'clear tap':
tap delete all
Note: taps created while a namespace is active belong to that namespace and will only be listed when that namespace is active (or no namespace is active). Similarly, delete only applies to the taps in the active namespace. Unlike the "vlans" API, taps with the same name cannot exist in different namespaces.
tap_create_bridge(vlan, bridge)
¶
Variants:
tap create
Control host taps on a named vlan for communicating between a host and any VMs on that vlan.
Calling tap with no arguments will list all created taps.
To create a tap on a particular vlan, invoke tap with the create command:
tap create <vlan>
For example, to create a host tap with ip and netmask 10.0.0.1/24 on VLAN 5:
tap create 5 ip 10.0.0.1/24
Optionally, you can specify the bridge to create the host tap on:
tap create <vlan> bridge <bridge> ip <ip>
You can also optionally specify the tap name, otherwise the tap will be in the form of mega_tapX.
Additionally, you can bring the tap up with DHCP by using "dhcp" instead of a ip/netmask:
tap create 5 dhcp
Tap mirror mirrors packets that traverse the source tap to the destination tap. Both taps should already exist. You can use taps for VMs from "vm info" or host taps. For example, to mirror traffic that traverse mega_tapX to mega_tapY on the default bridge:
tap mirror mega_tapX mega_tapY
Mirroring is also supported via vm names/interface indices. The VM interfaces should already be on the same bridge. VMs must be colocated.
To delete a host tap, use the delete command and tap name from the tap list:
tap delete <id>
To delete all host taps, use id all, or 'clear tap':
tap delete all
Note: taps created while a namespace is active belong to that namespace and will only be listed when that namespace is active (or no namespace is active). Similarly, delete only applies to the taps in the active namespace. Unlike the "vlans" API, taps with the same name cannot exist in different namespaces.
tap_create_bridge_dhcp(vlan, bridge, tap=None)
¶
Variants:
tap create
Control host taps on a named vlan for communicating between a host and any VMs on that vlan.
Calling tap with no arguments will list all created taps.
To create a tap on a particular vlan, invoke tap with the create command:
tap create <vlan>
For example, to create a host tap with ip and netmask 10.0.0.1/24 on VLAN 5:
tap create 5 ip 10.0.0.1/24
Optionally, you can specify the bridge to create the host tap on:
tap create <vlan> bridge <bridge> ip <ip>
You can also optionally specify the tap name, otherwise the tap will be in the form of mega_tapX.
Additionally, you can bring the tap up with DHCP by using "dhcp" instead of a ip/netmask:
tap create 5 dhcp
Tap mirror mirrors packets that traverse the source tap to the destination tap. Both taps should already exist. You can use taps for VMs from "vm info" or host taps. For example, to mirror traffic that traverse mega_tapX to mega_tapY on the default bridge:
tap mirror mega_tapX mega_tapY
Mirroring is also supported via vm names/interface indices. The VM interfaces should already be on the same bridge. VMs must be colocated.
To delete a host tap, use the delete command and tap name from the tap list:
tap delete <id>
To delete all host taps, use id all, or 'clear tap':
tap delete all
Note: taps created while a namespace is active belong to that namespace and will only be listed when that namespace is active (or no namespace is active). Similarly, delete only applies to the taps in the active namespace. Unlike the "vlans" API, taps with the same name cannot exist in different namespaces.
tap_create_bridge_ip(vlan, bridge, ip, tap=None)
¶
Variants:
tap create
Control host taps on a named vlan for communicating between a host and any VMs on that vlan.
Calling tap with no arguments will list all created taps.
To create a tap on a particular vlan, invoke tap with the create command:
tap create <vlan>
For example, to create a host tap with ip and netmask 10.0.0.1/24 on VLAN 5:
tap create 5 ip 10.0.0.1/24
Optionally, you can specify the bridge to create the host tap on:
tap create <vlan> bridge <bridge> ip <ip>
You can also optionally specify the tap name, otherwise the tap will be in the form of mega_tapX.
Additionally, you can bring the tap up with DHCP by using "dhcp" instead of a ip/netmask:
tap create 5 dhcp
Tap mirror mirrors packets that traverse the source tap to the destination tap. Both taps should already exist. You can use taps for VMs from "vm info" or host taps. For example, to mirror traffic that traverse mega_tapX to mega_tapY on the default bridge:
tap mirror mega_tapX mega_tapY
Mirroring is also supported via vm names/interface indices. The VM interfaces should already be on the same bridge. VMs must be colocated.
To delete a host tap, use the delete command and tap name from the tap list:
tap delete <id>
To delete all host taps, use id all, or 'clear tap':
tap delete all
Note: taps created while a namespace is active belong to that namespace and will only be listed when that namespace is active (or no namespace is active). Similarly, delete only applies to the taps in the active namespace. Unlike the "vlans" API, taps with the same name cannot exist in different namespaces.
tap_create_bridge_name(vlan, bridge, tap=None)
¶
Variants:
tap create
Control host taps on a named vlan for communicating between a host and any VMs on that vlan.
Calling tap with no arguments will list all created taps.
To create a tap on a particular vlan, invoke tap with the create command:
tap create <vlan>
For example, to create a host tap with ip and netmask 10.0.0.1/24 on VLAN 5:
tap create 5 ip 10.0.0.1/24
Optionally, you can specify the bridge to create the host tap on:
tap create <vlan> bridge <bridge> ip <ip>
You can also optionally specify the tap name, otherwise the tap will be in the form of mega_tapX.
Additionally, you can bring the tap up with DHCP by using "dhcp" instead of a ip/netmask:
tap create 5 dhcp
Tap mirror mirrors packets that traverse the source tap to the destination tap. Both taps should already exist. You can use taps for VMs from "vm info" or host taps. For example, to mirror traffic that traverse mega_tapX to mega_tapY on the default bridge:
tap mirror mega_tapX mega_tapY
Mirroring is also supported via vm names/interface indices. The VM interfaces should already be on the same bridge. VMs must be colocated.
To delete a host tap, use the delete command and tap name from the tap list:
tap delete <id>
To delete all host taps, use id all, or 'clear tap':
tap delete all
Note: taps created while a namespace is active belong to that namespace and will only be listed when that namespace is active (or no namespace is active). Similarly, delete only applies to the taps in the active namespace. Unlike the "vlans" API, taps with the same name cannot exist in different namespaces.
tap_create_dhcp(vlan, tap=None)
¶
Variants:
tap create
Control host taps on a named vlan for communicating between a host and any VMs on that vlan.
Calling tap with no arguments will list all created taps.
To create a tap on a particular vlan, invoke tap with the create command:
tap create <vlan>
For example, to create a host tap with ip and netmask 10.0.0.1/24 on VLAN 5:
tap create 5 ip 10.0.0.1/24
Optionally, you can specify the bridge to create the host tap on:
tap create <vlan> bridge <bridge> ip <ip>
You can also optionally specify the tap name, otherwise the tap will be in the form of mega_tapX.
Additionally, you can bring the tap up with DHCP by using "dhcp" instead of a ip/netmask:
tap create 5 dhcp
Tap mirror mirrors packets that traverse the source tap to the destination tap. Both taps should already exist. You can use taps for VMs from "vm info" or host taps. For example, to mirror traffic that traverse mega_tapX to mega_tapY on the default bridge:
tap mirror mega_tapX mega_tapY
Mirroring is also supported via vm names/interface indices. The VM interfaces should already be on the same bridge. VMs must be colocated.
To delete a host tap, use the delete command and tap name from the tap list:
tap delete <id>
To delete all host taps, use id all, or 'clear tap':
tap delete all
Note: taps created while a namespace is active belong to that namespace and will only be listed when that namespace is active (or no namespace is active). Similarly, delete only applies to the taps in the active namespace. Unlike the "vlans" API, taps with the same name cannot exist in different namespaces.
tap_create_ip(vlan, ip, tap=None)
¶
Variants:
tap create
Control host taps on a named vlan for communicating between a host and any VMs on that vlan.
Calling tap with no arguments will list all created taps.
To create a tap on a particular vlan, invoke tap with the create command:
tap create <vlan>
For example, to create a host tap with ip and netmask 10.0.0.1/24 on VLAN 5:
tap create 5 ip 10.0.0.1/24
Optionally, you can specify the bridge to create the host tap on:
tap create <vlan> bridge <bridge> ip <ip>
You can also optionally specify the tap name, otherwise the tap will be in the form of mega_tapX.
Additionally, you can bring the tap up with DHCP by using "dhcp" instead of a ip/netmask:
tap create 5 dhcp
Tap mirror mirrors packets that traverse the source tap to the destination tap. Both taps should already exist. You can use taps for VMs from "vm info" or host taps. For example, to mirror traffic that traverse mega_tapX to mega_tapY on the default bridge:
tap mirror mega_tapX mega_tapY
Mirroring is also supported via vm names/interface indices. The VM interfaces should already be on the same bridge. VMs must be colocated.
To delete a host tap, use the delete command and tap name from the tap list:
tap delete <id>
To delete all host taps, use id all, or 'clear tap':
tap delete all
Note: taps created while a namespace is active belong to that namespace and will only be listed when that namespace is active (or no namespace is active). Similarly, delete only applies to the taps in the active namespace. Unlike the "vlans" API, taps with the same name cannot exist in different namespaces.
tap_create_name(vlan, tap)
¶
Variants:
tap create
Control host taps on a named vlan for communicating between a host and any VMs on that vlan.
Calling tap with no arguments will list all created taps.
To create a tap on a particular vlan, invoke tap with the create command:
tap create <vlan>
For example, to create a host tap with ip and netmask 10.0.0.1/24 on VLAN 5:
tap create 5 ip 10.0.0.1/24
Optionally, you can specify the bridge to create the host tap on:
tap create <vlan> bridge <bridge> ip <ip>
You can also optionally specify the tap name, otherwise the tap will be in the form of mega_tapX.
Additionally, you can bring the tap up with DHCP by using "dhcp" instead of a ip/netmask:
tap create 5 dhcp
Tap mirror mirrors packets that traverse the source tap to the destination tap. Both taps should already exist. You can use taps for VMs from "vm info" or host taps. For example, to mirror traffic that traverse mega_tapX to mega_tapY on the default bridge:
tap mirror mega_tapX mega_tapY
Mirroring is also supported via vm names/interface indices. The VM interfaces should already be on the same bridge. VMs must be colocated.
To delete a host tap, use the delete command and tap name from the tap list:
tap delete <id>
To delete all host taps, use id all, or 'clear tap':
tap delete all
Note: taps created while a namespace is active belong to that namespace and will only be listed when that namespace is active (or no namespace is active). Similarly, delete only applies to the taps in the active namespace. Unlike the "vlans" API, taps with the same name cannot exist in different namespaces.
tap_delete(tap)
¶
Variants:
tap delete
Control host taps on a named vlan for communicating between a host and any VMs on that vlan.
Calling tap with no arguments will list all created taps.
To create a tap on a particular vlan, invoke tap with the create command:
tap create <vlan>
For example, to create a host tap with ip and netmask 10.0.0.1/24 on VLAN 5:
tap create 5 ip 10.0.0.1/24
Optionally, you can specify the bridge to create the host tap on:
tap create <vlan> bridge <bridge> ip <ip>
You can also optionally specify the tap name, otherwise the tap will be in the form of mega_tapX.
Additionally, you can bring the tap up with DHCP by using "dhcp" instead of a ip/netmask:
tap create 5 dhcp
Tap mirror mirrors packets that traverse the source tap to the destination tap. Both taps should already exist. You can use taps for VMs from "vm info" or host taps. For example, to mirror traffic that traverse mega_tapX to mega_tapY on the default bridge:
tap mirror mega_tapX mega_tapY
Mirroring is also supported via vm names/interface indices. The VM interfaces should already be on the same bridge. VMs must be colocated.
To delete a host tap, use the delete command and tap name from the tap list:
tap delete <id>
To delete all host taps, use id all, or 'clear tap':
tap delete all
Note: taps created while a namespace is active belong to that namespace and will only be listed when that namespace is active (or no namespace is active). Similarly, delete only applies to the taps in the active namespace. Unlike the "vlans" API, taps with the same name cannot exist in different namespaces.
tap_mirror(src=None, dst=None, bridge=None, vm=None, interface=None, vm2=None, interface2=None)
¶
Variants:
tap mirror
Control host taps on a named vlan for communicating between a host and any VMs on that vlan.
Calling tap with no arguments will list all created taps.
To create a tap on a particular vlan, invoke tap with the create command:
tap create <vlan>
For example, to create a host tap with ip and netmask 10.0.0.1/24 on VLAN 5:
tap create 5 ip 10.0.0.1/24
Optionally, you can specify the bridge to create the host tap on:
tap create <vlan> bridge <bridge> ip <ip>
You can also optionally specify the tap name, otherwise the tap will be in the form of mega_tapX.
Additionally, you can bring the tap up with DHCP by using "dhcp" instead of a ip/netmask:
tap create 5 dhcp
Tap mirror mirrors packets that traverse the source tap to the destination tap. Both taps should already exist. You can use taps for VMs from "vm info" or host taps. For example, to mirror traffic that traverse mega_tapX to mega_tapY on the default bridge:
tap mirror mega_tapX mega_tapY
Mirroring is also supported via vm names/interface indices. The VM interfaces should already be on the same bridge. VMs must be colocated.
To delete a host tap, use the delete command and tap name from the tap list:
tap delete <id>
To delete all host taps, use id all, or 'clear tap':
tap delete all
Note: taps created while a namespace is active belong to that namespace and will only be listed when that namespace is active (or no namespace is active). Similarly, delete only applies to the taps in the active namespace. Unlike the "vlans" API, taps with the same name cannot exist in different namespaces.
version()
¶
Variants: version
display the minimega version
viz(filename)
¶
Variants:
viz
Output the current experiment topology as a graphviz readable 'dot' file.
vlans()
¶
Variants: vlans
Display information about allocated VLANs. With no arguments, prints out the known VLAN aliases. The following subcommands are supported:
range - view or set the VLAN range add - add an alias blacklist - view or create blacklisted VLAN
Note: this command is namespace aware so, for example, adding a range applies to all new VLAN aliases in the current namespace.
vlans_add(alias, vlan)
¶
Variants:
vlans add
Display information about allocated VLANs. With no arguments, prints out the known VLAN aliases. The following subcommands are supported:
range - view or set the VLAN range add - add an alias blacklist - view or create blacklisted VLAN
Note: this command is namespace aware so, for example, adding a range applies to all new VLAN aliases in the current namespace.
vlans_blacklist(vlan=None)
¶
Variants:
vlans blacklist
Display information about allocated VLANs. With no arguments, prints out the known VLAN aliases. The following subcommands are supported:
range - view or set the VLAN range add - add an alias blacklist - view or create blacklisted VLAN
Note: this command is namespace aware so, for example, adding a range applies to all new VLAN aliases in the current namespace.
vlans_range(min=None, max=None)
¶
Variants:
vlans range
Display information about allocated VLANs. With no arguments, prints out the known VLAN aliases. The following subcommands are supported:
range - view or set the VLAN range add - add an alias blacklist - view or create blacklisted VLAN
Note: this command is namespace aware so, for example, adding a range applies to all new VLAN aliases in the current namespace.
vm_cdrom_change(vm, path, force=None)
¶
Variants:
vm cdrom change
Eject or change an active VM's cdrom image.
Eject VM 0's cdrom:
vm cdrom eject 0
Eject all VM cdroms:
vm cdrom eject all
If the cdrom is "locked" by the guest, the force option can be used to override the lock:
vm cdrom eject 0 force
Change a VM to use a new ISO:
vm cdrom change 0 /tmp/debian.iso
"vm cdrom change" ejects the current ISO, if there is one.
See "vm start" for a full description of allowable targets.
vm_cdrom_eject(vm, force=None)
¶
Variants:
vm cdrom eject
Eject or change an active VM's cdrom image.
Eject VM 0's cdrom:
vm cdrom eject 0
Eject all VM cdroms:
vm cdrom eject all
If the cdrom is "locked" by the guest, the force option can be used to override the lock:
vm cdrom eject 0 force
Change a VM to use a new ISO:
vm cdrom change 0 /tmp/debian.iso
"vm cdrom change" ejects the current ISO, if there is one.
See "vm start" for a full description of allowable targets.
vm_config()
¶
Variants: vm config
Display, save, or restore the current VM configuration. Note that saving and restoring configuration applies to all VM configurations including KVM-based VM configurations.
To display the current configuration, call vm config with no arguments.
List the current saved configurations with 'vm config restore'.
To save a configuration:
vm config save <config name>
To restore a configuration:
vm config restore <config name>
To clone the configuration of an existing VM:
vm config clone <vm name>
Clone reparses the original network "vm config net". If the cloned VM was configured with a static MAC, the VM config will not be launchable. Clone also clears the UUID.
Calling clear vm config will clear all VM configuration options, but will not remove saved configurations.
Android-related generated config fields use the following names:
android-sdk
android-emulator
android-adb
android-avd
android-avd-dir
android-no-window
android-console-base-port
android-extra-args
android-writable-system
These refer to host-side Android emulator runtime settings, not files served from the minimega files directory.
vm_config_android_adb(value=None)
¶
Variants:
vm config android-adb
Configure the host-side adb binary.
This value may be an absolute path or a binary name resolvable via the host PATH.
vm_config_android_avd(value=None)
¶
Variants:
vm config android-avd
Configure the Android Virtual Device (AVD) name to use when launching Android VMs.
vm_config_android_avd_dir(value=None)
¶
Variants:
vm config android-avd-dir
Configure the host-side directory containing Android AVD data.
This should generally contain entries such as:
vm_config_android_console_base_port(value=None)
¶
Variants:
vm config android-console-base-port
Configure the preferred starting console port for Android emulator instances.
This value is a hint, not a guaranteed assignment. minimega searches for the first available Android console/ADB port pair starting at this port. If the requested pair is already reserved or unavailable, the next valid pair is used.
If set to 0, minimega starts searching at the beginning of the valid Android emulator console port range. Console ports are even ports in the range 5554-5680, and the corresponding ADB port is console+1.
If nonzero, this value must be an even port in the valid console port range. Starting later in the range reduces the number of candidate port pairs.
The valid range contains 64 console/ADB port pairs, so a single minimega host can run at most 64 Android emulator VMs concurrently, and fewer if some ports in the range are already in use. In a multi-host namespace, this limit applies independently to each host.
Default: 0
vm_config_android_emulator(value=None)
¶
Variants:
vm config android-emulator
Configure the host-side Android emulator binary.
This value may be an absolute path or a binary name resolvable via the host PATH.
vm_config_android_extra_args(value=None)
¶
Variants:
vm config android-extra-args
Additional raw arguments to append to the Android emulator command line.
vm_config_android_no_window(true_or_false=None)
¶
Variants:
vm config android-no-window
Launch Android VMs without creating a local emulator window.
Default: true
vm_config_android_sdk(value=None)
¶
Variants:
vm config android-sdk
Configure the host-side Android SDK root directory.
This path is interpreted on the minimega host and is not treated as a file served from the minimega files directory.
vm_config_android_writable_system(true_or_false=None)
¶
Variants:
vm config android-writable-system
Request writable system behavior for the Android emulator runtime.
Default: false
vm_config_append(value=None)
¶
Variants:
vm config append
Add an append string to a kernel set with vm kernel. Setting vm append without using vm kernel will result in an error.
For example, to set a static IP for a linux VM:
vm config append ip=10.0.0.5 gateway=10.0.0.1 netmask=255.255.255.0 dns=10.10.10.10
Note: this configuration only applies to KVM-based VMs.
vm_config_backchannel(true_or_false=None)
¶
Variants:
vm config backchannel
Enable/disable serial command and control layer for this VM.
Default: true
vm_config_baremetal(true_or_false=None)
¶
Variants:
vm config baremetal
Launch QEMU with only the devices required for a bare-metal firmware. This suppresses the PC-oriented display, VNC, USB, CD-ROM, keyboard, RTC, PCI bridge, and virtio backchannel devices that minimega normally adds. QMP, PID tracking, serial sockets, tap networking, and lifecycle control remain available.
Bare-metal guests must provide a kernel/firmware image, disable the MiniCCC backchannel, and explicitly request any serial ports.
Default: false
vm_config_baremetal_network_driver(value=None)
¶
Variants:
vm config baremetal-network-driver
Specify a board-integrated NIC model that QEMU does not report through its device-help output. Bare-metal machines such as mps2-an385 expose their network controller as part of the board rather than as a PCI device, so it must be added explicitly to the accepted network-driver set.
This setting has no effect unless baremetal is enabled.
vm_config_bidirectional_copy_paste(true_or_false=None)
¶
Variants:
vm config bidirectional-copy-paste
Enables bidirectional copy paste instead of basic pasting into VM. Requires QEMU 6.1+ compiled with qemu-vdagent chardev and for spice-vdagent to be installed on VM.
Default: false
vm_config_bonds(bondspec=None)
¶
Variants:
vm config bonds
Specify any network interface bonds for the VM. A bond can be comprised of two or more network interfaces configured on the VM, and are referenced by interface index.
There are three bond modes supported: active-backup, balance-slb, and balance-tcp, and three LACP modes supported: active, passive, and off. To disable the bond if LACP negotiation fails instead of falling back to active-backup mode, provide the 'no-lacp-fallback' option.
Bonds can also be configured in "dot1q-tunnel" mode (QinQ) in OVS with the "qinq" option. If configured in "dot1q-tunnel" mode, the outer VLAN tag will be set to the VLAN the bonded interfaces originally belonged to. Note that a bond will also be configured in "dot1q-tunnel" mode if at least one of the bonded interfaces was configured in "dot1q-tunnel" mode, even without the "qinq" option.
If not provided, LACP mode will be 'active', LACP fallback will be enabled, QinQ will be disabled (unless one of the interfaces being bonded is configured for QinQ), and the bond name will be auto generated.
The order is:
<interface indexes>,<bond mode>,<lacp mode>,<no-lacp-fallback>,<qinq>,<bond name>
where '
Note that if 'no-lacp-fallback' is provided, then the LACP mode must also be provided.
Examples:
To create an 'active-backup' bond using interfaces 1 and 2 with LACP set to active:
vm config bond 1,2,active-backup
To create a 'balance-tcp' bond named 'uplink' using interfaces 0 and 1 with LACP fallback disabled:
vm config bond 0,1,balance-tcp,active,no-lacp-fallback,uplink
Calling vm config bonds with no arguments prints the current configuration.
vm_config_cdrom(value=None)
¶
Variants:
vm config cdrom
Attach a cdrom to a VM. When using a cdrom, it will automatically be set to be the boot device.
Note: this configuration only applies to KVM-based VMs.
vm_config_clone(vm)
¶
Variants:
vm config clone
Display, save, or restore the current VM configuration. Note that saving and restoring configuration applies to all VM configurations including KVM-based VM configurations.
To display the current configuration, call vm config with no arguments.
List the current saved configurations with 'vm config restore'.
To save a configuration:
vm config save <config name>
To restore a configuration:
vm config restore <config name>
To clone the configuration of an existing VM:
vm config clone <vm name>
Clone reparses the original network "vm config net". If the cloned VM was configured with a static MAC, the VM config will not be launchable. Clone also clears the UUID.
Calling clear vm config will clear all VM configuration options, but will not remove saved configurations.
Android-related generated config fields use the following names:
android-sdk
android-emulator
android-adb
android-avd
android-avd-dir
android-no-window
android-console-base-port
android-extra-args
android-writable-system
These refer to host-side Android emulator runtime settings, not files served from the minimega files directory.
vm_config_colocate(value=None)
¶
Variants:
vm config colocate
Colocate this VM with another VM that has already been launched or is queued for launching.
Note: Cannot specify Colocate and Schedule in the same
vm_config_cores(value=None)
¶
Variants:
vm config cores
Set the number of CPU cores per socket. If unspecified, QEMU will calculate missing values based on vCPUs, sockets, and threads.
vm_config_coschedule(value=None)
¶
Variants:
vm config coschedule
Set a limit on the number of VMs that should be scheduled on the same host as the VM. A limit of zero means that the VM should be scheduled by itself. A limit of -1 means that there is no limit. This is only used when launching VMs in a namespace.
Default: -1
vm_config_cpu(value=None)
¶
Variants:
vm config cpu
Set the virtual CPU architecture.
By default, set to 'host' which matches the host CPU. See 'qemu -cpu help' for a list of supported CPUs.
The accepted values for this configuration depend on the QEMU binary name specified by 'vm config qemu'.
Note: this configuration only applies to KVM-based VMs.
Default: "host"
vm_config_disks(diskspec=None)
¶
Variants:
vm config disks
Specify one or more disks to be connected to a VM. Any disk image supported by QEMU is a valid parameter.
Optionally, you may specify the drive interface for QEMU to use. By default, "ide" is used. Supported interfaces are "ahci", "ide", "scsi", "sd", "mtd", "floppy", "pflash", and "virtio".
Optionally, you may specify the cache mode to be used by the drive. By default, "unsafe" is used for vms launched in snapshot mode, and "writeback" is used otherwise. Supported cache modes are "none", "writeback", "unsafe", "directsync", and "writethrough".
Note: although disk snapshot image files are saved in the temporary vm instance paths, they may not be usable if the "unsafe" cache mode is used, as all flush commands from the guest are ignored in that cache mode. For example, even if you shut down the guest cleanly, there may still be data not yet written to the snapshot image file. If you wish to copy and use the snapshot image file cleanly, you can flush the disk cache manually via the QMP command socket, or specify a different cache mode such as "writeback".
The order is:
<path>,<interface>,<cache mode>
Examples:
To attach a disk with the default interface and cache mode:
vm config disk linux_disk.qcow2
To attach 2 disks using the "ide" interface for the first disk and default interface for the second disk:
vm config disk linux_disk.qcow2,ide storage_disk.qcow2
To attach a disk using the "ide" interface with the "unsafe" cache mode:
vm config disk linux_disk.qcow2,ide,unsafe
Disk images launched in snapshot mode may safely be used for multiple VMs.
Calling vm config disks with no arguments prints the current configuration.
Note: this configuration only applies to KVM-based VMs.
vm_config_fifos(value=None)
¶
Variants:
vm config fifos
Set the number of named pipes to include in the container for container-host communication. Named pipes will appear on the host in the instance directory for the container as fifoN, and on the container as /dev/fifos/fifoN.
Fifos are created using mkfifo() and have all of the same usage constraints.
Note: this configuration only applies to containers.
vm_config_filesystem(value=None)
¶
Variants:
vm config filesystem
Configure the filesystem to use for launching a container. This should be a root filesystem for a linux distribution (containing /dev, /proc, /sys, etc.)
Note: this configuration only applies to containers and must be specified.
vm_config_hostname(value=None)
¶
Variants:
vm config hostname
Set a hostname for a container before launching the init program. If not set, the hostname will be the VM name. The hostname can also be set by the init program or other root process in the container.
Note: this configuration only applies to containers.
vm_config_init(value=None)
¶
Variants:
vm config init
Set the init program and args to exec into upon container launch. This will be PID 1 in the container.
Note: this configuration only applies to containers.
Default: "/init"
vm_config_initrd(value=None)
¶
Variants:
vm config initrd
Attach an initrd image to a VM. Passed along with the kernel image at boot time.
Note: this configuration only applies to KVM-based VMs.
vm_config_kernel(value=None)
¶
Variants:
vm config kernel
Attach a kernel image to a VM. If set, QEMU will boot from this image instead of any disk image.
Note: this configuration only applies to KVM-based VMs.
vm_config_machine(value=None)
¶
Variants:
vm config machine
Specify the machine type. See 'qemu -M help' for a list supported machine types.
The accepted values for this configuration depend on the QEMU binary name specified by 'vm config qemu'.
Note: this configuration only applies to KVM-based VMs.
vm_config_memory(value=None)
¶
Variants:
vm config memory
Configures the amount of physical memory to allocate (in megabytes).
Default: 2048
vm_config_migrate(value=None)
¶
Variants:
vm config migrate
NOTE: the 'migrate' command is DEPRECATED and will be removed in a future release. Use 'vm save' instead.
Assign a VM state image, generated by a previously saved VM to boot with. Explicitly, this is the state of a previously running VM and NOT the disk state. By default, images are read from the files directory as specified with -filepath. This can be overridden by using an absolute path. State images should be booted with a kernel/initrd, disk, or cdrom. The state often does not make sense without the corresponding disk file and using it with an unrelated disk (or cdrom) is discouraged. Use 'vm save' to generate state images from running VMs.
Note: this configuration only applies to KVM-based VMs.
vm_config_networks(netspec=None)
¶
Variants:
vm config networks
Specify the network(s) that the VM is a member of by VLAN. A corresponding VLAN will be created for each network. Optionally, you may specify the bridge the interface will be connected on. If the bridge name is omitted, minimega will use the default "mega_bridge".
You can also optionally specify the MAC address of the interface to connect to that network. If not specified, the MAC address will be randomly generated.
You can also optionally specify a network device for qemu to use (which is ignored by containers). By default, "e1000" is used. To see a list of valid network devices, from run "qemu-kvm -device help".
Finally, you can also optionally specify whether the interface should be configured in "dot1q-tunnel" mode (QinQ) in OVS. If so, the outer VLAN tag will be set to the minimega VLAN specified as part of the netspec.
The order is:
<bridge>,<VLAN>,<MAC>,<driver>,<qinq>
Examples:
To connect a VM to VLANs 1 and 5:
vm config net 1 5
To connect a VM to VLANs 100, 101, and 102 with specific mac addresses:
vm config net 100,00:00:00:00:00:00 101,00:00:00:00:01:00 102,00:00:00:00:02:00
To connect a VM to VLAN 1 on bridge0 and VLAN 2 on bridge1:
vm config net bridge0,1 bridge1,2
To connect a VM to VLAN 100 on bridge0 with a specific mac:
vm config net bridge0,100,00:11:22:33:44:55
To specify a specific driver, such as i82559c:
vm config net 100,i82559c
To specify the use of "dot1q-tunnel" mode with VLAN 105 as the outer VLAN:
vm config net 105,qinq
If you prefer, you can also use aliases for VLANs:
vm config net DMZ CORE
These aliases will be allocated from the pool of available VLANs and is namespace-aware (i.e. 'DMZ' in namespace 'foo' will be a different VLAN than 'DMZ' in namespace 'bar'). Internally, this is implemented by concatenating the namespace name with the VLAN alias (e.g. 'DMZ' in namespace 'foo' becomes 'foo//DMZ'). If you wish to connect VLANs in different namespaces, you may use/abuse this implementation detail:
namespace bar
vm config net foo//DMZ
For Android VMs, configured networks are attached using minimega-created tap devices on the requested bridge/VLAN. AndroidVM automatically uses a virtio-net-pci NIC for these tap-backed interfaces because Android Emulator's backend QEMU does not support minimega's default e1000 NIC. The Android guest will see the device as an additional interface, for example eth1.
minimega only creates and manages the host-side tap/bridge/VLAN plumbing. It does not configure Android guest IP addresses, policy routing, or firewall rules. Those must be configured inside the guest by the user or an orchestration layer.
Calling vm config net with no arguments prints the current configuration.
vm_config_preinit(value=None)
¶
Variants:
vm config preinit
Containers start in a highly restricted environment. vm config preinit allows running processes before isolation mechanisms are enabled. This occurs when the vm is launched and before the vm is put in the building state. preinit processes must finish before the vm will be allowed to start.
Specifically, the preinit command will be run after entering namespaces, and mounting dependent filesystems, but before cgroups and root capabilities are set, and before entering the chroot. This means that the preinit command is run as root and can control the host.
For example, to run a script that enables ip forwarding, which is not allowed during runtime because /proc is mounted read-only, add a preinit script:
vm config preinit enable_ip_forwarding.sh
Note: this configuration only applies to containers.
vm_config_qemu(value=None)
¶
Variants:
vm config qemu
Set the QEMU binary name to invoke. Relative paths are ok.
Note: this configuration only applies to KVM-based VMs.
Default: "kvm"
vm_config_qemu_append(value=None)
¶
Variants:
vm config qemu-append
Add additional arguments to be passed to the QEMU instance. For example:
vm config qemu-append -serial tcp:localhost:4001
Note: this configuration only applies to KVM-based VMs.
vm_config_qemu_override(match=None, replacement=None)
¶
Variants:
vm config qemu-override
Override parts of the QEMU launch string by supplying a string to match, and a replacement string. Overrides are applied in the order that they are defined and do not replace earlier overrides -- if more than override share the same "match" will later overrides will be applied to the overridden launch string.
Note: this configuration only applies to KVM-based VMs.
vm_config_restore(name=None)
¶
Variants:
vm config restore
Display, save, or restore the current VM configuration. Note that saving and restoring configuration applies to all VM configurations including KVM-based VM configurations.
To display the current configuration, call vm config with no arguments.
List the current saved configurations with 'vm config restore'.
To save a configuration:
vm config save <config name>
To restore a configuration:
vm config restore <config name>
To clone the configuration of an existing VM:
vm config clone <vm name>
Clone reparses the original network "vm config net". If the cloned VM was configured with a static MAC, the VM config will not be launchable. Clone also clears the UUID.
Calling clear vm config will clear all VM configuration options, but will not remove saved configurations.
Android-related generated config fields use the following names:
android-sdk
android-emulator
android-adb
android-avd
android-avd-dir
android-no-window
android-console-base-port
android-extra-args
android-writable-system
These refer to host-side Android emulator runtime settings, not files served from the minimega files directory.
vm_config_save(name)
¶
Variants:
vm config save
Display, save, or restore the current VM configuration. Note that saving and restoring configuration applies to all VM configurations including KVM-based VM configurations.
To display the current configuration, call vm config with no arguments.
List the current saved configurations with 'vm config restore'.
To save a configuration:
vm config save <config name>
To restore a configuration:
vm config restore <config name>
To clone the configuration of an existing VM:
vm config clone <vm name>
Clone reparses the original network "vm config net". If the cloned VM was configured with a static MAC, the VM config will not be launchable. Clone also clears the UUID.
Calling clear vm config will clear all VM configuration options, but will not remove saved configurations.
Android-related generated config fields use the following names:
android-sdk
android-emulator
android-adb
android-avd
android-avd-dir
android-no-window
android-console-base-port
android-extra-args
android-writable-system
These refer to host-side Android emulator runtime settings, not files served from the minimega files directory.
vm_config_schedule(value=None)
¶
Variants:
vm config schedule
Set a host where the VM should be scheduled.
Note: Cannot specify Schedule and Colocate in the same config.
vm_config_serial_ports(value=None)
¶
Variants:
vm config serial-ports
Specify the serial ports that will be created for the VM to use. Serial
ports specified will be mapped to the VM's /dev/ttySX device, where X
refers to the connected unix socket on the host at
$minimega_runtime/
Examples:
To display current serial ports: vm config serial-ports
To create three serial ports: vm config serial-ports 3
Note: Whereas modern versions of Windows support up to 256 COM ports, Linux typically only supports up to four serial devices. To use more, make sure to pass "8250.n_uarts = 4" to the guest Linux kernel at boot. Replace 4 with another number.
vm_config_snapshot(true_or_false=None)
¶
Variants:
vm config snapshot
Enable or disable snapshot mode for disk images and container filesystems. When enabled, disks/filesystems will have temporary snapshots created when run and changes will not be saved. This allows a single disk/filesystem to be used for many VMs.
Default: true
vm_config_sockets(value=None)
¶
Variants:
vm config sockets
Set the number of CPU sockets. If unspecified, QEMU will calculate missing values based on vCPUs, cores, and threads.
vm_config_state(value=None)
¶
Variants:
vm config state
NOTE: the 'migrate' command is DEPRECATED and will be removed in a future release. Use 'vm save' instead.
Assign a VM state image, generated by a previously saved VM to boot with. Explicitly, this is the state of a previously running VM and NOT the disk state. By default, images are read from the files directory as specified with -filepath. This can be overridden by using an absolute path. State images should be booted with a kernel/initrd, disk, or cdrom. The state often does not make sense without the corresponding disk file and using it with an unrelated disk (or cdrom) is discouraged. Use 'vm save' to generate state images from running VMs.
Note: this configuration only applies to KVM-based VMs.
vm_config_tags(key=None, value=None)
¶
Variants:
vm config tags
Set tags in the same manner as "vm tag". These tags will apply to all newly launched VMs.
Default: empty map
vm_config_threads(value=None)
¶
Variants:
vm config threads
Set the number of CPU threads per core. If unspecified, QEMU will calculate missing values based on vCPUs, sockets, and cores.
vm_config_tpm_socket(value=None)
¶
Variants:
vm config tpm-socket
If specified, will configure VM to use virtual Trusted Platform Module (TPM) socket at the path provided
vm_config_usb_use_xhci(true_or_false=None)
¶
Variants:
vm config usb-use-xhci
If true will use xHCI USB controller. Otherwise will use EHCI. EHCI does not support USB 3.0, but may be used for backwards compatibility.
Default: true
vm_config_uuid(value=None)
¶
Variants:
vm config uuid
Configures the UUID for a virtual machine. If not set, the VM will be given a random one when it is launched.
vm_config_vcpus(value=None)
¶
Variants:
vm config vcpus
Configures the number of virtual CPUs to allocate for a VM.
Default: 1
vm_config_vga(value=None)
¶
Variants:
vm config vga
Specify the graphics card to emulate. "cirrus" or "std" should work with most operating systems.
Default: "std"
vm_config_virtio_ports(value=None)
¶
Variants:
vm config virtio-ports
Specify the virtio-serial ports that will be created for the VM to use.
Virtio-serial ports specified will be mapped to the VM's
/dev/virtio-port/
Examples:
To display current virtio-serial ports: vm config virtio-ports
To create three virtio-serial ports: vm config virtio-ports 3
To explicitly name the virtio-ports, pass a comma-separated list of names:
vm config virtio-ports foo,bar
The ports (on the guest) will then be mapped to /dev/virtio-port/foo and /dev/virtio-port/bar.
vm_config_volume(key=None, value=None)
¶
Variants:
vm config volume
Attach one or more volumes to a container. These directories will be mounted inside the container at the specified location.
For example, to mount /scratch/data to /data inside the container:
vm config volume /data /scratch/data
Commands with the same
vm config volume /data /scratch/data2 vm config volume /data /scratch/data2
Note: this configuration only applies to containers.
Default: empty map
vm_flush(vm=None)
¶
Variants:
vm flush
Flush one or more virtual machines. Discard information about VMs that have either quit or encountered an error. This will remove VMs with a state of "quit" or "error" from vm info. Names of VMs that have been flushed may be reused.
Note running without arguments results in the same behavior as using the "all" target. See "vm start" for a full description of allowable targets.
vm_hotplug()
¶
Variants: vm hotplug
Add and remove USB drives to a launched VM.
To view currently attached media, call vm hotplug with the 'show' argument and a VM name. To add a device, use the 'add' argument followed by the VM name, and the name of the file to add. For example, to add foo.img to VM foo:
vm hotplug add foo foo.img
The add command will assign a disk ID, shown in "vm hotplug". The optional parameter allows you to specify whether the drive will appear on the 1.1 or 2.0 USB bus. For USB 1.1:
vm hotplug add foo foo.img 1.1
For USB 2.0:
vm hotplug add foo foo.img 2.0
To remove media, use the 'remove' argument with the VM name and the disk ID. For example, to remove the drive added above, named 0:
vm hotplug remove foo 0
To remove all hotplug devices, use ID "all" for the disk ID.
See "vm start" for a full description of allowable targets.
vm_hotplug_add(vm, filename, version=None)
¶
Variants:
vm hotplug add
Add and remove USB drives to a launched VM.
To view currently attached media, call vm hotplug with the 'show' argument and a VM name. To add a device, use the 'add' argument followed by the VM name, and the name of the file to add. For example, to add foo.img to VM foo:
vm hotplug add foo foo.img
The add command will assign a disk ID, shown in "vm hotplug". The optional parameter allows you to specify whether the drive will appear on the 1.1 or 2.0 USB bus. For USB 1.1:
vm hotplug add foo foo.img 1.1
For USB 2.0:
vm hotplug add foo foo.img 2.0
To remove media, use the 'remove' argument with the VM name and the disk ID. For example, to remove the drive added above, named 0:
vm hotplug remove foo 0
To remove all hotplug devices, use ID "all" for the disk ID.
See "vm start" for a full description of allowable targets.
vm_hotplug_add_serial(vm, filename, serial, version=None)
¶
Variants:
vm hotplug add
Add and remove USB drives to a launched VM.
To view currently attached media, call vm hotplug with the 'show' argument and a VM name. To add a device, use the 'add' argument followed by the VM name, and the name of the file to add. For example, to add foo.img to VM foo:
vm hotplug add foo foo.img
The add command will assign a disk ID, shown in "vm hotplug". The optional parameter allows you to specify whether the drive will appear on the 1.1 or 2.0 USB bus. For USB 1.1:
vm hotplug add foo foo.img 1.1
For USB 2.0:
vm hotplug add foo foo.img 2.0
To remove media, use the 'remove' argument with the VM name and the disk ID. For example, to remove the drive added above, named 0:
vm hotplug remove foo 0
To remove all hotplug devices, use ID "all" for the disk ID.
See "vm start" for a full description of allowable targets.
vm_hotplug_remove(vm, disk)
¶
Variants:
vm hotplug remove
Add and remove USB drives to a launched VM.
To view currently attached media, call vm hotplug with the 'show' argument and a VM name. To add a device, use the 'add' argument followed by the VM name, and the name of the file to add. For example, to add foo.img to VM foo:
vm hotplug add foo foo.img
The add command will assign a disk ID, shown in "vm hotplug". The optional parameter allows you to specify whether the drive will appear on the 1.1 or 2.0 USB bus. For USB 1.1:
vm hotplug add foo foo.img 1.1
For USB 2.0:
vm hotplug add foo foo.img 2.0
To remove media, use the 'remove' argument with the VM name and the disk ID. For example, to remove the drive added above, named 0:
vm hotplug remove foo 0
To remove all hotplug devices, use ID "all" for the disk ID.
See "vm start" for a full description of allowable targets.
vm_info(summary=None)
¶
Variants:
vm info
Print information about VMs in tabular form. The .filter and .columns commands can be used to subselect a set of rows and/or columns. See the help pages for .filter and .columns, respectively, for their usage. Columns returned by VM info include:
- id* : the VM ID, as an integer
- name* : the VM name, if it exists
- state* : one of (building, running, paused, quit, error)
- uptime : amount of time since the VM was launched
- namespace* : namespace the VM belongs to
- type* : one of (kvm, container, android)
- uuid* : QEMU system uuid
- cc_active* : indicates whether cc is connected
- vcpus : the number of allocated CPUs
- memory : allocated memory, in megabytes
- vlan* : vlan, as an integer
- bridge : bridge name
- tap : tap name
- mac : mac address
- ip : IPv4 address
- ip6 : IPv6 address
- bandwidth : stats regarding bandwidth usage
- qos : quality-of-service constraints on network interfaces
- tags : any additional information attached to the VM
Additional fields are available for KVM-based VMs:
- append : kernel command line string
- cdrom : cdrom image
- disk : disk image
- kernel : kernel image
- initrd : initrd image
- save : info about if the VM was saved
- pid : pid of qemu process
- serial : number of serial ports
- virtio-serial : number of virtio ports
- vnc_port : port for VNC shim
- usb-use-xhci : usb controller (true = xhci; false = ehci)
- tpm-socket : path of emulated tpm socket
Additional fields are available for container-based VMs:
- filesystem : root filesystem for the container
- hostname : hostname of the container
- init : process to invoke as init
- preinit : process to invoke at container launch before isolation
- pid : pid of container's init process
- fifo : number of fifo devices
- console_port : port for console shim
Additional fields are available for Android VMs:
- android_avd : Android Virtual Device name
- android_console_port : Android emulator console port
- android_adb_port : Android emulator adb port
- android_serial : adb serial name, e.g. emulator-5554
- pid : pid of Android emulator process
The optional summary flag limits the columns to those denoted with a '*'.
Examples:
Display a list of all IPs for all VMs: .columns ip,ip6 vm info
Display information about all VMs: vm info
vm_kill(vm)
¶
Variants:
vm kill
Kill one or more running virtual machines. See "vm start" for a full description of allowable targets.
vm_launch()
¶
Variants: vm launch
Launch virtual machines in a paused state, using the parameters defined leading up to the launch command. Any changes to the VM parameters after launching will have no effect on launched VMs.
When you launch a VM, you supply the type of VM in the launch command. The supported VM types are:
- kvm : QEMU-based vms
- container: Linux containers
- android : Android emulator-based VMs
If you supply a name instead of a number of VMs, one VM with that name will be launched. You may also supply a range expression to launch VMs with a specific naming scheme:
vm launch kvm foo[0-9]
Note: VM names cannot be integers or reserved words (e.g. "all").
Users may specify a saved config explicitly rather than use the current one, for example:
vm config save endpoint
[other commands]
vm launch kvm 5 endpoint
If queueing is enabled (see "ns"), VMs will be queued for launching until "vm launch" is called with no additional arguments. This allows the scheduler to better allocate resources across the cluster.
Android VMs use host-side emulator console/ADB port pairs. minimega currently uses 64 valid port pairs per host, so each host can run at most 64 Android VMs concurrently, and fewer if some of those ports are already in use.
vm_launch_android(name, config=None)
¶
Variants:
vm launch android
Launch virtual machines in a paused state, using the parameters defined leading up to the launch command. Any changes to the VM parameters after launching will have no effect on launched VMs.
When you launch a VM, you supply the type of VM in the launch command. The supported VM types are:
- kvm : QEMU-based vms
- container: Linux containers
- android : Android emulator-based VMs
If you supply a name instead of a number of VMs, one VM with that name will be launched. You may also supply a range expression to launch VMs with a specific naming scheme:
vm launch kvm foo[0-9]
Note: VM names cannot be integers or reserved words (e.g. "all").
Users may specify a saved config explicitly rather than use the current one, for example:
vm config save endpoint
[other commands]
vm launch kvm 5 endpoint
If queueing is enabled (see "ns"), VMs will be queued for launching until "vm launch" is called with no additional arguments. This allows the scheduler to better allocate resources across the cluster.
Android VMs use host-side emulator console/ADB port pairs. minimega currently uses 64 valid port pairs per host, so each host can run at most 64 Android VMs concurrently, and fewer if some of those ports are already in use.
vm_launch_container(name, config=None)
¶
Variants:
vm launch container
Launch virtual machines in a paused state, using the parameters defined leading up to the launch command. Any changes to the VM parameters after launching will have no effect on launched VMs.
When you launch a VM, you supply the type of VM in the launch command. The supported VM types are:
- kvm : QEMU-based vms
- container: Linux containers
- android : Android emulator-based VMs
If you supply a name instead of a number of VMs, one VM with that name will be launched. You may also supply a range expression to launch VMs with a specific naming scheme:
vm launch kvm foo[0-9]
Note: VM names cannot be integers or reserved words (e.g. "all").
Users may specify a saved config explicitly rather than use the current one, for example:
vm config save endpoint
[other commands]
vm launch kvm 5 endpoint
If queueing is enabled (see "ns"), VMs will be queued for launching until "vm launch" is called with no additional arguments. This allows the scheduler to better allocate resources across the cluster.
Android VMs use host-side emulator console/ADB port pairs. minimega currently uses 64 valid port pairs per host, so each host can run at most 64 Android VMs concurrently, and fewer if some of those ports are already in use.
vm_launch_kvm(name, config=None)
¶
Variants:
vm launch kvm
Launch virtual machines in a paused state, using the parameters defined leading up to the launch command. Any changes to the VM parameters after launching will have no effect on launched VMs.
When you launch a VM, you supply the type of VM in the launch command. The supported VM types are:
- kvm : QEMU-based vms
- container: Linux containers
- android : Android emulator-based VMs
If you supply a name instead of a number of VMs, one VM with that name will be launched. You may also supply a range expression to launch VMs with a specific naming scheme:
vm launch kvm foo[0-9]
Note: VM names cannot be integers or reserved words (e.g. "all").
Users may specify a saved config explicitly rather than use the current one, for example:
vm config save endpoint
[other commands]
vm launch kvm 5 endpoint
If queueing is enabled (see "ns"), VMs will be queued for launching until "vm launch" is called with no additional arguments. This allows the scheduler to better allocate resources across the cluster.
Android VMs use host-side emulator console/ADB port pairs. minimega currently uses 64 valid port pairs per host, so each host can run at most 64 Android VMs concurrently, and fewer if some of those ports are already in use.
vm_migrate(vm=None, filename=None)
¶
Variants:
vm migrate
DEPRECATED: Use 'vm save' - Migrate runtime state of a VM to disk, which can later be booted with vm config migrate. Migration files are written to the files directory as specified with -filepath. On success, a call to migrate a VM will return immediately. You can check the status of in-flight migrations by invoking vm migrate with no arguments.
vm_net_add(vm, netspec=None)
¶
Variants:
vm net add
Add, disconnect, or move existing network connections for one or more VMs. See "vm start" for a full description of allowable targets.
To add a network connection, you can specify the same options as you do when you add connections via vm config when launching VMs. See "vm config net" for more details.
You will need to specify the VLAN of which the interface is a member. Optionally, you may specify the bridge the interface will be connected on. You may also specify a MAC address for the interface. Finally, you may also specify the network device for qemu to use. By default, "e1000" is used for KVM and "virtio-net-pci" is used for Android VMs. The order is:
<bridge>,<VLAN>,<MAC>,<driver>
So to add an interface to a vm called vm-0 that is a member of VLAN 100, with a specified MAC address, you can use:
vm net add vm-0 100,00:00:00:00:00:00
Network connections are indicated by their position in vm net (same order in vm info) and are zero indexed. For example, to disconnect the first network connection from a VM named vm-0:
vm net disconnect vm-0 0
To disconnect the second interface:
vm net disconnect vm-0 1
To move a connection, specify the interface number, the new VLAN tag and optional bridge:
vm net vm-0 0 100 mega_bridge
If the bridge name is omitted, the interface will be reconnected to the same bridge that it is already on. If the interface is not connected to a bridge, it will be connected to the default bridge, "mega_bridge".
For Android VMs, vm net connect/disconnect operates on the host-side minimega tap attached to the Android Emulator backend NIC. It does not configure Android guest IP addresses, policy routing, or firewall rules.
For runtime Android NIC hot-add, the host-side tap and QEMU device are added by minimega, but the Android guest may not automatically enumerate the new PCI device. A guest-side PCI rescan and interface configuration may be required, for example writing 1 to /sys/bus/pci/rescan and then configuring the new interface.
To create a bond comprised of two or more interfaces on a VM, use 'vm net bond'. For example, to create an 'active-backup' bond with interfaces 1 and 2 on VM foo with LACP set to active:
vm net bond foo 1,2 active-backup active
There are three bond modes supported: active-backup, balance-slb, and balance-tcp, and three LACP modes supported: active, passive, and off. To disable the bond if LACP negotiation fails instead of falling back to active-backup mode, provide the 'no-lacp-fallback' option.
Bonds can also be configured in "dot1q-tunnel" mode (QinQ) in OVS with the "qinq" option. If configured in "dot1q-tunnel" mode, the outer VLAN tag will be set to the VLAN the bonded interfaces originally belonged to. Note that a bond will also be configured in "dot1q-tunnel" mode if at least one of the bonded interfaces was configured in "dot1q-tunnel" mode, even without the "qinq" option.
vm_net_bond(vm, interface, active_backup_or_balance_slb_or_balance_tcp, active_or_passive_or_off, qinq=None)
¶
Variants:
vm net bond
Add, disconnect, or move existing network connections for one or more VMs. See "vm start" for a full description of allowable targets.
To add a network connection, you can specify the same options as you do when you add connections via vm config when launching VMs. See "vm config net" for more details.
You will need to specify the VLAN of which the interface is a member. Optionally, you may specify the bridge the interface will be connected on. You may also specify a MAC address for the interface. Finally, you may also specify the network device for qemu to use. By default, "e1000" is used for KVM and "virtio-net-pci" is used for Android VMs. The order is:
<bridge>,<VLAN>,<MAC>,<driver>
So to add an interface to a vm called vm-0 that is a member of VLAN 100, with a specified MAC address, you can use:
vm net add vm-0 100,00:00:00:00:00:00
Network connections are indicated by their position in vm net (same order in vm info) and are zero indexed. For example, to disconnect the first network connection from a VM named vm-0:
vm net disconnect vm-0 0
To disconnect the second interface:
vm net disconnect vm-0 1
To move a connection, specify the interface number, the new VLAN tag and optional bridge:
vm net vm-0 0 100 mega_bridge
If the bridge name is omitted, the interface will be reconnected to the same bridge that it is already on. If the interface is not connected to a bridge, it will be connected to the default bridge, "mega_bridge".
For Android VMs, vm net connect/disconnect operates on the host-side minimega tap attached to the Android Emulator backend NIC. It does not configure Android guest IP addresses, policy routing, or firewall rules.
For runtime Android NIC hot-add, the host-side tap and QEMU device are added by minimega, but the Android guest may not automatically enumerate the new PCI device. A guest-side PCI rescan and interface configuration may be required, for example writing 1 to /sys/bus/pci/rescan and then configuring the new interface.
To create a bond comprised of two or more interfaces on a VM, use 'vm net bond'. For example, to create an 'active-backup' bond with interfaces 1 and 2 on VM foo with LACP set to active:
vm net bond foo 1,2 active-backup active
There are three bond modes supported: active-backup, balance-slb, and balance-tcp, and three LACP modes supported: active, passive, and off. To disable the bond if LACP negotiation fails instead of falling back to active-backup mode, provide the 'no-lacp-fallback' option.
Bonds can also be configured in "dot1q-tunnel" mode (QinQ) in OVS with the "qinq" option. If configured in "dot1q-tunnel" mode, the outer VLAN tag will be set to the VLAN the bonded interfaces originally belonged to. Note that a bond will also be configured in "dot1q-tunnel" mode if at least one of the bonded interfaces was configured in "dot1q-tunnel" mode, even without the "qinq" option.
vm_net_bond_name(vm, interface, active_backup_or_balance_slb_or_balance_tcp, active_or_passive_or_off, name, qinq=None)
¶
Variants:
vm net bond
Add, disconnect, or move existing network connections for one or more VMs. See "vm start" for a full description of allowable targets.
To add a network connection, you can specify the same options as you do when you add connections via vm config when launching VMs. See "vm config net" for more details.
You will need to specify the VLAN of which the interface is a member. Optionally, you may specify the bridge the interface will be connected on. You may also specify a MAC address for the interface. Finally, you may also specify the network device for qemu to use. By default, "e1000" is used for KVM and "virtio-net-pci" is used for Android VMs. The order is:
<bridge>,<VLAN>,<MAC>,<driver>
So to add an interface to a vm called vm-0 that is a member of VLAN 100, with a specified MAC address, you can use:
vm net add vm-0 100,00:00:00:00:00:00
Network connections are indicated by their position in vm net (same order in vm info) and are zero indexed. For example, to disconnect the first network connection from a VM named vm-0:
vm net disconnect vm-0 0
To disconnect the second interface:
vm net disconnect vm-0 1
To move a connection, specify the interface number, the new VLAN tag and optional bridge:
vm net vm-0 0 100 mega_bridge
If the bridge name is omitted, the interface will be reconnected to the same bridge that it is already on. If the interface is not connected to a bridge, it will be connected to the default bridge, "mega_bridge".
For Android VMs, vm net connect/disconnect operates on the host-side minimega tap attached to the Android Emulator backend NIC. It does not configure Android guest IP addresses, policy routing, or firewall rules.
For runtime Android NIC hot-add, the host-side tap and QEMU device are added by minimega, but the Android guest may not automatically enumerate the new PCI device. A guest-side PCI rescan and interface configuration may be required, for example writing 1 to /sys/bus/pci/rescan and then configuring the new interface.
To create a bond comprised of two or more interfaces on a VM, use 'vm net bond'. For example, to create an 'active-backup' bond with interfaces 1 and 2 on VM foo with LACP set to active:
vm net bond foo 1,2 active-backup active
There are three bond modes supported: active-backup, balance-slb, and balance-tcp, and three LACP modes supported: active, passive, and off. To disable the bond if LACP negotiation fails instead of falling back to active-backup mode, provide the 'no-lacp-fallback' option.
Bonds can also be configured in "dot1q-tunnel" mode (QinQ) in OVS with the "qinq" option. If configured in "dot1q-tunnel" mode, the outer VLAN tag will be set to the VLAN the bonded interfaces originally belonged to. Note that a bond will also be configured in "dot1q-tunnel" mode if at least one of the bonded interfaces was configured in "dot1q-tunnel" mode, even without the "qinq" option.
vm_net_bond_no_lacp_fallback(vm, interface, active_backup_or_balance_slb_or_balance_tcp, active_or_passive, qinq=None)
¶
Variants:
vm net bond
Add, disconnect, or move existing network connections for one or more VMs. See "vm start" for a full description of allowable targets.
To add a network connection, you can specify the same options as you do when you add connections via vm config when launching VMs. See "vm config net" for more details.
You will need to specify the VLAN of which the interface is a member. Optionally, you may specify the bridge the interface will be connected on. You may also specify a MAC address for the interface. Finally, you may also specify the network device for qemu to use. By default, "e1000" is used for KVM and "virtio-net-pci" is used for Android VMs. The order is:
<bridge>,<VLAN>,<MAC>,<driver>
So to add an interface to a vm called vm-0 that is a member of VLAN 100, with a specified MAC address, you can use:
vm net add vm-0 100,00:00:00:00:00:00
Network connections are indicated by their position in vm net (same order in vm info) and are zero indexed. For example, to disconnect the first network connection from a VM named vm-0:
vm net disconnect vm-0 0
To disconnect the second interface:
vm net disconnect vm-0 1
To move a connection, specify the interface number, the new VLAN tag and optional bridge:
vm net vm-0 0 100 mega_bridge
If the bridge name is omitted, the interface will be reconnected to the same bridge that it is already on. If the interface is not connected to a bridge, it will be connected to the default bridge, "mega_bridge".
For Android VMs, vm net connect/disconnect operates on the host-side minimega tap attached to the Android Emulator backend NIC. It does not configure Android guest IP addresses, policy routing, or firewall rules.
For runtime Android NIC hot-add, the host-side tap and QEMU device are added by minimega, but the Android guest may not automatically enumerate the new PCI device. A guest-side PCI rescan and interface configuration may be required, for example writing 1 to /sys/bus/pci/rescan and then configuring the new interface.
To create a bond comprised of two or more interfaces on a VM, use 'vm net bond'. For example, to create an 'active-backup' bond with interfaces 1 and 2 on VM foo with LACP set to active:
vm net bond foo 1,2 active-backup active
There are three bond modes supported: active-backup, balance-slb, and balance-tcp, and three LACP modes supported: active, passive, and off. To disable the bond if LACP negotiation fails instead of falling back to active-backup mode, provide the 'no-lacp-fallback' option.
Bonds can also be configured in "dot1q-tunnel" mode (QinQ) in OVS with the "qinq" option. If configured in "dot1q-tunnel" mode, the outer VLAN tag will be set to the VLAN the bonded interfaces originally belonged to. Note that a bond will also be configured in "dot1q-tunnel" mode if at least one of the bonded interfaces was configured in "dot1q-tunnel" mode, even without the "qinq" option.
vm_net_bond_no_lacp_fallback_name(vm, interface, active_backup_or_balance_slb_or_balance_tcp, active_or_passive, name, qinq=None)
¶
Variants:
vm net bond
Add, disconnect, or move existing network connections for one or more VMs. See "vm start" for a full description of allowable targets.
To add a network connection, you can specify the same options as you do when you add connections via vm config when launching VMs. See "vm config net" for more details.
You will need to specify the VLAN of which the interface is a member. Optionally, you may specify the bridge the interface will be connected on. You may also specify a MAC address for the interface. Finally, you may also specify the network device for qemu to use. By default, "e1000" is used for KVM and "virtio-net-pci" is used for Android VMs. The order is:
<bridge>,<VLAN>,<MAC>,<driver>
So to add an interface to a vm called vm-0 that is a member of VLAN 100, with a specified MAC address, you can use:
vm net add vm-0 100,00:00:00:00:00:00
Network connections are indicated by their position in vm net (same order in vm info) and are zero indexed. For example, to disconnect the first network connection from a VM named vm-0:
vm net disconnect vm-0 0
To disconnect the second interface:
vm net disconnect vm-0 1
To move a connection, specify the interface number, the new VLAN tag and optional bridge:
vm net vm-0 0 100 mega_bridge
If the bridge name is omitted, the interface will be reconnected to the same bridge that it is already on. If the interface is not connected to a bridge, it will be connected to the default bridge, "mega_bridge".
For Android VMs, vm net connect/disconnect operates on the host-side minimega tap attached to the Android Emulator backend NIC. It does not configure Android guest IP addresses, policy routing, or firewall rules.
For runtime Android NIC hot-add, the host-side tap and QEMU device are added by minimega, but the Android guest may not automatically enumerate the new PCI device. A guest-side PCI rescan and interface configuration may be required, for example writing 1 to /sys/bus/pci/rescan and then configuring the new interface.
To create a bond comprised of two or more interfaces on a VM, use 'vm net bond'. For example, to create an 'active-backup' bond with interfaces 1 and 2 on VM foo with LACP set to active:
vm net bond foo 1,2 active-backup active
There are three bond modes supported: active-backup, balance-slb, and balance-tcp, and three LACP modes supported: active, passive, and off. To disable the bond if LACP negotiation fails instead of falling back to active-backup mode, provide the 'no-lacp-fallback' option.
Bonds can also be configured in "dot1q-tunnel" mode (QinQ) in OVS with the "qinq" option. If configured in "dot1q-tunnel" mode, the outer VLAN tag will be set to the VLAN the bonded interfaces originally belonged to. Note that a bond will also be configured in "dot1q-tunnel" mode if at least one of the bonded interfaces was configured in "dot1q-tunnel" mode, even without the "qinq" option.
vm_net_connect(vm, tap, vlan, bridge=None)
¶
Variants:
vm net connect
Add, disconnect, or move existing network connections for one or more VMs. See "vm start" for a full description of allowable targets.
To add a network connection, you can specify the same options as you do when you add connections via vm config when launching VMs. See "vm config net" for more details.
You will need to specify the VLAN of which the interface is a member. Optionally, you may specify the bridge the interface will be connected on. You may also specify a MAC address for the interface. Finally, you may also specify the network device for qemu to use. By default, "e1000" is used for KVM and "virtio-net-pci" is used for Android VMs. The order is:
<bridge>,<VLAN>,<MAC>,<driver>
So to add an interface to a vm called vm-0 that is a member of VLAN 100, with a specified MAC address, you can use:
vm net add vm-0 100,00:00:00:00:00:00
Network connections are indicated by their position in vm net (same order in vm info) and are zero indexed. For example, to disconnect the first network connection from a VM named vm-0:
vm net disconnect vm-0 0
To disconnect the second interface:
vm net disconnect vm-0 1
To move a connection, specify the interface number, the new VLAN tag and optional bridge:
vm net vm-0 0 100 mega_bridge
If the bridge name is omitted, the interface will be reconnected to the same bridge that it is already on. If the interface is not connected to a bridge, it will be connected to the default bridge, "mega_bridge".
For Android VMs, vm net connect/disconnect operates on the host-side minimega tap attached to the Android Emulator backend NIC. It does not configure Android guest IP addresses, policy routing, or firewall rules.
For runtime Android NIC hot-add, the host-side tap and QEMU device are added by minimega, but the Android guest may not automatically enumerate the new PCI device. A guest-side PCI rescan and interface configuration may be required, for example writing 1 to /sys/bus/pci/rescan and then configuring the new interface.
To create a bond comprised of two or more interfaces on a VM, use 'vm net bond'. For example, to create an 'active-backup' bond with interfaces 1 and 2 on VM foo with LACP set to active:
vm net bond foo 1,2 active-backup active
There are three bond modes supported: active-backup, balance-slb, and balance-tcp, and three LACP modes supported: active, passive, and off. To disable the bond if LACP negotiation fails instead of falling back to active-backup mode, provide the 'no-lacp-fallback' option.
Bonds can also be configured in "dot1q-tunnel" mode (QinQ) in OVS with the "qinq" option. If configured in "dot1q-tunnel" mode, the outer VLAN tag will be set to the VLAN the bonded interfaces originally belonged to. Note that a bond will also be configured in "dot1q-tunnel" mode if at least one of the bonded interfaces was configured in "dot1q-tunnel" mode, even without the "qinq" option.
vm_net_disconnect(vm, tap)
¶
Variants:
vm net disconnect
Add, disconnect, or move existing network connections for one or more VMs. See "vm start" for a full description of allowable targets.
To add a network connection, you can specify the same options as you do when you add connections via vm config when launching VMs. See "vm config net" for more details.
You will need to specify the VLAN of which the interface is a member. Optionally, you may specify the bridge the interface will be connected on. You may also specify a MAC address for the interface. Finally, you may also specify the network device for qemu to use. By default, "e1000" is used for KVM and "virtio-net-pci" is used for Android VMs. The order is:
<bridge>,<VLAN>,<MAC>,<driver>
So to add an interface to a vm called vm-0 that is a member of VLAN 100, with a specified MAC address, you can use:
vm net add vm-0 100,00:00:00:00:00:00
Network connections are indicated by their position in vm net (same order in vm info) and are zero indexed. For example, to disconnect the first network connection from a VM named vm-0:
vm net disconnect vm-0 0
To disconnect the second interface:
vm net disconnect vm-0 1
To move a connection, specify the interface number, the new VLAN tag and optional bridge:
vm net vm-0 0 100 mega_bridge
If the bridge name is omitted, the interface will be reconnected to the same bridge that it is already on. If the interface is not connected to a bridge, it will be connected to the default bridge, "mega_bridge".
For Android VMs, vm net connect/disconnect operates on the host-side minimega tap attached to the Android Emulator backend NIC. It does not configure Android guest IP addresses, policy routing, or firewall rules.
For runtime Android NIC hot-add, the host-side tap and QEMU device are added by minimega, but the Android guest may not automatically enumerate the new PCI device. A guest-side PCI rescan and interface configuration may be required, for example writing 1 to /sys/bus/pci/rescan and then configuring the new interface.
To create a bond comprised of two or more interfaces on a VM, use 'vm net bond'. For example, to create an 'active-backup' bond with interfaces 1 and 2 on VM foo with LACP set to active:
vm net bond foo 1,2 active-backup active
There are three bond modes supported: active-backup, balance-slb, and balance-tcp, and three LACP modes supported: active, passive, and off. To disable the bond if LACP negotiation fails instead of falling back to active-backup mode, provide the 'no-lacp-fallback' option.
Bonds can also be configured in "dot1q-tunnel" mode (QinQ) in OVS with the "qinq" option. If configured in "dot1q-tunnel" mode, the outer VLAN tag will be set to the VLAN the bonded interfaces originally belonged to. Note that a bond will also be configured in "dot1q-tunnel" mode if at least one of the bonded interfaces was configured in "dot1q-tunnel" mode, even without the "qinq" option.
vm_qmp(vm, qmp)
¶
Variants:
vm qmp
Issue a JSON-encoded QMP command. This is a convenience function for accessing the QMP socket of a VM via minimega. vm qmp takes two arguments, a VM name, and a JSON string, and returns the JSON encoded response. For example:
vm qmp 0 '{ "execute": "query-status" }'
{"return":{"running":false,"singlestep":false,"status":"prelaunch"}}
vm_save(vm=None, filename=None)
¶
Variants:
vm save
Save runtime state and disk of a VM to files, which can later be booted with 'vm config state ...' and 'vm config disk ...', respectively. The state file will likely have a dependency with the corresponding disk snapshot image.
State/RAM and disk files are written to the files directory based on the name of the VM
or as specified with
Note: This will overwrite any prior saved files.
Note: vm save is currently supported for KVM VMs only. Android VM save is not supported because Android Emulator snapshot/AVD state is managed separately from minimega's KVM migration state.
vm_screenshot(vm, maximum=None)
¶
Variants:
vm screenshot
Take a screenshot of the framebuffer of a running VM. The screenshot is saved
in PNG format as "screenshot.png" in the VM's runtime directory (by default
/tmp/minimega/
An optional argument sets the maximum dimensions in pixels, while keeping the aspect ratio. For example, to set either maximum dimension of the output image to 100 pixels:
vm screenshot foo 100
The screenshot can be saved elsewhere like this:
vm screenshot foo file /tmp/foo.png
You can also specify the maximum dimension:
vm screenshot foo file /tmp/foo.png 100
vm_screenshot_file(vm, filename, maximum=None)
¶
Variants:
vm screenshot
Take a screenshot of the framebuffer of a running VM. The screenshot is saved
in PNG format as "screenshot.png" in the VM's runtime directory (by default
/tmp/minimega/
An optional argument sets the maximum dimensions in pixels, while keeping the aspect ratio. For example, to set either maximum dimension of the output image to 100 pixels:
vm screenshot foo 100
The screenshot can be saved elsewhere like this:
vm screenshot foo file /tmp/foo.png
You can also specify the maximum dimension:
vm screenshot foo file /tmp/foo.png 100
vm_serial(vm, port=None, milliseconds=None, bytes=None)
¶
Variants:
vm serial
Connect to a VM's QEMU serial socket and return output for a bounded interval. This is intended for firmware and recovery consoles that do not expose VNC. The default port is 0, the default read interval is 750 milliseconds, and the default output limit is 65536 bytes. The maximum interval is 5000 milliseconds and the maximum output is 1048576 bytes.
Examples:
vm serial freertos
vm serial freertos 0 1500 131072
vm_snapshot(vm=None, state=None, disk=None)
¶
Variants:
vm snapshot
DEPRECATED: Use 'vm save' - Write VM state (migrate) and disk to file, which can later be booted with 'vm config migrate ...' and 'vm config disk ...', respectively. Saved migrate and disk files are written to the files directory as specified with -filepath. On success, a call to snapshot a VM will return immediately. You can check the status of in-flight snapshots by invoking vm snapshot with no arguments.
vm_start(vm)
¶
Variants:
vm start
Start one or more paused virtual machines. VMs may be selected by name, range, or wildcard. For example,
To start vm foo:
vm start foo
To start vms foo and bar:
vm start foo,bar
To start vms foo0, foo1, foo2, and foo5:
vm start foo[0-2,5]
There is also a wildcard (all) which allows the user to specify all VMs:
vm start all
Note that including the wildcard in a list of VMs results in the wildcard behavior (although a message will be logged).
Calling "vm start" on a specific list of VMs will cause them to be started if they are in the building, paused, quit, or error states. When used with the wildcard, only vms in the building or paused state will be started.
vm_stop(vm)
¶
Variants:
vm stop
Stop one or more running virtual machines. See "vm start" for a full description of allowable targets.
Calling stop will put VMs in a paused state. Use "vm start" to restart them.
vm_tag(vm, key=None, value=None)
¶
Variants:
vm tag
Display or set a tag for one or more virtual machines. See "vm start" for a full description of allowable targets.
Tags are key-value pairs. A VM can have any number of tags associated with it. They can be used to attach additional information to a virtual machine, for example specifying a VM "group", or the correct rendering color for some external visualization tool.
To set a tag "foo" to "bar" for VM 2:
vm tag 2 foo bar
To read a tag:
vm tag <vm target> <key or all>
vm_top(duration=None)
¶
Variants:
vm top
View system resource utilization per VM. This is measured from the host and may differ from what is reported by the guest.
The optional duration specifies the length of the sampling window in seconds. The command will block for at least this long while it measures usage. The default duration is one second.
Returned columns include: - name : name of the VM - namespace : namespace of the VM (when not in a namespace) - virt : virtual memory size (MB) - res : resident memory size (MB) - shr : shared memory size (MB) - cpu : host CPU usage (%) - vcpu : guest CPU usage (%) (KVM only) - time : total CPU time - procs : number of processes inspected (limited to 100) - rx : total received data rate (MB/s) - tx : total transmitted data rate (MB/s)
vnc()
¶
Variants: vnc
List all running vnc playback/recording instances. See "help vnc" for more information.
vnc_continue(vm)
¶
Variants:
vnc continue
Playback and interact with a previously recorded vnc kb session file.
If play is selected, the specified file (created using vnc record) will be read and processed as a sequence of time-stamped mouse/keyboard events to send to the specified VM(s). See "vm start" for a full description of the allowable targets. VMs without a valid playback that are part of the target will return a "kb playback not found" error.
Playbacks can be paused with the pause command, and resumed using continue. The step command will immediately move to the next event contained in the playback file. Use the getstep command to view the current vnc event. Calling stop will end a playback.
VNC playback also supports injecting mouse/keyboard events in the format found in the playback file. Injected commands must omit the time delta as they are sent immediately:
vnc inject vm-0 PointerEvent,0,465,245
New playback files can be injected as well:
vnc inject vm-0 LoadFile,foo.kb
Comments in the playback file are logged at the info level. An example is given below.
: This is an example of a vnc playback comment¶
vnc_getstep(vm)
¶
Variants:
vnc getstep
Playback and interact with a previously recorded vnc kb session file.
If play is selected, the specified file (created using vnc record) will be read and processed as a sequence of time-stamped mouse/keyboard events to send to the specified VM(s). See "vm start" for a full description of the allowable targets. VMs without a valid playback that are part of the target will return a "kb playback not found" error.
Playbacks can be paused with the pause command, and resumed using continue. The step command will immediately move to the next event contained in the playback file. Use the getstep command to view the current vnc event. Calling stop will end a playback.
VNC playback also supports injecting mouse/keyboard events in the format found in the playback file. Injected commands must omit the time delta as they are sent immediately:
vnc inject vm-0 PointerEvent,0,465,245
New playback files can be injected as well:
vnc inject vm-0 LoadFile,foo.kb
Comments in the playback file are logged at the info level. An example is given below.
: This is an example of a vnc playback comment¶
vnc_inject(vm, cmd)
¶
Variants:
vnc inject
Playback and interact with a previously recorded vnc kb session file.
If play is selected, the specified file (created using vnc record) will be read and processed as a sequence of time-stamped mouse/keyboard events to send to the specified VM(s). See "vm start" for a full description of the allowable targets. VMs without a valid playback that are part of the target will return a "kb playback not found" error.
Playbacks can be paused with the pause command, and resumed using continue. The step command will immediately move to the next event contained in the playback file. Use the getstep command to view the current vnc event. Calling stop will end a playback.
VNC playback also supports injecting mouse/keyboard events in the format found in the playback file. Injected commands must omit the time delta as they are sent immediately:
vnc inject vm-0 PointerEvent,0,465,245
New playback files can be injected as well:
vnc inject vm-0 LoadFile,foo.kb
Comments in the playback file are logged at the info level. An example is given below.
: This is an example of a vnc playback comment¶
vnc_pause(vm)
¶
Variants:
vnc pause
Playback and interact with a previously recorded vnc kb session file.
If play is selected, the specified file (created using vnc record) will be read and processed as a sequence of time-stamped mouse/keyboard events to send to the specified VM(s). See "vm start" for a full description of the allowable targets. VMs without a valid playback that are part of the target will return a "kb playback not found" error.
Playbacks can be paused with the pause command, and resumed using continue. The step command will immediately move to the next event contained in the playback file. Use the getstep command to view the current vnc event. Calling stop will end a playback.
VNC playback also supports injecting mouse/keyboard events in the format found in the playback file. Injected commands must omit the time delta as they are sent immediately:
vnc inject vm-0 PointerEvent,0,465,245
New playback files can be injected as well:
vnc inject vm-0 LoadFile,foo.kb
Comments in the playback file are logged at the info level. An example is given below.
: This is an example of a vnc playback comment¶
vnc_play(vm, filename)
¶
Variants:
vnc play
Playback and interact with a previously recorded vnc kb session file.
If play is selected, the specified file (created using vnc record) will be read and processed as a sequence of time-stamped mouse/keyboard events to send to the specified VM(s). See "vm start" for a full description of the allowable targets. VMs without a valid playback that are part of the target will return a "kb playback not found" error.
Playbacks can be paused with the pause command, and resumed using continue. The step command will immediately move to the next event contained in the playback file. Use the getstep command to view the current vnc event. Calling stop will end a playback.
VNC playback also supports injecting mouse/keyboard events in the format found in the playback file. Injected commands must omit the time delta as they are sent immediately:
vnc inject vm-0 PointerEvent,0,465,245
New playback files can be injected as well:
vnc inject vm-0 LoadFile,foo.kb
Comments in the playback file are logged at the info level. An example is given below.
: This is an example of a vnc playback comment¶
vnc_record(kb_or_fb, vm, filename)
¶
Variants:
vnc record
Record keyboard and mouse events sent via the web interface to the selected VM. Can also record the framebuffer for the specified VM so that a user can watch a video of interactions with the VM.
If record is selected, a file will be created containing a record of mouse and keyboard actions by the user or of the framebuffer for the VM.
Note: recordings are written to the host where the VM is running.
vnc_step(vm)
¶
Variants:
vnc step
Playback and interact with a previously recorded vnc kb session file.
If play is selected, the specified file (created using vnc record) will be read and processed as a sequence of time-stamped mouse/keyboard events to send to the specified VM(s). See "vm start" for a full description of the allowable targets. VMs without a valid playback that are part of the target will return a "kb playback not found" error.
Playbacks can be paused with the pause command, and resumed using continue. The step command will immediately move to the next event contained in the playback file. Use the getstep command to view the current vnc event. Calling stop will end a playback.
VNC playback also supports injecting mouse/keyboard events in the format found in the playback file. Injected commands must omit the time delta as they are sent immediately:
vnc inject vm-0 PointerEvent,0,465,245
New playback files can be injected as well:
vnc inject vm-0 LoadFile,foo.kb
Comments in the playback file are logged at the info level. An example is given below.
: This is an example of a vnc playback comment¶
vnc_stop(vm, kb_or_fb=None)
¶
Variants:
vnc stop
Record keyboard and mouse events sent via the web interface to the selected VM. Can also record the framebuffer for the specified VM so that a user can watch a video of interactions with the VM.
If record is selected, a file will be created containing a record of mouse and keyboard actions by the user or of the framebuffer for the VM.
Note: recordings are written to the host where the VM is running.
vnc_type(vm, str)
¶
Variants:
vnc type
Playback and interact with a previously recorded vnc kb session file.
If play is selected, the specified file (created using vnc record) will be read and processed as a sequence of time-stamped mouse/keyboard events to send to the specified VM(s). See "vm start" for a full description of the allowable targets. VMs without a valid playback that are part of the target will return a "kb playback not found" error.
Playbacks can be paused with the pause command, and resumed using continue. The step command will immediately move to the next event contained in the playback file. Use the getstep command to view the current vnc event. Calling stop will end a playback.
VNC playback also supports injecting mouse/keyboard events in the format found in the playback file. Injected commands must omit the time delta as they are sent immediately:
vnc inject vm-0 PointerEvent,0,465,245
New playback files can be injected as well:
vnc inject vm-0 LoadFile,foo.kb
Comments in the playback file are logged at the info level. An example is given below.
: This is an example of a vnc playback comment¶
write(file)
¶
Variants:
write
Write the command history to file. This is useful for handcrafting configs on the minimega command line and then saving them for later use.
as_dict(resp)
¶
as_dict converts a minimega Header/Tabular response into a list of dictionaries.
connect(path='/tmp/minimega/minimega', raise_errors=True, debug=False, namespace=None)
¶
Connect to the minimega instance with UNIX socket at
discard(mm)
¶
discard streams responses from minimega until there are none left
print_rows(resps)
¶
print_rows walks the response from minimega and prints all tabular data.