PowerShell script exchange
Post Reply
dcd62
Enthusiast
Posts: 39
Liked: 4 times
Joined: Aug 20, 2014 1:00 pm
Contact:

How to get job name in post job command

Post by dcd62 »

I'm using Veeam to migrate virtual machines from one datacenter to another and I don't plan on failing back. Is it necessary to perform both the temporary failover and then the permanent failover or can I go straight to the permanent failover. I would rather only perform one step if possible (the second command).

I was scripting the process and would first run this command to perform the temporary failover:
Get-VBRRestorePoint -Name $VM | Sort-Object $_.creationtime -Descending | Select -First 1 | Start-VBRViReplicaFailover -Reason "Migration" -RunAsync -Confirm: $true

Then run this to perform the Permanent failover:
Get-VBRRestorePoint -Name $VM | Sort-Object $_.creationtime -Descending | Select -First 1 | Start-VBRViReplicaFailover -Reason "Migration" -RunAsync -Definite -Confirm: $true
veremin
Product Manager
Posts: 20282
Liked: 2257 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Failover process temp vs perm

Post by veremin »

If my memory serves me well, the second one-liner should be enough to achieve what you're after. You can also use -Planned switch to perform planned failover. Thanks.
dcd62
Enthusiast
Posts: 39
Liked: 4 times
Joined: Aug 20, 2014 1:00 pm
Contact:

Re: Failover process temp vs perm

Post by dcd62 »

Great, I performed a test and it seems to work OK. I looked at the planned failover and thought that would also be an option. But it doesn't commit the snapshot and I need to completely failover over.
Thanks for your help!
veremin
Product Manager
Posts: 20282
Liked: 2257 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Failover process temp vs perm

Post by veremin »

Ok, If I were you and were after migration script making use of replication functionality, I would write something like this:

- Shutdown source VMs (PowerCLI)
- Run replication jobs to transfer final changes happened after the latest replication cycle (VB&R PS snap-in)
- Perform permanent failover (VB&R PS snap-in)

Thanks.
dcd62
Enthusiast
Posts: 39
Liked: 4 times
Joined: Aug 20, 2014 1:00 pm
Contact:

Re: Failover process temp vs perm

Post by dcd62 » 1 person likes this post

Yes, I've done that and it's working fine. .Thanks again
veremin
Product Manager
Posts: 20282
Liked: 2257 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Failover process temp vs perm

Post by veremin »

Great minds think alike. :) Just kidding, glad to hear that you were able to achieve your goal, using combination of VMware PowerCLI and Veeam PowerShell snap-in. Thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests