salt.modules.vmctl

Manage vms running on the OpenBSD VMM hypervisor using vmctl(8).

New in version 2019.2.0.

codeauthor

Jasper Lievisse Adriaanse <jasper@openbsd.org>

Note

This module requires the vmd service to be running on the OpenBSD target machine.

salt.modules.vmctl.create_disk(name, size)

Create a VMM disk with the specified name and size.

size:

Size in megabytes, or use a specifier such as M, G, T.

CLI Example:

salt '*' vmctl.create_disk /path/to/disk.img size=10G
salt.modules.vmctl.load(path)

Load additional configuration from the specified file.

path

Path to the configuration file.

CLI Example:

salt '*' vmctl.load path=/etc/vm.switches.conf
salt.modules.vmctl.reload()

Remove all stopped VMs and reload configuration from the default configuration file.

CLI Example:

salt '*' vmctl.reload
salt.modules.vmctl.reset(all=False, vms=False, switches=False)

Reset the running state of VMM or a subsystem.

all:

Reset the running state.

switches:

Reset the configured switches.

vms:

Reset and terminate all VMs.

CLI Example:

salt '*' vmctl.reset all=True
salt.modules.vmctl.start(name=None, id=None, bootpath=None, disk=None, disks=None, local_iface=False, memory=None, nics=0, switch=None)

Starts a VM defined by the specified parameters. When both a name and id are provided, the id is ignored.

name:

Name of the defined VM.

id:

VM id.

bootpath:

Path to a kernel or BIOS image to load.

disk:

Path to a single disk to use.

disks:

List of multiple disks to use.

local_iface:

Whether to add a local network interface. See "LOCAL INTERFACES" in the vmctl(8) manual page for more information.

memory:

Memory size of the VM specified in megabytes.

switch:

Add a network interface that is attached to the specified virtual switch on the host.

CLI Example:

salt '*' vmctl.start 2   # start VM with id 2
salt '*' vmctl.start name=web1 bootpath='/bsd.rd' nics=2 memory=512M disk='/disk.img'
salt.modules.vmctl.status(name=None, id=None)

List VMs running on the host, or only the VM specified by id. When both a name and id are provided, the id is ignored.

name:

Name of the defined VM.

id:

VM id.

CLI Example:

salt '*' vmctl.status           # to list all VMs
salt '*' vmctl.status name=web1 # to get a single VM
salt.modules.vmctl.stop(name=None, id=None)

Stop (terminate) the VM identified by the given id or name. When both a name and id are provided, the id is ignored.

name:

Name of the defined VM.

id:

VM id.

CLI Example:

salt '*' vmctl.stop name=alpine