Documentation ¶
Index ¶
- type Runner
- type RunnerOption
- func WithAuthorizedKeys(keys ...string) RunnerOption
- func WithBMCAddr(a string) RunnerOption
- func WithConfigFS(fsys fs.FS) RunnerOption
- func WithConnectionURI(uri string) RunnerOption
- func WithMACAddressBase(mac net.HardwareAddr) RunnerOption
- func WithNamePrefix(prefix string) RunnerOption
- func WithPortBase(port int) RunnerOption
- func WithPortGap(delta int) RunnerOption
- func WithStoragePool(pool string) RunnerOption
- func WithTunnelIP(ip net.IP) RunnerOption
- func WriteBMCConfig(w io.Writer) RunnerOption
- func WriteSSHConfig(w io.Writer) RunnerOption
- Bugs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner implements the topology.Runner interface using libvirt/qemu.
func NewRunner ¶
func NewRunner(opts ...RunnerOption) *Runner
NewRunner constructs a runner configured with the specified options.
type RunnerOption ¶
type RunnerOption func(*Runner)
A RunnerOption may be passed to NewRunner to customize the Runner's behaviour.
func WithAuthorizedKeys ¶
func WithAuthorizedKeys(keys ...string) RunnerOption
WithAuthorizedKeys adds the provided SSH public keys to authorized_keys for all started VMs.
func WithBMCAddr ¶
func WithBMCAddr(a string) RunnerOption
WithBMCAddr specifies the address for any created virtual BMCs to bind to.
func WithConfigFS ¶
func WithConfigFS(fsys fs.FS) RunnerOption
WithConfigFS specifies a filesystem implementation for loading config snippets requested with the node attribute config.
func WithConnectionURI ¶
func WithConnectionURI(uri string) RunnerOption
WithConnectionURI sets the connection URI used to connect to libvirtd. Defaults to "qemu:///system".
func WithMACAddressBase ¶
func WithMACAddressBase(mac net.HardwareAddr) RunnerOption
WithMACAddressBase determines the starting address for automatically assigned MAC addresses. Explicitly configured MAC addresses (left_mac/right_mac edge attributes) are unaffected by this option.
func WithNamePrefix ¶
func WithNamePrefix(prefix string) RunnerOption
WithNamePrefix configures the prefix to use when naming resources like guest domains. The default is "runtopo-".
func WithPortBase ¶
func WithPortBase(port int) RunnerOption
WithPortBase specifies the starting port for allocating UDP tunnel ports.
func WithPortGap ¶
func WithPortGap(delta int) RunnerOption
WithPortGap sets the gap left between local and remote port. It limits the maximum number of connections supported in a topology.
func WithStoragePool ¶
func WithStoragePool(pool string) RunnerOption
WithStoragePool sets the libvirt storage pool where we create volumes.
func WithTunnelIP ¶
func WithTunnelIP(ip net.IP) RunnerOption
WithTunnelIP sets the default IP address for libvirt UDP tunnels. This is used only for devices that do not have an explicit address configured (tunnelip node attribute).
func WriteBMCConfig ¶
func WriteBMCConfig(w io.Writer) RunnerOption
WriteBMCConfig configures the Runner to write to w a JSON document describing any virtual BMCs that were created.
func WriteSSHConfig ¶
func WriteSSHConfig(w io.Writer) RunnerOption
WriteSSHConfig configures the Runner to write an OpenSSH client configuration file to w. See ssh_config(5) for a description of its format.
Notes ¶
Bugs ¶
The default MAC address range matches the one used by topology_converter. It belongs to Cumulus though and we probably shouldn't use it without asking them.
File mode and group owner of created volumes is hard-coded to 0644 and gid 107, respectively.
We only support QCOW2 backing files in QCOW2 format. There's no reason we couldn't work with QCOW2 volumes backed by RAW images.