Support for VirtualBox using the VBoxManage command
New in version 2016.3.0.
If the vboxdrv
kernel module is not loaded, this module can automatically
load it by configuring autoload_vboxdrv
in /etc/salt/minion
:
autoload_vboxdrv: True
The default for this setting is False
.
virtualbox
Clone a new VM from an existing VM
CLI Example:
salt 'hypervisor' vboxmanage.clonemedium <name> <new_name>
Clone a new VM from an existing VM
CLI Example:
salt 'hypervisor' vboxmanage.clonevm <name> <new_name>
Create a new VM
CLI Example:
salt 'hypervisor' vboxmanage.create <name>
Unregister and destroy a VM
CLI Example:
salt '*' vboxmanage.destroy my_vm
Return a list of a specific type of item. The following items are available:
vms runningvms ostypes hostdvds hostfloppies intnets bridgedifs hostonlyifs natnets dhcpservers hostinfo hostcpuids hddbackends hdds dvds floppies usbhost usbfilters systemproperties extpacks groups webcams screenshotformats
CLI Example:
salt 'hypervisor' vboxmanage.items <item>
salt 'hypervisor' vboxmanage.items <item> details=True
salt 'hypervisor' vboxmanage.items <item> details=True group_by=Name
Some items do not display well, or at all, unless details
is set to
True
. By default, items are grouped by the UUID
field, but not all
items contain that field. In those cases, another field must be specified.
Return a list of registered VMs
CLI Example:
salt '*' vboxmanage.list_nodes
Return a list of registered VMs, with detailed information
CLI Example:
salt '*' vboxmanage.list_nodes_full
Return a list of registered VMs, with minimal information
CLI Example:
salt '*' vboxmanage.list_nodes_min
List the available OS Types
CLI Example:
salt '*' vboxmanage.list_ostypes
Register a VM
CLI Example:
salt '*' vboxmanage.register my_vm_filename
Start a VM
CLI Example:
salt '*' vboxmanage.start my_vm
Stop a VM
CLI Example:
salt '*' vboxmanage.stop my_vm
Unregister a VM
CLI Example:
salt '*' vboxmanage.unregister my_vm_filename
Return the location of the VBoxManage command
CLI Example:
salt '*' vboxmanage.vboxcmd