LinuxCommandLibrary

xe

Manage XenServer virtual machines

TLDR

Run a command once for each line of input data as arguments

$ [arguments_source] | xe [command]
copy

Execute the commands, replacing any occurrence of the placeholder (marked as {}) with the input line
$ [arguments_source] | xe [command] {} [optional_extra_arguments]
copy

Execute a shellscript, joining every N lines into a single call
$ echo -e 'a\nb' | xe -N[2] -s 'echo $2 $1'
copy

Delete all files with a .backup extension
$ find . -name ['*.backup'] | xe rm -v
copy

Run up to max-jobs processes in parallel; the default is 1. If max-jobs is 0, xe will run as many processes as cpu cores
$ [arguments_source] | xe -j [max-jobs] [command]
copy

SYNOPSIS

xe [global-options] <object-class>-<action> [parameter=value...]
xe [global-options] (for interactive mode)

PARAMETERS

--minimal
    Suppresses header and footer, showing only essential output (e.g., UUIDs).

--quiet
    Suppresses non-essential output, only showing errors.

--verbose
    Increases verbosity of output, showing more details.

--output-xml
    Formats command output as XML.

--csv
    Formats command output as Comma Separated Values (CSV).

--error-on-no-op
    Exits with an error code if an operation performs no action.

--pretty
    Formats output for improved human readability, often used with list commands.

DESCRIPTION

xe is the primary command-line interface (CLI) for managing XenServer (now Citrix Hypervisor) environments. It provides a comprehensive set of commands to interact with the hypervisor and its virtualized resources. Users can manage virtual machines (VMs), storage repositories (SRs), networks, hosts, and resource pools. xe communicates directly with the XenServer management API, enabling administrators to perform operations such as creating, starting, stopping, and migrating VMs, configuring network interfaces, attaching and detaching storage, and monitoring system status. Its robust and scriptable nature makes it an essential tool for automating routine tasks, performing complex deployments, and troubleshooting issues within XenServer deployments. While powerful, xe typically operates on a XenServer control domain (Dom0) or from a remote management workstation with appropriate credentials.

CAVEATS

xe is specific to XenServer/Citrix Hypervisor and is not a general-purpose Linux command found on all distributions.
It requires a connection to a XenServer pool master or standalone host.
Operations may require specific roles or permissions.
Its extensive command set can be complex for new users.
Output often requires parsing for scripting, especially when dealing with UUIDs.

INTERACTIVE MODE

xe can be run in an interactive shell mode by simply typing xe and pressing Enter. This provides tab completion for subcommands and parameters, making it easier to explore and execute commands efficiently.

OBJECT-ACTION PARADIGM

Most xe commands follow an object-class-action structure (e.g., vm-list, host-shutdown, vif-create). This consistent naming convention helps users predict and construct commands for various management tasks.

UUIDS AND IDENTIFIERS

Many xe commands operate on Universal Unique Identifiers (UUIDs) for objects like VMs, hosts, and SRs. Commands like list are commonly used to retrieve these UUIDs before performing actions on specific objects.

HISTORY

The xe command-line interface has been a core component of XenServer (originally developed by XenSource, later acquired by Citrix) since its early versions. It was designed to provide a powerful and scriptable way to manage the Xen hypervisor and the entire virtualization stack. Over the years, as XenServer evolved into Citrix Hypervisor, xe has consistently served as the primary administrative interface, with new commands and parameters added to support new features and functionalities in the platform, maintaining its object-action paradigm.

SEE ALSO

xl(1), virsh(1), qemu-img(1), systemctl(1)

Copied to clipboard