Chapter 5. Configuration
5.2 Managing the XIV Storage System
5.2.2 Log on to the system with XCLI
After the installation of XIV Storage Management software, you can find the XCLI executable file (xcli.exe) in the specified installation directory. The usage of XCLI is simple, and detailed illustrations are given in this chapter.
There are three methods of invoking the XCLI functions:
Invoking the XCLI in order to define configurations
: In these invocations, the XCLI utility is used to defineconfigurations
. A configuration is a mapping between a user-defined name and a list of three IP addresses. This configuration can be referenced later in order to execute a command without having to specify the system IP addresses (refer to next method in this list).These various configurations are stored on the local host running the XCLI utility and must be defined again for each host.
Invoking the XCLI to execute a command
: This method is the most basic and important type of invocation. Whenever invoking an XCLI command, you must also provide either the system’s IP addresses or a configuration name.
Invoking the XCLI for general purpose functions
: These invocations can be used to get the XCLI’s software version or to print the XCLI’s help text.The command to execute is generally specified along with parameters and their values. A
script
can be defined to specify the name and path to the commands file (lists of commands will be executed in User Mode only).For complete and detailed documentation of the IBM XIV Storage Manager XCLI, refer to the
XCLI Reference Guide, GC27-2213-00.
Customizing the XCLI environment
For convenience and more efficiency in using the XCLI, we recommend that you customize your management workstation environment as described in the following steps:
1. Create a DOS prompt invocation for the XCLI on your desktop, an XCLI icon:
a. Start→ All Programs → Accessories.
b. Right-click Command Prompt and select Create Shortcut. c. Drag the shortcut icon to your desktop.
d. Rename it xcli_admin.
2. Create a safe working directory for XCLI (for example, create the XCLI directory in Document and Settings).
3. Customize the xcli_admin icon:
a. Right-click the icon and select Properties.
Tip: The configuration information regarding the connected systems and the GUI itself is
stored in various files under the user’s home directory.
As a useful and convenient feature, all the commands issued from the GUI are saved in a log in the format of XCLI syntax. The default location is in the Documents and Setting folder of the Microsoft® Windows current user, for example:
C:\Documents and Settings\<YOUR LOGGED IN USER>\Application Data\XIV\GUI10\logs\nextraCommands_*.log
b. On the Shortcut tab:
Target: %SystemRoot%\system32\cmd.exe /k cd C:\Documents and Settings\Administrator\My Documents\xcli && setup
Start in: c:\Program Files\XIV\GUI10 c. On the Options tab:
Check QuickEdit mode d. On the Layout tab:
Screen buffer size Width: 160 Window size
Width: 120 Height: 40
e. Click Apply and click OK.
Be informed that setup (highlighted in bold in step 3b) represents a batch program. This batch program is described later in this section and is used to store relevant environment variables. Refer to Example 5-2 on page 92.
As part of XIV’s high-availability features, each system is assigned three IP addresses. When executing a command, the XCLI utility is provided with these three IP addresses and tries each of them sequentially until communication with one of the IP addresses is successful.You must pass the IP addresses (IP1, IP2, and IP3) with each command. To avoid too much typing and having to remember IP addresses, you can use instead a a predefined configuration name.
To issue a command against a specific XIV Storage System, you also need to supply the username and the password for it. The default user is admin and the default password is adminadmin, which can be used with the following parameters:
-u user or -user
sets the user name that will be used to execute the command. -p password or -password
is the XCLI password that must be specified in order to execute a command in the system.
-m IP1 [-m IP2 [-m IP3]]
defines the IP addresses of the Nextra system
Example 5-1 illustrates a common command execution syntax on a given XIV Storage System.
Example 5-1 Simple XCLI command
xcli -u admin -p adminadmin -m 149.168.100.101 user_list
Managing the XIV Storage System by using the XCLI always requires that you specify these same parameters. To avoid repetitive typing, you can instead define and use specific
environment variables.
Note: When executing a command, you must specify either a configuration or IP
Create this setup.bat file in C:\Documents and Settings\Administrator\My Documents\xcli.
Example 5-2 Creating setup.bat file
@echo off
set XCLI_CONFIG_FILE=C:\Documents and Settings\hu02230\My Documents\xiv\xcliconfigs.xml
set XIV_XCLIUSER=admin
set XIV_XCLIPASSWORD=adminadmin xcli -L
The XCLI utility requires user and password options. If user and passwords are not specified, the default environment variables XIV_XCLIUSER and XIV_XCLIPASSWORD are utilized. If neither command options nor environment variables are specified, commands are run with the user defined in config_set default_user=XXXX. This allows smooth migration to the IBM XIV Software System for clients that do not have defined users.
The configurations are stored in a file under the user’s home directory. A different file can be specified by -f or --file switch (applicable to configuration creation, configuration deletion, listing configurations, and command execution). Alternatively, the environment variable XCLI_CONFIG_FILE, if defined, determines the file’s name and path.
We recommend that you create a configuration file as shown in Example 5-3.
Example 5-3 Create a configuration file
Create an empty file
C:\Documents and Settings\Administrator\My Documents\xcli\xcliconfigs.xml Create XCLI config file
xcli -f "C:\Documents and Settings\Administrator\My
Documents\xcli\xcliconfigs.xml" -a Redbook -m <IP1> [–m <IP2> [–m <IP3>]]
After this specification, the shortened command syntax works as shown in Example 5-4.
Example 5-4 Short command syntax
xcli -c Redbook user_list
The default IP address for XIV Storage System is 14.10.202.250.
Getting help with XCLI commands
To get help about the usage and commands, proceed as shown in Example 5-5.
Example 5-5 xcli help commands
xcli
xcli -c Redbook help
xcli -c Redbook help command=help format=full
The first command prints out the usage of xcli. The second one prints all the commands that can be used by the user in that particular system. The third one shows the usage of the help command itself with all the parameters.
As mentioned in the output of a simple XCLI command, there are different parameters to get the result of a command in a predefined format. The default is the user readable format.
Specify the -s parameter to get it in a comma-separated format or specify the -x parameter to obtain an XML format.
To specify the required fields of a command, use the -t parameter as shown here: xcli -c Redbook -t name,fields help command=user_list