Question about Stop-VBRReplicaFailover

PowerShell script exchange

Question about Stop-VBRReplicaFailover

Veeam Logoby johndoe10110 » Fri Jan 20, 2017 2:28 pm

I have read through https://helpcenter.veeam.com/docs/backup/powershell/stop-vbrreplicafailover.html?ver=95 (I am using B&R 9.5).

I test a replica using:
Code: Select all
Get-VBRRestorePoint -Name "VMname" | Sort-Object $_.creationtime -Descending | Select -First 1 | Start-VBRViReplicaFailover -Reason "Failover test" -RunAsync

Works great.

Now, I want to Undo the Failover Test and discard any changes made to the running VM replica. To do this I use Example 1 from the cmdlet URL above:
Code: Select all
Get-VBRRestorePoint -Name "VMname" | Sort-Object $_.creationtime -Descending | Select -First 1 | Stop-VBRReplicaFailover -Reason "Test completed" -RunAsync -Force


It does not work for some reason. I do not get any output errors issuing the command. I end up having to manually connect with Veeam GUI and right click the running/active Replica and selecting "Undo Failover" then acknowledging it will discard any changes made since the last restore point.

Does anyone know why my Stop-VBRReplicaFailover line wouldn't work. Has anyone used it like this?
johndoe10110
Influencer
 
Posts: 19
Liked: 5 times
Joined: Wed Oct 23, 2013 12:49 pm
Full Name: John Dooe

Re: Question about Stop-VBRReplicaFailover

Veeam Logoby v.Eremin » Fri Jan 20, 2017 2:45 pm 1 person likes this post

I would split your code into two separate strings and check them independently to understand what particular portion does not work as expected.

Selection logic:

Code: Select all
$RP = Get-VBRRestorePoint -Name "VMname" | Sort-Object $_.creationtime -Descending | Select -First 1

Undoing logic:

Code: Select all
Stop-VBRReplicaFailover -RestorePoint $RP -Reason "Test completed" -RunAsync -Force

Thanks.
v.Eremin
Veeam Software
 
Posts: 13543
Liked: 1002 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Question about Stop-VBRReplicaFailover

Veeam Logoby johndoe10110 » Fri Jan 20, 2017 2:55 pm

Thanks v.Eremin. I will separate it and try again.

Hmm...regarding the "Force" param. I actually don't tick the "Force" checkbox when doing this in the GUI - just realized this.
I can't quite understand the description in the cmdlet help page. It actually sounds wrong unless I not reading it right.
johndoe10110
Influencer
 
Posts: 19
Liked: 5 times
Joined: Wed Oct 23, 2013 12:49 pm
Full Name: John Dooe

Re: Question about Stop-VBRReplicaFailover

Veeam Logoby v.Eremin » Mon Jan 23, 2017 11:19 am 1 person likes this post

The force switch refers to "forcing undo failover" which is described here. If you forcing undo failover is not needed, disregard the given cmdlet switch. Thanks.
v.Eremin
Veeam Software
 
Posts: 13543
Liked: 1002 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin


Return to PowerShell



Who is online

Users browsing this forum: robjohnston, Yahoo [Bot] and 4 guests