HP StorageWorks P9000 Command View Advanced Edition Suite Software 7.1 CLI Reference Guide (TB581-96051, May 2011)

Inputting requests from XML documents
CAUTION:
To use the XML-API CLI feature, you need thorough knowledge of XML-API, and need to take great
care in formulating commands.
Rather than specifying the command and parameters from the command line, the request can originate
from a file. The file must contain a valid XML document in the correct form for a Device Manager
request. The command line option -i or --input specifies the input file. The other options are still
valid. However, any command or parameter specified from the command line or in the properties
file is ignored, because that information is already in the XML document.
The -i <file-name> option allows you to specify an xml message file. You can use this feature to
request multiple operations from the CLI command, which can save considerable time.
For example, usually the AddLun command specifies creation of a single LUN. The AddLun XML-API
allows you to create multiple LUNs with a single request.
Syntax:
hdvmcli [-t] AddLun
serialnum=<Serial Number> model=<Model Name of Array>
port=<Port #> domain=<HostStorageDomain#>
scsi=<Scsi Target #> lun=<SCSI LU #> devnum=<LDEV #>
Example 1:
To add a LUN to LDEV 0:01 on XP1024/XP128 (Serial:15045), where Port 1-A, HostStorageDomain
0, LU 100 is assigned to that LUN, do the following:
hdvmcli -t AddLun
serialnum=15045 model=XP1024/XP128
port=0 domain=0 scsi=15 lun=100 devnum=1
Following XML-API request will be generated according to specified parameters to hdvmcli;
<?xml version="1.0" encoding="UTF-8"?>
<HiCommandServerMessage>
<APIInfo version="7.1" />
<Request>
<StorageManager>
<Add target="LUN">
<StorageArray objectID="ARRAY.XP1024/XP128.15045">
<Path portID="0" domainID="0" scsiID="15" lun="100" devNum="1" />
</StorageArray>
</Add>
</StorageManager>
</Request>
</HiCommandServerMessage>
Example 2:
Save the following to a file:
<?xml version="1.0" encoding="UTF-8"?>
<HiCommandServerMessage>
<APIInfo version="7.1" />
Device Manager CLI properties file362