Scripted failover testing in vRanger / vReplicator

Posted: May 9, 2012 in Scripts, VMware

For anyone who uses Quest’s vRanger or vReplicator, you’ll most likely be aware of the lack of multi-select options available for job management. I was becoming increasingly frustrated until I remember how much Quest like to tie in Powershell to their products. So, after some mucking around with their commandlets, I came up with a way to initiate a failover test and once completed, restore everything back.

$FailOverJobIDs = @()

$ReplicationJobIDs = Get-JobTemplate -Type Replication | Where { $_.IsEnabled -eq $True } | Select TemplateVersionID

ForEach ($ReplicationJobID in $ReplicationJobIDs){

Run-TestReplicationFailover -TemplateVersionId $ReplicationJobID.TemplateVersionId | Tee-Object -Variable TempID
$FailOverJobIDs = $FailOverJobIDs + $TempID

}
Clear

Write-Host “All jobs have been queued. Once all VMs have been checked, press any key to revert back to normal mode”
Read-Host

ForEach ($FailOverJobID in $FailOverJobIDs){

Run-ResumeReplicationFailover $FailOverJobID

}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s