To perform failover by failover plan with Veeam PowerShell snap-in, you need to perform the following steps:
- Create VM objects: run New-VBRFailoverPlanObject to create an object for each VM that you want to add to the failover plan.
You can edit the created VM objects with Set-VBRFailoverPlanObject afterwards.
- Create the failover plan: run Add-VBRFailoverPlan to create the failover plan. Use the created VM objects to add VM to your plan.
If you need to edit a created failover plan, run Set-VBRFailoverPlan.
- Launch failover by the failover plan: run Start-VBRFailoverPlan to launch the failover process. Use Get-VBRFailoverPlan to look for the failover plan you need.
You can launch failover plan that were created with UI as well.
- Finalize the failover process:
- Undo failover is the only available option to finalize failover as a group. Undo failover switches workload back to the original VMs, revert replication operations and discard changes made to the working VM replicas. In this case you loose all the changes that were made to the replicas while you failed over to them. Run Undo-VBRFailoverPlan to undo failover of the group.
- Fail back if you want to switch back to the original VMs and keep the changes made to replicas. Run Stop-VBRReplicaFailover. You need to process each VM individually.
- Commit failover if you want to permanently move the workload to replica. Run Start-VBRViReplicaFailover with -Definite parameter. You need to process each VM individually.
This example demonstrates how to create a failover plan for a group of Microsoft Exchange servers and a DNS server, run and undo it.
// Create VM objects:
PS C:\PS> $DNS = Find-VBRViEntity -Name "DNSServer" | New-VBRFailoverPlanObject -BootDelay 0
PS C:\PS> $MSExchange01 = Find-VBRViEntity -Name "MS_Exchange_Server_01" | New-VBRFailoverPlanObject -BootOrder 1 -BootDelay 180
PS C:\PS> $MSExchange02 = Find-VBRViEntity -Name "MS_Exchange_Server_02" | New-VBRFailoverPlanObject -BootOrder 2 -BootDelay 120
// Create failover plan:
PS C:\PS> Add-VBRFailoverPlan -Name "MS Exchange Group Failover" -FailoverPlanObject $DNS, $MSexchange01, $MSExchange02 -Description "Failover plan for the mail servers group: DNS Server, MS Exchange 01 Server, MS Exchange 02 Server"
// Launch failover plan:
PS C:\PS> Get-VBRFailoverPlan -Name "MS Exchange Group Failover" | Start-VBRFailoverPlan
// Undo failover:
PS C:\PS> Get-VBRFailoverPlan -Name "MS Exchange Group Failover" | Undo-VBRFailoverPlan