The XenServer CLI should be familiar to anyone who has used Linux commands. Even VMware administrators now use more CLI operations with the vSphere Management Assistant (vMA) for ESX and ESXi, as well as with PowerCLI.
Of course, the XenServer CLI has its own command language, but the reference documentation can help a VMware administrator get a handle on XenServer management. The XenServer Administrators Guide Appendix A provides complete information on the xe -- as the CLI is called in the Xen world.
XenServer CLI installation
The XenServer command line is installed not only on each XenServer host, but also on the Windows client when the XenCenter Client is installed. The command xe.exe is used identically to its Linux counterpart, without having to log in to the XenServer host. With the XenServer CLI, you can manage all your hosts, guests, networks and storage, right from the command line of your local workstation.
You should also download the XenServer VM PowerShell Cmdlet to obtain the PowerShell cmdlets for XenServer management and install them in your local management workstation. (You also need to run a .NET install utility to get it registered, as noted on the download page.) Similar to VMware’s PowerCLI, it provides some core PowerShell cmdlets for managing the environment.
Still these PowerShell cmdlets need some work before they’re ready for XenServer management. There are only a few so far and their naming is a bit confusing. Still, I’m hopeful they will get better over time. If you use the PowerShell cmdlets, I highly suggest referencing The Circle of Expertise Dev.com site for more information and samples.
XenServer CLI basic commands
The basic syntax of the XenServer command line uses this form:
xe <command-name> <argument value> <argument value>
In other words, whenever you create a XenServer CLI command, it always starts with “xe” and then the command you want to execute. To list all the CDs and/or ISOs on the XenServer host or pool, for example, you would enter:
You could also generate a list of all virtual machines (VMs) by issuing the xe vm-list command. To get any useful information from that command, though, you must give it parameters, which can create some long command lines. With long command lines comes the inherent fat-fingering of syntax, so creating scripts is a much better solution.
Also note that the XenServer CLI uses different command-related terminology from VMware, which can cause confusion for a VMware administrator. For example, the XenServer command line uses the abbreviation VDI to reference virtual disk images, this acronym does not mean virtual desktop infrastructure. So the VDI-create command, which creates a virtual disk, may be misleading for VMware folks who think it creates a virtual desktop.
Other confusing terms are the virtual block device (VBD), which is the connector object between the VDI and VM, and the virtual network interfaces (VIFs). You can learn these terms in the XenServer Administrator’s Guide or visit the Xen.org documentation site for more information.
Additional XenServer management: XenCenter
The XenCenter Client is another important tool for VMware admins attempting XenServer management. The client allows you to do basic administration of XenServer hosts and pools.
There are a couple things worth noting with the client, specifically the use of tags and its alerting capability. Tags are simply an avenue into the application programming interface (API) inside XenServer. By creating tags, you can enable plug-ins (similar to vCenter plug-ins) and other functionality available only via the API.
Remember, XenServer was built to run without a management console or client, so all the functionality is built into the hypervisor itself. The alerting capability in the XenCenter Client, for example, is supplemental to the capability already built into XenServer. The XenCenter Client alerting includes additional metrics and makes them easier to configure than via the XenServer command line.
VMware admins should have an easy transition to managing XenServer if they’re comfortable with the XenServer CLI and understand that XenServer PowerShell cmdlets are limited. But if you’ve never seen a command line, get up to speed quickly. VMware is heading in that direction with ESXi and the vMA, and you want to have the broadest knowledge set for any career opportunity that comes along.