PowerShell script exchange
Post Reply
johndoe10110
Influencer
Posts: 22
Liked: 5 times
Joined: Oct 23, 2013 12:49 pm
Full Name: John Dooe
Contact:

Question about Stop-VBRReplicaFailover

Post by johndoe10110 »

I have read through https://helpcenter.veeam.com/docs/backu ... tml?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?
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Question about Stop-VBRReplicaFailover

Post by veremin » 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.
johndoe10110
Influencer
Posts: 22
Liked: 5 times
Joined: Oct 23, 2013 12:49 pm
Full Name: John Dooe
Contact:

Re: Question about Stop-VBRReplicaFailover

Post by johndoe10110 »

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.
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Question about Stop-VBRReplicaFailover

Post by veremin » 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 19 guests