beautypg.com

HP P6000 Continuous Access Software User Manual

Page 16

background image

//

// Rollback.

DeleteReplicaRepository ( $Repository1, FALSE )

E4: UnmountHostVolume ( $MP1 ) onerror pauseat E4:

E3: DeleteHostVolume ( $HV1 ) onerror pauseat E3:

E2: DeleteStorageVolumes ( $Rep1 ) onerror pauseat E2:

Exit ( SUCCESS )

//

// Failure exit - no rollback needed.

E1: Exit ( FAILURE )

Sample HP Replication Solutions Manager snapclone job using replicate wizard

The following is a RSM sample script to take snapclone of a SQL database (W: drive) and mount the
snapshot on a backup server ( L: drive). This script is generated using the RSM Job Template Creation
wizard (Business Copy template for host volumes > Replicate host volumes, mount to a host template
(select the check box Use Snapclone). The variables are displayed in italics.

// Replicate host volume(s), and mount to a host.

// Assign some variables that will be used in this job.

$source_host1 = SetVariable ( " Production Server IP " )

$mount_host = SetVariable ( " Backup Server IP " )

$source_hostvol_unc 1 = SetVariable ( "\\ProductionServerHostName\W:\" )

//

// Validate that resources are as expected.

ValidateHost ( $source_host1 )

ValidateHost ( $mount_host )

ValidateHostVolume ( $source_hostvol_unc 1 )

ValidateSnapcloneHostVolume ( $source_hostvol_unc 1 )

//

// Suspend the host application.

Launch ( $source_host1, " c:\pre.bat ", "", WAIT, "" ) onerror pauseat E1:

/ /

DO {

// Perform the replication.

$Rep1 = SnapcloneHostVolume ( $source_hostvol_unc1, SAME, NOWAIT ) onerror pauseat E1:

//

} ALWAYS {

//

// Resume the host application.

Launch ( $source_host1, " c:\post.bat ", "", WAIT, "" )

/ /

}

//

// Wait for replicated storage to appear.

WaitForStorageVolu mesDiscovery ( $ Rep 1 )

//

// Mount the replicated volume(s) on a host.

PresentStorageVolumes ( $Rep1, $mount_host ) onerror pauseat E2:

DiscoverDiskDevices ( $mount_host, $Rep1 ) onerror continue

$HV1 = CreateHostVolumeFromDiskDevices ( $source_hostvol_unc1, $Rep1, $mount_host ) onerror

pauseat E2:

$MP1 = MountHostVolume ( $HV1, "L" ) onerror pauseat E3:

//

// Add the replica(s) to the repository.

$ Repository 1 = CreateRepl ica Repository ( HOST_VOLUME, $source_hostvol_u nc 1,

INSTANT_RESTORE, "" )

AddReplicasToReplicaRepository ( $Repository1, $Rep1 )

//

// Wait for user to initiate rollback.

Pause ( )

Creating snapshot backups using HP DButil

16