HP StorageWorks SAN Virtualization Services Platform Manager Command Line Interface User Guide (5697-0936, May 2011)

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" ~
_presentation 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.
# cleanup after last run.
# (May also be set in a post-backup script.)
AllowExecErrors
UnmountVirtualDisk -VirtualDisk "FV1_v"
DeletePiTOrSnapshot -name "FV1_v", -TIMEOUT 900
DeletePiTOrSnapshot -name "FV1_f", -TIMEOUT 10800
DisallowExecErrors
# start actual work
OnErrorGoto ExitScript# --- Quiesce application (if applicable)
# --- Possibly: Flush OS cache - on App Server!
OnErrorGoto CleanPiT
CreatePiT -VirtualDisk "E2K_Store1", ~
-PiT "FV1_f", -TIMEOUT 900
# --- Resume application (if applicable)
OnErrorGoto CleanAll
CreateSnapshot -PiT "FV1_f", -snapshot "FV1_v", ~
-StoragePool "LogPool", -host "Backup_Server" RW , ~
-cluster 0, -TIMEOUT 900
MountVirtualDisk -MountPoint q:\, -VirtualDisk "FV1_v", ~
-Override
OnErrorGoto
Run -command YourBackupApplication.EXE
Quit
CleanAll:
AllowExecErrors
UnmountVirtualDisk -VirtualDisk "FV1_v"
DeletePiTOrSnapshot -name "FV1_v", -TIMEOUT 900
DeletePiTOrSnapshot -name "FV1_f", -TIMEOUT 10800
DisallowExecErrors
Quit
CleanPiT:
# --- Resume application (if applicable)
DeletePiTOrSnapshot -name "FV1_f", -TIMEOUT 10800
ExitScript:
Quit
Some backup applications execute backup tasks asynchronously. Consequently, the backed up
virtual disk or snapshot must remain alive until after the backup task is actually completed. This
18 Using the VSM command line interface