The XenServer driver is designed to work with a Citrix XenServer.
Requires XenServer SDK (can be downloaded from https://www.citrix.com/downloads/xenserver/product-software/ )
Place a copy of the XenAPI.py in the Python site-packages folder.
XenAPI
Example provider configuration:
# /etc/salt/cloud.providers.d/myxen.conf myxen: driver: xen url: http://10.0.0.120 user: root password: p@ssw0rd
Example profile configuration:
# /etc/salt/cloud.profiles.d/myxen.conf suse: provider: myxen user: root password: p@ssw0rd image: opensuseleap42_2-template storage_repo: 'Local storage' resource_pool: default_pool clone: True minion: master: 10.0.0.18 sles: provider: myxen user: root clone: False image: sles12sp2-template deploy: False w2k12: provider: myxen image: w2k12svr-template clone: True userdata_file: /srv/salt/win/files/windows-firewall.ps1 win_installer: /srv/salt/win/files/Salt-Minion-2016.11.3-AMD64-Setup.exe win_username: Administrator win_password: p@ssw0rd use_winrm: False ipv4_cidr: 10.0.0.215/24 ipv4_gw: 10.0.0.1
Get a list of images from Xen
If called with the --list-images then it returns images with all details.
salt-cloud --list-images myxen
Return available Xen locations (not implemented)
salt-cloud --list-locations myxen
Return a list of Xen template definitions
salt-cloud --list-sizes myxen
Create a VM in Xen
The configuration for this function is read from the profile settings.
salt-cloud -p some_profile xenvm01
Destroy Xen VM or template instance
salt-cloud -d xenvm01
Destroy Xen VM or template instance
salt-cloud -f destroy_template myxen name=testvm2
Get virtual block devices on VM
salt-cloud -a destroy_vm_vdis xenvm01
Return the first configured instance.
Get PV arguments for a VM
salt-cloud -a get_pv_args xenvm01
Get the IP address of the VM
salt-cloud -a get_vm_ip xenvm01
Note
Requires xen guest tools to be installed in VM
Get a list of Xen Servers
salt-cloud -f host_list myxen
List virtual machines
salt-cloud -Q
List full virtual machines
salt-cloud -F
Perform a select query on Xen VM instances
salt-cloud -S
Pause a vm
salt-cloud -a pause xenvm01
Get a list of Resource Pools
salt-cloud -f pool_list myxen
Get a list of Resource Pools
salt-cloud -f pool_list myxen
Reboot a vm
salt-cloud -a reboot xenvm01
Resume a vm from disk
salt-cloud -a resume xenvm01
Set PV arguments for a VM
salt-cloud -a set_pv_args xenvm01 pv_args="utf-8 graphical"
Set the IP address on a virtual interface (vif)
Show information about a specific VM or template
salt-cloud -a show_instance xenvm01
Note
memory is memory_dynamic_max
Shutdown a vm
salt-cloud -a shutdown xenvm01
Geta list of storage repositories
salt-cloud -f sr_list myxen
Start a vm
salt-cloud -a start xenvm01
Stop a vm
salt-cloud -a stop xenvm01
Suspend a vm to disk
salt-cloud -a suspend xenvm01
Return available Xen template information.
This returns the details of each template to show number cores, memory sizes, etc..
salt-cloud -f template_list myxen
UnPause a vm
salt-cloud -a unpause xenvm01
Get a list of VBDs on a VM
requires: the name of the vm with the vbd definition
salt-cloud -a vbd_list xenvm01
Return available Xen VDI images
If this function is called with the -f
or --function
then
it can return a list with minimal deatil using the terse=True
keyword
argument.
salt-cloud -f vdi_list myxen terse=True
Get a list of virtual network interfaces on a VM
requires: the name of the vm with the vbd definition
salt-cloud -a vif_list xenvm01