salt.modules.vboxmanage module

Support for VirtualBox using the VBoxManage command

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:

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

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

salt.modules.vboxmanage.list_nodes_full()

Return a list of registered VMs, with detailed information

salt.modules.vboxmanage.list_nodes_min()

Return a list of registered VMs, with minimal information

salt.modules.vboxmanage.list_ostypes()

List the available OS Types

salt.modules.vboxmanage.register(filename)

Register a VM

salt.modules.vboxmanage.start(name)

Start a VM

salt.modules.vboxmanage.stop(name)

Stop a VM

salt.modules.vboxmanage.unregister(name, delete=False)

Unregister a VM

salt.modules.vboxmanage.vboxcmd()

Return the location of the VBoxManage command