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


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

ForEach ($FailOverJobID in $FailOverJobIDs){

Run-ResumeReplicationFailover $FailOverJobID


Leave a Reply

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

You are commenting using your 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