beautypg.com

HP P6000 Continuous Access Software User Manual

Page 15

background image

E7: DeleteHostVolume ( $HV2 ) onerror pauseat E7:

E6: DeleteHostVolume ( $HV1 ) onerror pauseat E6:

E5: DeleteStorageVolumes ( $Rep4 ) onerror pauseat E5:

E4: DeleteStorageVolumes ( $Rep3 ) onerror pauseat E4:

E3: DeleteStorageVolumes ( $Rep2 ) onerror pauseat E3:

E2: DeleteStorageVolumes ( $Rep1 ) onerror pauseat E2:

Exit ( SUCCESS )

E1: Exit ( FAILURE )

Sample HP Replication Solutions Manager snapshot job using replicate wizard

The following is a RSM sample script to create a snapshot of a SQL database (of W: drive) and to
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 volume(s), mount to a host
template). The variables are shown 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 )

Val idateHostVolume ( $source_hostvol_unc 1 )

ValidateSnapshotHostVolu me ( $source_hostvol_u nc 1 )

//

// Suspend the host application.

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

//

DO {

// Perform the replication.

$Rep1 = SnapshotHostVolume ( $source_hostvol_unc1, FULLY_ALLOCATED, SAME, NOWAIT )

one rror 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 icaRepository ( HOST_VOLUME, $source_hostvol_u nc 1,

INSTANT_RESTORE, "" )

AddReplicasToReplicaRepository ( $Repository1, $Rep1 )

//

// Wait for user to initiate rollback.

Pause ( )

//

HP StorageWorks DButil user guide

15