HP StorageWorks SAN Virtualization Services Platform Manager command line interface user guide (AG781-96016, March 2009)

CLI file location
The path to the VSM CLI files is set in the system path on all Windows platforms, so you can run the
CLI from any folder. In other operating systems, the CLI is installed in the following paths:
HP-UX: /opt/vsmcli/bin/VSMCli
Linux: /sbin/VSMCLI
Automating storage-related tasks
The following are examples of scripts written to perform some common storage-related tasks. The
explanations of each CLI command are included in the following sections.
Creating PiTs
Below is a script that can be periodically invoked to:
Create a PiT on a virtual disk named vol1.
Always keep the last four PiTs (including the most recently created PiT).
OnErrorGoto Exit
CreatePiT -VirtualDisk "vol1", -PiT "PIT_0" TEMPLATE, -timeout 900
PurgePiTsOrSnapshots -PiT, -template "PIT_0", -keep 4
Exit:
Creating multiple copies
Below is a script that can be periodically invoked to:
Create a snapclone (task) of a virtual disk vol1.
Always keep the last four virtual disks (including the virtual disk most recently created).
OnErrorGoto Exit
CreateSnapcloneGroupEx -group "MC_LOGS", -VirtualDisk "vol1", ~
-task "LOGS-0" _priority 1 _StoragePool "pool1" _host "W2K_SRVR" ~
_permission OFF, -timeout 900
PurgeVirtualDisks -Template "LOGS-0", -Group "MC_LOGS", -Keep 3
Exit:
NOTE:
Initially, a snapclone does not create the actual destination virtual disk. It creates only a snapshot that
eventually is turned into a virtual disk. Consequently, when the purge command is executed, there is
no real virtual disk for the last snapclone operation, so one less copy is kept at this time (the fourth
virtual disk is created at the end of the snapclone operation).
Backup
Below is a script that could be periodically invoked to back up a virtual disk of some application
using your backup application of choice. The script should leave the PiTs and snapshots alive until
the next execution.
HP StorageWorks SAN Virtualization Services Platform Manager command line interface user
guide 21