HP BL680c XenServer Administrator's Guide 4.1.0 - Page 54

Special characters and syntax

Page 54 highlights

Command line interface Shorthand syntax is also available for remote connection arguments: -u username -pw password -pwf password file -p port -s server Example: On a remote XenServer Host: xe vm-list -u myuser -pw mypassword -s hostname 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 enter commands on one XenServer Host that are run on a remote 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. Using the XE_EXTRA_ARGS environment variable also enables tab completion of xe commands when issued against a remote XenServer Host, which is disabled by default. 5.2. Special characters and syntax To specify argument/value pairs on the xe command line, write argument=value without quotes, as long as value doesn't have any spaces in it. There should be no whitespace in between the argument name, the equals sign (=), and the value. Any argument not conforming to this format will be ignored. For values containing spaces, write: argument="value with spaces" If you use the CLI while logged into a XenServer Host, commands have a tab completion feature similar to that in the standard Linux bash shell. If you type, for example xe vm-l and then press the TAB key, the rest of the command will be displayed when it is unambiguous. If more than one command begins with vm-l, hitting TAB a second time will list the possibilities. This is particularly useful when specifying object UUIDs in commands. Note When executing commands on a remote XenServer Host, tab completion does not normally work. However if you put the server, username, and password in an environment variable called XE_EXTRA_ARGS on the machine from which you are entering the commands, tab completion is enabled. See Section 5.1, "Basic xe syntax" for details. 48

  • 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

Command line interface
48
Shorthand syntax is also available for remote connection arguments:
-u
username
-pw
password
-pwf
password file
-p
port
-s
server
Example:
On a remote XenServer Host:
xe vm-list -u
myuser
-pw
mypassword
-s
hostname
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 enter commands on one XenServer Host that are run on a remote
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.
Using the
XE_EXTRA_ARGS
environment variable also enables tab completion of xe commands when issued
against a remote XenServer Host, which is disabled by default.
5.2. Special characters and syntax
To specify argument/value pairs on the
xe
command line, write
argument=value
without quotes, as long as value doesn't have any spaces in it. There should be no whitespace in between
the argument name, the equals sign (=), and the value. Any argument not conforming to this format will
be ignored.
For values containing spaces, write:
argument="value with spaces"
If you use the CLI while logged into a XenServer Host, commands have a tab completion feature similar to
that in the standard Linux bash shell. If you type, for example
xe vm-l
and then press the
TAB
key, the rest of the command will be displayed when it is unambiguous. If more
than one command begins with vm-l, hitting
TAB
a second time will list the possibilities. This is particularly
useful when specifying object UUIDs in commands.
Note
When executing commands on a remote XenServer Host, tab completion does not normally
work. However if you put the server, username, and password in an environment variable called
XE_EXTRA_ARGS
on the machine from which you are entering the commands, tab completion is
enabled. See Section 5.1, “Basic xe syntax” for details.