Citrix Hypervisor (xenserver)

0 views
Skip to first unread message

Ursula Illiano

unread,
Aug 4, 2024, 9:00:18 PM8/4/24
to nisabdiespot
Thismodule can be used to create new virtual machines from templates or other virtual machines, modify various virtual machine components like network and disk, rename a virtual machine and remove a virtual machine with associated components.

To acquire XenAPI Python library, just run pip install XenAPI on your Ansible Control Node. The library can also be found inside Citrix Hypervisor/XenServer SDK (downloadable from Citrix website). Copy the XenAPI.py file from the SDK to your Python site-packages on your Ansible Control Node to use it. Latest version of the library can also be acquired from GitHub: -project/xen-api/master/scripts/examples/python/XenAPI/XenAPI.py


If no scheme is specified in hostname, module defaults to because is problematic in most setups. Make sure you are accessing XenServer host in trusted environment or use scheme explicitly.


To use scheme for hostname you have to either import host certificate to your OS certificate store or use validate_certs=false which requires XenAPI library from XenServer 7.2 SDK or newer and Python 2.7.9 or newer.


Network configuration inside a guest OS, by using networks[].type, networks[].ip, networks[].gateway etc. parameters, is supported on XenServer 7.0 or newer for Windows guests by using official XenServer Guest agent support for network configuration. The module will try to detect if such support is available and utilize it, else it will use a custom method of configuration via xenstore. Since XenServer Guest agent only support None and Static types of network configuration, where None means DHCP configured interface, networks[].type and networks[].type6 values none and dhcp have same effect. More info here: -developer/citrix-hypervisor-developer/citrix-hypervisor-developing-products/citrix-hypervisor-staticip.html


On platforms without official support for network configuration inside a guest OS, network parameters will be written to xenstore vm-data/networks/ key. Parameters can be inspected by using xenstore ls and xenstore read tools on \*nix guests or through WMI interface on Windows guests. They can also be found in VM facts instance.xenstore_data key as returned by the module. It is up to the user to implement a boot time scripts or custom agent that will read the parameters from xenstore and configure network with given parameters. Take note that for xenstore data to become available inside a guest, a VM restart is needed hence module will require VM restart if any parameter is changed. This is a limitation of XenAPI and xenstore. Considering these limitations, network configuration through xenstore is most useful for bootstrapping newly deployed VMs, much less for reconfiguring existing ones. More info here:

3a8082e126
Reply all
Reply to author
Forward
0 new messages