XenServer Cloud Driver

The XenServer driver is designed to work with a Citrix XenServer.

Requires XenServer SDK (can be downloaded from )

Place a copy of the in the Python site-packages folder.



Example provider configuration:

# /etc/salt/cloud.providers.d/myxen.conf
  driver: xen
  user: root
  password: p@ssw0rd

Example profile configuration:

# /etc/salt/cloud.profiles.d/myxen.conf
  provider: myxen
  user: root
  password: p@ssw0rd
  image: opensuseleap42_2-template
  storage_repo: 'Local storage'
  resource_pool: default_pool
  clone: True
  provider: myxen
  user: root
  clone: False
  image: sles12sp2-template
  deploy: False
  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

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, call=None)

Return available Xen locations (not implemented)

salt-cloud --list-locations myxen, call=None)

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, call=None)

Destroy Xen VM or template instance

salt-cloud -d xenvm01, call=None, kwargs=None)

Destroy Xen VM or template instance

salt-cloud -f destroy_template myxen name=testvm2, session=None, call=None)

Get virtual block devices on VM

salt-cloud -a destroy_vm_vdis  xenvm01

Return the first configured instance., session=None, call=None)

Get PV arguments for a VM

salt-cloud -a get_pv_args xenvm01, session=None, call=None)

Get the IP address of the VM

salt-cloud -a get_vm_ip xenvm01


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, call=None, session=None)

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, call=None, session=None)

Reboot a vm

salt-cloud -a reboot xenvm01, call=None, session=None)

Resume a vm from disk

salt-cloud -a resume xenvm01, kwargs=None, session=None, call=None)

Set PV arguments for a VM

salt-cloud -a set_pv_args xenvm01 pv_args="utf-8 graphical", ipv4_cidr=None, ipv4_gw=None, session=None, call=None)

Set the IP address on a virtual interface (vif), session=None, call=None)

Show information about a specific VM or template

salt-cloud -a show_instance xenvm01


memory is memory_dynamic_max, call=None, session=None)

Shutdown a vm

salt-cloud -a shutdown xenvm01

Geta list of storage repositories

salt-cloud -f sr_list myxen, call=None, session=None)

Start a vm

salt-cloud -a start xenvm01, call=None, session=None)

Stop a vm

salt-cloud -a stop xenvm01, call=None, session=None)

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, call=None, session=None)

UnPause a vm

salt-cloud -a unpause xenvm01, call=None)

Get a list of VBDs on a VM

requires: the name of the vm with the vbd definition

salt-cloud -a vbd_list xenvm01, kwargs=None)

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, call=None, kwargs=None)

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