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
salt.cloud.clouds.xen.
avail_images
(call=None)¶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
salt.cloud.clouds.xen.
avail_locations
(session=None, call=None)¶Return available Xen locations (not implemented)
salt-cloud --list-locations myxen
salt.cloud.clouds.xen.
avail_sizes
(session=None, call=None)¶Return a list of Xen template definitions
salt-cloud --list-sizes myxen
salt.cloud.clouds.xen.
create
(vm_)¶Create a VM in Xen
The configuration for this function is read from the profile settings.
salt-cloud -p some_profile xenvm01
salt.cloud.clouds.xen.
destroy
(name=None, call=None)¶Destroy Xen VM or template instance
salt-cloud -d xenvm01
salt.cloud.clouds.xen.
destroy_template
(name=None, call=None, kwargs=None)¶Destroy Xen VM or template instance
salt-cloud -f destroy_template myxen name=testvm2
salt.cloud.clouds.xen.
destroy_vm_vdis
(name=None, session=None, call=None)¶Get virtual block devices on VM
salt-cloud -a destroy_vm_vdis xenvm01
salt.cloud.clouds.xen.
get_configured_provider
()¶Return the first configured instance.
salt.cloud.clouds.xen.
get_pv_args
(name, session=None, call=None)¶Get PV arguments for a VM
salt-cloud -a get_pv_args xenvm01
salt.cloud.clouds.xen.
get_vm_ip
(name=None, session=None, call=None)¶Get the IP address of the VM
salt-cloud -a get_vm_ip xenvm01
Note
Requires xen guest tools to be installed in VM
salt.cloud.clouds.xen.
host_list
(call=None)¶Get a list of Xen Servers
salt-cloud -f host_list myxen
salt.cloud.clouds.xen.
list_nodes
()¶List virtual machines
salt-cloud -Q
salt.cloud.clouds.xen.
list_nodes_full
(session=None)¶List full virtual machines
salt-cloud -F
salt.cloud.clouds.xen.
list_nodes_select
(call=None)¶Perform a select query on Xen VM instances
salt-cloud -S
salt.cloud.clouds.xen.
pause
(name, call=None, session=None)¶Pause a vm
salt-cloud -a pause xenvm01
salt.cloud.clouds.xen.
pif_list
(call=None)¶Get a list of Resource Pools
salt-cloud -f pool_list myxen
salt.cloud.clouds.xen.
pool_list
(call=None)¶Get a list of Resource Pools
salt-cloud -f pool_list myxen
salt.cloud.clouds.xen.
reboot
(name, call=None, session=None)¶Reboot a vm
salt-cloud -a reboot xenvm01
salt.cloud.clouds.xen.
resume
(name, call=None, session=None)¶Resume a vm from disk
salt-cloud -a resume xenvm01
salt.cloud.clouds.xen.
set_pv_args
(name, kwargs=None, session=None, call=None)¶Set PV arguments for a VM
salt-cloud -a set_pv_args xenvm01 pv_args="utf-8 graphical"
salt.cloud.clouds.xen.
set_vm_ip
(name=None, ipv4_cidr=None, ipv4_gw=None, session=None, call=None)¶Set the IP address on a virtual interface (vif)
salt.cloud.clouds.xen.
show_instance
(name, session=None, call=None)¶Show information about a specific VM or template
salt-cloud -a show_instance xenvm01
Note
memory is memory_dynamic_max
salt.cloud.clouds.xen.
shutdown
(name, call=None, session=None)¶Shutdown a vm
salt-cloud -a shutdown xenvm01
salt.cloud.clouds.xen.
sr_list
(call=None)¶Geta list of storage repositories
salt-cloud -f sr_list myxen
salt.cloud.clouds.xen.
start
(name, call=None, session=None)¶Start a vm
salt-cloud -a start xenvm01
salt.cloud.clouds.xen.
stop
(name, call=None, session=None)¶Stop a vm
salt-cloud -a stop xenvm01
salt.cloud.clouds.xen.
suspend
(name, call=None, session=None)¶Suspend a vm to disk
salt-cloud -a suspend xenvm01
salt.cloud.clouds.xen.
template_list
(call=None)¶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
salt.cloud.clouds.xen.
unpause
(name, call=None, session=None)¶UnPause a vm
salt-cloud -a unpause xenvm01
salt.cloud.clouds.xen.
vbd_list
(name=None, 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
salt.cloud.clouds.xen.
vdi_list
(call=None, 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
salt.cloud.clouds.xen.
vif_list
(name, 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