This guide provides information for using the command-line interface provided with the P4000 software. Command
syntax is included, and a link to sample scripts available from the HP website.
Part Number : AX696-96069
First edition : September 2011
The SAN/iQ command-line interface (CLI) is built upon the SAN/iQ API released with version 8.x. Develop
your own automation, scripting and management using the CLI.
• For instructions about using the CLI, see the Syntax section, immediately following this introduction.
• The section on Global Parameters describes functionality that applies to the entire CLI and includes
commands to customize global operations.
System Requirements
Windows Server 2003 SP1
Windows Server 2003 R2
Windows Server 2008 R2
Windows XP SP2
Windows Vista
10 MB available space
Installing the CLI
Install the CLI from the HP StorageWorks P4000 Management Software for Microsoft Windows DVD. The
installation wizard automatically installs the command-line software to the following default location in
Windows:
C:\Program Files\HP\P4000\HP P4000 CLI
and sets the environment variable.
Sample Scripts
You can obtain sample scripts from the HP website:
www.hp.com/go/P4000downloads.
On-System CLI
The CLI is installed on storage systems and can be accessed by SSH.
• Log in to the on-system CLI using the system IP address and the designated port 16022.
• If logging in from a command line, you must type the following command:
ssh –p 16022 -l <user> <NSM-IP>
HP P4000 CLI|Overview|5
Global Parameters
prompt=<true | false>
Some potentially destructive commands prompt before proceeding. This default behavior can be turned off
by specifying "prompt=false".
output=<XML | Normal>
In the default case, the CLI returns information to standard output, formatted in a way that's easy to read
rather than easy to parse. The XML setting returns all output information as an XML document, allowing
easier parsing of the result. There is no guarantee that newer versions of the API will preserve the same
formatting in the default case. It is strongly discouraged to use this form of the CLI programmatically. If the
output needs to be parsed, the XML variant is preferred.
separator=<c>
Some CLI parameters comprise parameters for multiple operations. For example, the "snapshotVolumes"
command allows the user to specify simultaneous snapshotting of multiple volumes. In this scenario, some
parameters specify an ordered list that apply to each snapshot in succession
description="This applies to snapshot1;This applies to snapshot2"
The default separator character is a semicolon (';'). If the same character is used in the body of a parameter
then separator can be changed to something else.
description="This applies to snapshot1;This applies to snapshot2"
inputFile=<file>
This takes all command input from a file containing XML input.
6|HP P4000 CLI|Global Parameters
Syntax
CLIQ is the command-line interface (CLI) for the HP P4000 Storage Solution. The CLI specifies parameters
in the form parameter=<parameter> (specification), rather than dictating a particular order (positional)
notation.
Parameter ordering
Ordering of parameters is not specified. Any order will do. For example:
This section is applicable to languages that have a notion of case sensitivity. All commands and
parameter names are case-insensitive. "createVolume" is the same as "CreateVolume" is the same as
"CREATEVOLUME". In some cases, parameter values, while not sensitive, are case significant as the system
will preserve the case specified. For example, the description parameter value in the createVolume command
will preserve the case specified by the caller, and impose this on the newly created volume.
True/False
Any parameter that indicates true/false, may be specified as "1|0" or "true|false".
Command abbreviation
There is no command or parameter abbreviation in the CLI when scripted. All commands and parameter
names must be fully specified. This is to prevent ambiguity in legacy scripts if new commands or parameters
are added.
OS error code integration
The CLI will map error codes to reasonable OS status codes (status in Linux, ERRORLEVEL in DOS). Since
these are limited to 0..255, some of the OS errors may have less granularity than the API error codes.
Composite commands
Some commands take multiple elements for the parameter value. In this case, the parameter is interpreted as
an delimiter-separated ordered list. For example:
If a parameter contains fewer elements in the list than needed for the composite command, the last one in the
list will be repeated. There must be at least one element in the list, if it's required.
Size specification
When volume sizes or thresholds are specified, the format is <size><units>, where units are:
• MB - megabytes (2^20)
HP P4000 CLI|Syntax|7
• GB - gigabytes (2^30)
• TB - terabytes (2^40)
There is no default for size units - the units must be specified. These are defined as International System of
Units (SI) for file storage (popular use).
Some values may be specified as either a size or percentage, for example, reserveQuota. The units will
determine how this is interpreted. For example:
• 10MB - 1,048,576 bytes
• 10GB - 10,737,418,240 bytes
• 10% - 1/10 of the current volume size
Password prompt
When credentials are required in the CLI, you may not want to display the password by typing the
"password=" parameter. If the username parameter is specified without the password parameter, you will be
prompted interactively for the password. This password will not be displayed.
Instead of specifying username/password parameters, you may choose to specify an encrypted key file
which contains the credentials. This file can be kept in a secure location, or otherwise access-controlled. To
create this file, use the createKey command.
When commands are executed on the storage systems (via SSH), no authentication parameters are required:
getGroupInfo
Integrated command shell
The CLIQ command line has an integrated shell that's executed by default when connecting directly to a
storage system, or running cliq.exe without any parameters:
>cliq
SAN/iQ Command Line Interface, v9.0 (type exit to quit)
(C) Copyright 2007-2009 Hewlett-Packard Development Company, L.P.
{{}}
CLIQ>
The integrated shell supports rich command line editing features specific to the HP P4000 API. The following
editing keys are supported:
LEFTMoves the cursor one space to the left.
8|HP P4000 CLI|Syntax
KeyMeaning
KeyMeaning
RIGHTMoves the cursor one space to the right.
BACKSPACEDeletes the character under the cursor and
moves the cursor to the left.
DELETEDeletes the character under the cursor.
UPRecalls the previous command entered.
DOWNRecalls the first command entered.
HOMEMoves the cursor to the beginning of the line.
ENDMoves the cursor to the end of the line.
ESCAPEClears the current command line.
INSERTToggles between insert mode (the default) and
overwrite mode.
TABCompletes the command. If the command
method is not yet fully resolved, repeated
TAB keys will cycle through the possible
command methods (SHIFT-TAB will cycle in
reverse). If the method is fully resolved, then
parameters associated with that command will
be proposed. The parameters suggested start
with those required for the command, followed
by optional parameters. No mutually exclusive
parameters will be suggested.
HP P4000 CLI|Syntax|9
Return Codes
All GAUChE commands return an XML response containing a 32-bit result code, and a description of the
result. Example:
Success results are nonnegative values, while negative values indicate an error. Many errors returned by
SAN/iQ and Hydra unfortunately do not return ordinal values that can be conveniently mapped into an API
and CLI return code. In all cases, we can return the error description string, but it won't be feasible to return
a sensible ordinate value (other than GaucheGeneralError) without parsing the description string.
ResultValueOS StatusDescription
CliqSuccess00Everything
succeeded normally
CliqNothingDone11Operation has
succeeded, but
nothing was done
(the system was
already in the
requested state).
CliqOperationPending22Operation has not
failed, but is not
yet complete. The
"handle" parameter
contains a value
that can be used to
query and cancel
the operation.
CliqOperationAbandoned 33Operation was
cancelled or
abandonded.
CliqNothingFound44Operation found no
objects.
CliqSnapshotSet55This snapshot
was a part of the
snapshot set.
CliqVssSnapshotWarning 66Warning: The
writer operation
failed.
CliqPITSnapshotWarning 77Warning: Point in
time snapshot is
created.
CliqParameterIgnored88The operation
10|HP P4000 CLI|Return Codes
succeeded but a
parameter was
ResultValueOS StatusDescription
ignored as it is not
applicable.
CliqUnexpected0x80001001128An unexpected
error has occurred.
CliqXmlError0x80001002129The XML given is
not well-formed.
CliqParameterFormat0x80001003130The parameter
is not specified
correctly.
CliqParameterRepeat0x80001004131A parameter is
repeated.
CliqMissingMethod0x80001005132The command
method is missing.
CliqMissingParameter0x80001006133One or more
expected
parameters are
missing.
CliqUnrecognizedCommand0x80001007134This command is
unrecognized.
CliqUnrecognizedParameter0x80001008135This parameter is
unrecognized.
CliqIncompatibleParameters0x80001009136Two or more
parameters
supplied are
incompatible with
each other.
CliqNotYetImplemented0x8000100A137This is a legal
command - we just
haven't done it yet.
CliqNoMemory0x8000100B138Out of memory.
CliqVolumeNotFound0x8000100C139Could not find the
requested volume.
CliqVolumeInUse0x8000100D140The requested
volume is in use.
CliqVolumeInitFailure0x8000100E141Volume
initialization failed.
CliqUnrecognizedVolume 0x8000100F142The volume is an
delete, modify
permissions, or
remove the last user
from the default
administration
group.
CliqVssProviderNotInstalled0x80001027166The HP P4000
VSS Provider is not
installed.
CliqVssProviderNotRunning0x80001028167The HP P4000
VSS Provider is not
running.
CliqVolumeNoSessions0x80001029168Cannot create
an applicationmanaged snapshot
because there
are no iSCSI
connections
associated with
this volume. To
create applicationmanaged
snapshots, there
must be at least
one application
server associated
with the volume
via an iSCSI
connection.The
volume must be
connected to a VSSenabled server.
loginRequiredThe IP address or DNS-resolvable names of one or more storage systems
userNameRequiredThe authentication user name for the storage system
passWordRequiredThe password for the storage system
keyFileRequiredThe encrypted key file (this is specified instead of the username and password
loginRequiredThe IP address or DNS-resolvable names of one or more storage systems
userNameRequiredThe authentication user name for the storage system
passWordRequiredThe password for the storage system
keyFileRequiredThe encrypted key file (this is specified instead of the username and password
parameters)
volumeNameRequiredThe name of the volume
namePrefixOptionalA prefix string for newly created objects. A unique number value will be concatenated
to this prefix to guarantee name uniqueness.
accessRightsOptionalThe access rights to the volume: r - read-only, x - no access, rw - read-write (default)
initiatorOptionalA semicolon delimited string of host IQN's. If this is not specified, the IQN of the local
server is used (this parameter is required if run on a storage system).
vipLoadBalanceOptionalUse VIP load balancing for this host. This can be one of: 0, 1 - default
exclusiveAccessOptionalRemove any previous server access rights to this volume. This can be one of: 0, 1 -
loginRequiredThe IP address or DNS-resolvable names of one or more storage systems
userNameRequiredThe authentication user name for the storage system
passWordRequiredThe password for the storage system
keyFileRequiredThe encrypted key file (this is specified instead of the username and password
parameters)
volumeNameRequiredThe name of the volume
targetSecretRequiredThe CHAP target secret for the volume.
namePrefixOptionalA prefix string for newly created objects. A unique number value will be concatenated
to this prefix to guarantee name uniqueness.
accessRightsOptionalThe access rights to the volume: r - read-only, x - no access, rw - read-write (default)
chapNameOptionalThe CHAP name for the volume. If this is not specified, the IQN of the local server is
used (this parameter is required if run on a storage system).
initiatorSecretOptionalThe CHAP initiator secret for the volume.
vipLoadBalanceOptionalUse VIP load balancing for this host. This can be one of: 0, 1 - default
exclusiveAccessOptionalRemove any previous server access rights to this volume. This can be one of: 0, 1 -
loginRequiredThe IP address or DNS-resolvable names of one or more storage systems
userNameRequiredThe authentication user name for the storage system
passWordRequiredThe password for the storage system
keyFileRequiredThe encrypted key file (this is specified instead of the username and password
parameters)
volumeNameRequiredThe name of the volume
serverNameRequiredThe name of the server
accessRightsOptionalThe access rights to the volume: r - read-only, x - no access, rw - read-write (default)
loginRequiredThe IP address or DNS-resolvable names of one or more storage systems
userNameRequiredThe authentication user name for the storage system
passWordRequiredThe password for the storage system
keyFileRequiredThe encrypted key file (this is specified instead of the username and password
snapshotNameRequiredThe name of the remote snapshot
This command clears the Alerts and Events Policy information
Availability: Windows, SAN/iQ
Version: 9.0
Request Syntax
cliq clearAlertsPolicy login= userName= passWord=
loginRequiredThe IP address or DNS-resolvable names of one or more storage systems
userNameRequiredThe authentication user name for the storage system
passWordRequiredThe password for the storage system
keyFileRequiredThe encrypted key file (this is specified instead of the username and password
This command removes the management group credentials from the cache.
Availability: Windows
Version: 8.0
Request Syntax
cliq clearCredentials groupName=
groupNameRequiredThe name of the group
Example
cliq clearCredentials groupName=TheGroup
clearDnsInfo
This command clears the DNS settings.
Availability: Windows, SAN/iQ
Version: 9.0
HP P4000 CLI|Commands|19
Request Syntax
cliq clearDnsInfo login= userName= passWord=
loginRequiredThe IP address or DNS-resolvable names of one or more storage systems
userNameRequiredThe authentication user name for the storage system
passWordRequiredThe password for the storage system
keyFileRequiredThe encrypted key file (this is specified instead of the username and password
loginRequiredThe IP address or DNS-resolvable names of one or more storage systems
userNameRequiredThe authentication user name for the storage system
passWordRequiredThe password for the storage system
keyFileRequiredThe encrypted key file (this is specified instead of the username and password
loginRequiredThe IP address or DNS-resolvable names of one or more storage systems
userNameRequiredThe authentication user name for the storage system
passWordRequiredThe password for the storage system
keyFileRequiredThe encrypted key file (this is specified instead of the username and password
loginRequiredThe IP address or DNS-resolvable names of one or more storage systems
userNameRequiredThe authentication user name for the storage system
passWordRequiredThe password for the storage system
keyFileRequiredThe encrypted key file (this is specified instead of the username and password
loginRequiredThe IP address or DNS-resolvable names of one or more storage systems
userNameRequiredThe authentication user name for the storage system
passWordRequiredThe password for the storage system
keyFileRequiredThe encrypted key file (this is specified instead of the username and password
parameters)
snapshotNameRequiredThe name of the remote snapshot
loginRequiredThe IP address or DNS-resolvable names of one or more storage systems
userNameRequiredThe authentication user name for the storage system
passWordRequiredThe password for the storage system
keyFileRequiredThe encrypted key file (this is specified instead of the username and password
parameters)
configurationRequiredThe RAID type to set. The possible RAID levels are reported in the getNsmInfo call.
loginRequiredThe IP address or DNS-resolvable names of one or more storage systems
userNameRequiredThe authentication user name for the storage system
passWordRequiredThe password for the storage system
keyFileRequiredThe encrypted key file (this is specified instead of the username and password
loginRequiredThe IP address or DNS-resolvable names of one or more storage systems
userNameRequiredThe authentication user name for the storage system
passWordRequiredThe password for the storage system
keyFileRequiredThe encrypted key file (this is specified instead of the username and password
parameters)
volumeNameRequiredThe name of the volume
snapshotNameRequiredThe name of the remote snapshot
loginRequiredThe IP address or DNS-resolvable names of one or more storage systems
userNameRequiredThe authentication user name for the storage system
passWordRequiredThe password for the storage system
HP P4000 CLI|Commands|23
keyFileRequiredThe encrypted key file (this is specified instead of the username and password
parameters)
adminGroupNameRequiredThe administrative group name
descriptionOptionalOptional description
adminUserNameOptionalSpecifies the users that this group comprises
permissionsOptionalPermissions for the group. This is a character sequence specifying the allowable
permissions in the following order: Group,Network,Storage System,Report. The
Password permissions are subsumed by the Group permissions.For each group, the
allowable permissions are: r - read-only, w - read-write (Report does not support this), f
- full-access (Report does not support this)For example:Note: if this is not specified, the
permissions are set to rrrr
loginRequiredThe IP address or DNS-resolvable names of one or more storage systems
userNameRequiredThe authentication user name for the storage system
passWordRequiredThe password for the storage system
keyFileRequiredThe encrypted key file (this is specified instead of the username and password
parameters)
adminUserNameRequiredSpecifies the users that this group comprises
adminPassWordRequiredThe password for the administrative user
descriptionOptionalOptional description
adminGroupNameOptionalThe administrative group name