salt.runners.virt

Control virtual machines via Salt

salt.runners.virt.force_off(name)

Force power down the named virtual machine

salt.runners.virt.hyper_info(hyper=None)

Return information about the hypervisors connected to this master

salt.runners.virt.init(name, cpu, mem, image, hyper=None, seed=True, nic='default', install=True)

This routine is used to create a new virtual machine. This routines takes a number of options to determine what the newly created virtual machine will look like.

name
The mandatory name of the new virtual machine. The name option is also the minion id, all minions must have an id.
cpu
The number of cpus to allocate to this new virtual machine.
mem
The amount of memory to allocate tot his virtual machine. The number is interpreted in megabytes.
image
The network location of the virtual machine image, commonly a location on the salt fileserver, but http, https and ftp can also be used.
hyper
The hypervisor to use for the new virtual machine, if this is omitted Salt will automatically detect what hypervisor to use.
seed
Set to False to prevent Salt from seeding the new virtual machine.
nic
The nic profile to use, defaults to the "default" nic profile which assumes a single network interface per vm associated with the "br0" bridge on the master.
install
Set to False to prevent Salt from installing a minion on the new vm before it spins up.
salt.runners.virt.list(hyper=None, quiet=False)

List the virtual machines on each hyper, this is a simplified query, showing only the virtual machine names belonging to each hypervisor. A single hypervisor can be passed in to specify an individual hypervisor to list.

salt.runners.virt.migrate(name, target='')

Migrate a vm from one hypervisor to another. This routine will just start the migration and display information on how to look up the progress.

salt.runners.virt.next_hyper()

Return the hypervisor to use for the next autodeployed vm. This queries the available hypervisors and executes some math the determine the most "available" next hypervisor.

salt.runners.virt.pause(name)

Pause the named vm

salt.runners.virt.purge(name, delete_key=True)

Destroy the named vm

salt.runners.virt.query(hyper=None, quiet=False)

Query the virtual machines. When called without options all hypervisors are detected and a full query is returned. A single hypervisor can be passed in to specify an individual hypervisor to query.

salt.runners.virt.reset(name)

Force power down and restart an existing vm

salt.runners.virt.resume(name)

Resume a paused vm

salt.runners.virt.start(name)

Start a named virtual machine

salt.runners.virt.vm_info(name, quiet=False)

Return the information on the named vm