This chapter describes the XenServer command line interface (CLI). The xe CLI enables the writing of scripts for automating system administration tasks and allows integration of XenServer into an existing IT infrastructure.
The xe command line interface is installed by default on XenServer Hosts. A stand-alone remote CLI is also available for Linux and Windows.
The basic syntax of all XenServer xe CLI commands is:
xe command-name
argument=value
argument=value
...
Each specific command contains its own set of arguments that are of the form argument=value. Some commands have required arguments, and most have some set of optional arguments. Typically a command will assume default values for some of the optional arguments when invoked without them.
If the xe command is executed remotely, additional connection and authentication arguments are used. These arguments also take the form argument=argument_value.
The server argument is used to specify the hostname or IP address. The username and password arguments are used to specify credentials. A password-file argument can be specified instead of the password directly. In this case an attempt is made to read the password from the specified file (stripping CRs and LFs off the end of the file if necessary), and use that to connect. This is more secure than specifying the password directly at the command line.
The optional port argument can be used to specify the agent port on the remote XenServer Host (defaults to 443).
Shorthand syntax is also available for remote connection arguments:
Arguments are also taken from the environment variable XE_EXTRA_ARGS, in the form of comma-separated key/value pairs. For example, in order to run commands on another XenServer Host, you could do the following:
export XE_EXTRA_ARGS="server=jeffbeck,port=443,username=root,password=pass"
and thereafter you would not need to specify the remote XenServer Host parameters in each xe command you execute.