HP BL680c XenServer Administrator's Guide 4.1.0 - Page 53

Command line interface

Page 53 highlights

Chapter 5. Command line interface 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 and is included with XenCenter. A stand-alone remote CLI is also available for Linux. On Windows, the xe.exe CLI executable is installed along with XenCenter. To use it, open a Windows Command Prompt and change directories to the directory where the file resides (typically C:\Program Files\XenSource\XenCenter), or add its installation location to your system path. On Linux, you can install the stand-alone xe CLI executable from the RPM named xecli-4.1.0-7843p.i386.rpm on the Linux Pack CD, as follows: rpm -ivh xe-cli-4.1.0-7843p.i386.rpm Basic help is available for CLI commands on-host by typing: xe help command A list of the most commonly-used xe commands is displayed if you type: xe help or a list of all xe commands is displayed if you type: xe help --all 5.1. Basic xe syntax 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). Example: On the local XenServer Host: xe vm-list 47

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108

47
Chapter 5. Command line interface
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 and is included with XenCenter.
A stand-alone remote CLI is also available for Linux.
On Windows, the
xe.exe
CLI executable is installed along with XenCenter.
To use it, open a Windows Command Prompt and change directories to the directory where the file resides
(typically
C:\Program Files\XenSource\XenCenter
), or add its installation location to your system
path.
On Linux, you can install the stand-alone xe CLI executable from the RPM named
xe-
cli-4.1.0-7843p.i386.rpm
on the Linux Pack CD, as follows:
rpm -ivh xe-cli-4.1.0-7843p.i386.rpm
Basic help is available for CLI commands on-host by typing:
xe help
command
A list of the most commonly-used xe commands is displayed if you type:
xe help
or a list of all xe commands is displayed if you type:
xe help --all
5.1. Basic xe syntax
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).
Example:
On the local XenServer Host:
xe vm-list