RSM scripts

 
JFoster
Occasional Contributor

RSM scripts

Hi there,

I am trying to setup rolling snapshots of a few EVA vdisks. Has anyone got a script to do this already? I am looking at doing a few snapshots a day, and rolling this round day after day.
I can do the snapshot via rsm, but i cant work out how to do a rolling snapshot and how to delete the oldest snapshots.

Thanks,
me

 

 

P.S. This thread has been moevd from General to Storage Area Networks (SAN) (Enterprise). - Hp Forum Moderator

2 REPLIES 2
Kumdist
Valued Contributor

Re: RSM scripts

I am also facing the same issue here.. Have you found a solution yet??

Cali
Honored Contributor

Re: RSM scripts

OK

This is one of four rolling Jobs:

You can create a empty Job and paste it with strg+v.

 

// Replicate host volume(s), and mount to a host.                        
//                        
// An e-mail will be sent when the job changes state (completion, failure, etc.).                        
SetNotificationPolicy ( "name@abc.com", JOB_STARTED_OR_STOPPED )
//                        
// Assign some variables that will be used in this job.                        
$source_eva = SetVariable ( "EVA2" )
$source_vol = SetVariable ( "\\EVA2\SAP\SAPORAC20-E" )
$source_host = SetVariable ( "saporac20" )
$snap_volname = SetVariable ( "SAPORAC20-E-Snap2" )
$snap_vol = SetVariable ( "\\EVA2\SAP\SAPORAC20-E\SAPORAC20-E-Snap2" )
//                        
// Validate that resources are as expected.                        
ValidateStorageSystem ( $source_eva ) onerror goto E1:
ValidateStorageVolume ( $source_vol ) onerror goto E1:
ValidateHost ( $source_host ) onerror goto E1:
E2: ValidateStorageVolume ( $snap_vol ) onerror goto E3:
//                     
// Delete old Snapshot                     
DeleteStorageVolume ( $snap_vol ) onerror goto E2:
//                     
// Make Snapshot                     
E3: ValidateSnapshotStorageVolume ( $source_vol ) onerror goto E1:
//                        
// Suspend the host application.                        
DO {
Launch ( $source_host, "e:\snap\Snap-Pre.bat", "", WAIT, "0" )
$repl1 = SnapshotStorageVolume ( $source_vol, DEMAND_ALLOCATED, SAME, $snap_volname, NOWAIT ) onerror goto E1:
} ALWAYS {
// Resume the host application                     
Launch ( $source_host, "e:\snap\Snap-Post.bat", "", WAIT, "0" )
}
//                        
//                     
// Wait for replicated storage to appear.                        
WaitForStorageVolumeDiscovery ( $repl1 ) onerror goto E1:
//                        
Exit ( SUCCESS )
//                        
// Failure exit - no rollback needed.                        
E1: Exit ( FAILURE )


======================
I'm not an HPE employee, so I can be wrong.