Ansible playbook to install Xen tools on Linux

Ansible playbook to install Xen tools on Linux

XenServer Tools provides high performance Windows drivers and a management agent, enhancing disk and network performance for XenServer VMs.

XenServer Tools must be installed for each virtual machine (Windows and Linux) in order to be able to use the xe CLI or XenCenter, and VM performance will be significantly lowered unless the tools are installed. Without the tools installed, you will not be able to do any the following:

  • Cleanly shut down, reboot or suspend a VM.
  • View VM performance data in XenCenter.
  • Migrate a running VM (via XenMotion).
  • Create quiesced snapshots or snapshots with memory (checkpoints), or revert to snapshots.
  • Adjust the number of vCPUs on a running Linux VM (Windows VMs require a reboot for this to take effect).

Read Also: How to install postgresql on Debian 9


Download Xen-tools

You can use the following command to download the xen-tools or visit this link.


Ansible playbook 

Here is Ansible playbook. You need to change the path according to your path.

- hosts: "{{ hosts }}"
  remote_user: "{{ user }}"
   - name: Copy xen tools to the server
     copy: src=~/Linux dest=/mnt mode=0777
   - name: Install Xen tools
     command: sh /mnt/Linux/

Now you can execute the following command to install the tools.

Note: You must change the hosts file, playbook name, hosts and user according to your configuration.

ansible-playbook -i hosts install_xen_tools.yml --extra-vars="hosts=test" --extra-vars="user=root"

If you have any issue using this tutorial please feel free to comment below.