salt.modules.vboxmanage module

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.

depends

virtualbox

salt.modules.vboxmanage.clonemedium(medium, uuid_in=None, file_in=None, uuid_out=None, file_out=None, mformat=None, variant=None, existing=False, **kwargs)

Clone a new VM from an existing VM

CLI Example:

salt 'hypervisor' vboxmanage.clonemedium <name> <new_name>
salt.modules.vboxmanage.clonevm(name=None, uuid=None, new_name=None, snapshot_uuid=None, snapshot_name=None, mode='machine', options=None, basefolder=None, new_uuid=None, register=False, groups=None, **kwargs)

Clone a new VM from an existing VM

CLI Example:

salt 'hypervisor' vboxmanage.clonevm <name> <new_name>
salt.modules.vboxmanage.create(name, groups=None, ostype=None, register=True, basefolder=None, new_uuid=None, **kwargs)

Create a new VM

CLI Example:

salt 'hypervisor' vboxmanage.create <name>
salt.modules.vboxmanage.destroy(name)

Unregister and destroy a VM

CLI Example:

salt '*' vboxmanage.destroy my_vm
salt.modules.vboxmanage.list_items(item, details=False, group_by='UUID')

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.

salt.modules.vboxmanage.list_nodes()

Return a list of registered VMs

CLI Example:

salt '*' vboxmanage.list_nodes
salt.modules.vboxmanage.list_nodes_full()

Return a list of registered VMs, with detailed information

CLI Example:

salt '*' vboxmanage.list_nodes_full
salt.modules.vboxmanage.list_nodes_min()

Return a list of registered VMs, with minimal information

CLI Example:

salt '*' vboxmanage.list_nodes_min
salt.modules.vboxmanage.list_ostypes()

List the available OS Types

CLI Example:

salt '*' vboxmanage.list_ostypes
salt.modules.vboxmanage.register(filename)

Register a VM

CLI Example:

salt '*' vboxmanage.register my_vm_filename
salt.modules.vboxmanage.start(name)

Start a VM

CLI Example:

salt '*' vboxmanage.start my_vm
salt.modules.vboxmanage.stop(name)

Stop a VM

CLI Example:

salt '*' vboxmanage.stop my_vm
salt.modules.vboxmanage.unregister(name, delete=False)

Unregister a VM

CLI Example:

salt '*' vboxmanage.unregister my_vm_filename
salt.modules.vboxmanage.vboxcmd()

Return the location of the VBoxManage command

CLI Example:

salt '*' vboxmanage.vboxcmd