PowerShell script exchange
Post Reply
fla
Novice
Posts: 4
Liked: never
Joined: Mar 25, 2013 10:03 am
Full Name: fla
Contact:

Failback script, commitfailback command

Post by fla »

Hi,

I'm building scripts to manage the failover and the failback of a vmware infrastructure.
No problem for the failover script, but for the failback I don't find the command to do the "commitfailback".

Does someone know this command?

Thanks in advance
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Failback script, commitfailback command

Post by veremin »

First of all, you have to failover to the existing replica in DR site:

Code: Select all

asnp VeeamPSSnapin
$RestorePoint = Get-VBRReplica -name "Name of your Replication Job" | Get-VBRRestorePoint | ? {$_.VmName -eq "Name of your VM"} | Sort-Object CreationTime -Descending | Select -First 1
Start-VBRViReplicaFailover -RestorePoint $RestorePoint -Confirm:$False
Then, perform a failback operation:

Code: Select all

Start-VBRViReplicaFailback -RestorePoint $RestorePoint
And finally commit it:

Code: Select all

$RestorePoint = Get-VBRReplica -name "Name of your replication job" | Get-VBRRestorePoint | ? {$_.VmName -eq "Name of your VM"} | Sort-Object CreationTime -Descending | Select -First 1
Start-VBRViReplicaFailback -RestorePoint $RestorePoint -Complete: $True
Please, be aware that you’ll probably need to run the line which starts with $RestorePoint once again in order to catch point that will be created during failback operation (the last one), that’s why I put it here.

As always, don't forget to test it before implementing.

Hope this helps.
Thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 17 guests