Modules

Custom modules that add more powerful commands to Salt.

vm

Work with virtual machines manages by libvirt

maintainer:Robert Einsle <robert.einsle@mawoh.de>
depends:libvirt Python module
vm.create(hostname, ipaddress, netmask=None, gateway=None, bridge=None, domain=None, interface=None, nameserver=None, ntpserver=None, proxy=None, location=None, preseed_url=None, ram=None, vcpus=None, vg_name=None, lv_name=None, lv_size=None)

Create new VMs

Parameters:
  • hostname – name of the vm to be created
  • ipaddress – the ipaddress the new created vm will use
  • netmask – the netmask of the ipaddress
  • gateway – the default gateway the vm will use
  • bridge – the bridge the network-interface will be created on (defaults to br0)
  • domain – the domain-name of the host
  • interface – the interface insite the vm that will be configured (defaults to eth0)
  • nameserver – the nameserver the vm will use
  • ntpserver – the ntpserver the vm will use
  • proxy – the proxyserver the vm will use
  • location – the location (url) of the installer (defaults to http://ftp.de.debian.org/debian/dists/wheezy/main/installer-amd64/)
  • preseed_url – url of the preseed-file for the installation (defaults to http://www.einsle.de/wheezy-test.cfg)
  • ram – the amount of ram in mb the vm will be have (defaults to 1024)
  • vcpus – the amount of virtual cpus the vm will be have (defaults to 1)
  • vg_name – the volume_group the vm will be installed in (defaults to vg_data)
  • lv_name – the new lv name for the vm (defaults to lv_{hostname})
  • lv_size – the size in GB the image for the vm will be created (defaults to 10)

CLI Example:

salt '*' vm.create hostname='<name>' ip_address='10.0.0.2' netmask='255.255.255.0' gateway='10.0.0.1'