salt.modules.kvm_hyper

Provide the hyper module for kvm hypervisors. This is the interface used to interact with kvm on behalf of the salt-virt interface

Required python modules: libvirt

Members

freecpu

salt.modules.kvm_hyper.freecpu()

Return an int representing the number of unallocated cpus on this hypervisor

CLI Example:

salt '*' hyper.freecpu

freemem

salt.modules.kvm_hyper.freemem()

Return an int representing the amount of memory that has not been given to virtual machines on this node

CLI Example:

salt '*' hyper.freemem

get_conf

salt.modules.kvm_hyper.get_conf(name)

Returns the xml for a given vm

CLI Example:

salt '*' hyper.get_conf <vm name>

get_disks

salt.modules.kvm_hyper.get_disks(name)

Return the disks of a named virt

CLI Example:

salt '*' hyper.get_disks <vm name>

halt

salt.modules.kvm_hyper.halt(name)

Hard power down a virtual machine

CLI Example:

salt '*' hyper.halt webserver

hyper_info

salt.modules.kvm_hyper.hyper_info()

Return a dict with information about this hypervisor

CLI Example:

salt '*' hyper.hyper_info

hyper_type

salt.modules.kvm_hyper.hyper_type()

Return that type of hypervisor this is

CLI Example:

salt '*' hyper.hyper_type

init

salt.modules.kvm_hyper.init(name, cpus, mem, image, storage_dir, network={'eth0': {'bridge': 'br0', 'mac': ''}}, desc='', opts={})

Create a KVM virtual machine based on these passed options, the virtual machine will be started upon creation

CLI Example:

salt '*' hyper.init webserver 2 2048 salt://fedora/f16.img:virt /srv/vm/images

list_virts

salt.modules.kvm_hyper.list_virts()

Return a list of virtual machine names on the minion

CLI Example:

salt '*' hyper.list_virts

pause

salt.modules.kvm_hyper.pause(name)

Pause the named virtual machine

CLI Example:

salt '*' hyper.pause webserver

purge

salt.modules.kvm_hyper.purge(name)

Hard power down and purge a virtual machine, this will destroy a vm and all associated vm data

CLI Example:

salt '*' hyper.purge webserver

resume

salt.modules.kvm_hyper.resume(name)

Resume the named virtual machine

CLI Example:

salt '*' hyper.resume webserver

set_autostart

salt.modules.kvm_hyper.set_autostart(name)

Set the named virtual machine to autostart when the hypervisor boots

CLI Example:

salt '*' hyper.set_autostart webserver

start

salt.modules.kvm_hyper.start(config)

Start an already defined virtual machine that has been shut down

CLI Example:

salt '*' hyper.start webserver

virt_info

salt.modules.kvm_hyper.virt_info()

Return detailed information about the vms on this hyper in a dict:

{'cpu': <int>,
'maxMem': <int>,
'mem': <int>,
'state': '<state>',
'cputime' <int>}

CLI Example:

salt '*' hyper.virt_info

Parent topic

Table Of Contents

Previous topic

salt.modules.kmod

Next topic

salt.modules.launchctl