How to launch a failover job?

PowerShell script exchange

How to launch a failover job?

Veeam Logoby jcd29 » Mon Oct 22, 2012 1:26 pm

Hello everybody,

I'm trying to launch a failover job using start-vbrreplicafailover cmdlet.
I didn't find any example neither in the official guide nor anywhere.

The cmdlet expects a "restorepoint". What is it like?
How to get the last restorepoint of a replica?

Thanks in advance,
JCD
jcd29
Lurker
 
Posts: 2
Liked: never
Joined: Mon Oct 22, 2012 1:16 pm
Full Name: JCD

Re: How to launch a failover job?

Veeam Logoby trav219 » Wed Oct 24, 2012 1:53 am 1 person likes this post

Hi JCD,

What I was able to work out is that you need to get the Replica first, then the Restore point and that is then sufficient to start the failover.

This should work:
Code: Select all
Get-VBRReplica | ?{$_.Name -eq $Job} | Get-VBRRestorePoint | ?{$_.VmName -eq $VMName} | sort CreationTime -Descending | Select -First 1 | Start-VBRReplicaFailover -Confirm:$false


Regards

Trav
trav219
Lurker
 
Posts: 1
Liked: 1 time
Joined: Wed Oct 24, 2012 1:43 am
Full Name: Travis

Re: How to launch a failover job?

Veeam Logoby jcd29 » Wed Oct 24, 2012 12:47 pm

Hi Trav,

that's just great!!
Thanks a lot for your reply!!
It's exactly what I was looking for, but my poor PowerShell skills couldn't get over it!

Have a nice day,
JCD
jcd29
Lurker
 
Posts: 2
Liked: never
Joined: Mon Oct 22, 2012 1:16 pm
Full Name: JCD

Re: How to launch a failover job?

Veeam Logoby rvas » Fri Dec 28, 2012 10:21 am

Hi,

The script for failover works fine but then how to launch a failback job?

Regards
Ryan
rvas
Lurker
 
Posts: 2
Liked: never
Joined: Fri Dec 28, 2012 10:19 am
Full Name: Ryan Vassallo

Re: How to launch a failover job?

Veeam Logoby v.Eremin » Fri Dec 28, 2012 12:35 pm

I don’t have a chance to look closer right now, but, I think, Start-VBRViReplicaFailback(for VMware) or Start-VBRHvReplicaFailback(Hyper-V) should work fine.

Additionally, feel free to use Get-VBRCommand in order to see all available methods provided by Veeam PSSnapin.

Hope this helps.

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

Re: How to launch a failover job?

Veeam Logoby rvas » Fri Dec 28, 2012 12:51 pm

The issue when I tried to use that command is that it asks for restore point parameters which I couldn't find any information about them, any advice please?
Regards,
RVAS
rvas
Lurker
 
Posts: 2
Liked: never
Joined: Fri Dec 28, 2012 10:19 am
Full Name: Ryan Vassallo

Re: How to launch a failover job?

Veeam Logoby Sethbartlett » Thu Jan 03, 2013 10:15 pm 1 person likes this post

Restore Points can be grabbed from Get-VBRRestorePoint I believe is the cmdlet, not currently at a shell to check. If you use Get-VBRCommand in the Veeam Snapin, you will get a list of cmdlets. Restore points will either have their own cmdlet or be retrievable from a method off of Get-VBRBackup object.
Skype: Sethbartlett88 - Make sure to label who you are and why you want to add me ;)
Twitter: @sethbartlett
If my post was helpful, please like it. Sometimes twitter is quicker to hit me up if you need me.
Sethbartlett
Expert
 
Posts: 282
Liked: 25 times
Joined: Wed Nov 10, 2010 6:51 pm
Full Name: Seth Bartlett


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 6 guests