There are many tools available on Citrix XenServer which are of use to system administrators and QA analysts look to automate scripts and tests running on XenServer.
These third party tools are usually not officially supported as part of the Citrix XenServer product distribution i.e. we can’t guarantee their ongoing availability and would not offer support for bugs or faults in the tools. As such these tools are often undocumented and I’m learning about new ones all the time.
In practice these tools can be very useful and are of a high quality. This week I saw my colleague Robert using a rather cute little tool (vncsnapshot) to script the taking of screenshots of the screen the user sees within a VM from the host. Our own QA department use this to automatically gather certification results especially when running a large number of VMs on a host and it struck me that others might be interested.
Most of the time XenServer VMs have a VNC stream available. Another of my colleagues has written a blog about using VNC to connect to XenServer which provides useful background, it’s available here, and also describes how to do this remotely via a tunnel. (When GPU pass-through is in use the VNC stream is usually disabled so I’m afraid this technique won’t work, however it should work with vGPU.)
The key commands are:
to give you the domain ID.
which gives you the VNC port. Subtract 5900 to get the VNC display number to use in the vncsnapshot command thus:
Subtracting 5900, gives a VNC display number of 2 that can now be supplied to the vncsnapshot utility
If you are interested in writing your own scripts to automate bespoke tasks or tests for your own XenServer installation it’s worth remembering that you also have the option to use the XenServer PowerShell cmdlets (or the XenServer C, C#, Java or python APIs) and also to integrate your scripts into the XenCenter GUI via XenCenter plugins. PowerShell is a particularly popular choice with XenDesktop administrators.
I’d also recommend watching my colleague Jesse’s blog; Jesse is a support ninja who often blogs about scripting and tools available on XenServer and other Citrix products.