Set-VBRFailoverPlan
Short Description
Modifies a selected failover plan or cloud failover plan.
Applies to
Platform: VMware, Hyper-V
Product Edition: Enterprise, Enterprise Plus
Syntax
Set-VBRFailoverPlan -FailoverPlan <VBRFailoverPlan> [-Name <string>] [-Description <string>] [-FailoverPlanObject <VBRFailoverPlanObject[]>] [-PrefailoverCommand <string>] [-PostfailoverCommand <string>] [-EnablePublicIpRule] [-PassThru] [<CommonParameters>] |
Detailed Description
This cmdlet modifies settings of an existing failover plan or cloud failover plan. To modify settings, you need to enter the corresponding parameters with new values. The parameters that you omit will remain unchanged.
Parameters
Parameter | Description | Required | Position | Accept | Accept |
FailoverPlan | Specifies the failover plan or cloud failover plan you want to modify. Accepts VBRFailoverPlan or VBRCloudFailoverPlan types. | True | Named | True (ByValue, | False |
Name | Specifies the new name you want to assign to the failover plan. | False | Named | False | False |
Failover | Specifies the array of VMs or cloud VMs you want to add to the failover plan. Accepts VBRFailoverPlanObject or VBRCloudFailoverPlanObject types. | False | Named | False | False |
Description | Specifies the new description you want to apply to the failover plan. | False | Named | False | False |
PrefailoverCommand | Specifies the path to the script you want to automatically run before failing over to replicas. | False | Named | False | False |
PostfailoverCommand | Specifies the path to the script you want to automatically run after failing over to replicas is complete. | False | Named | False | False |
Enable | If set, the failover plan will use the public IP rules configured in the VBRFailoverPlanObject or VBRCloudFailoverPlanObject objects. | False | Named | False | False |
PassThru | Indicates that the command returns the output object to the Windows PowerShell console. | False | Named | False | False |
<CommonParameters>
This cmdlet supports Microsoft PowerShell common parameters. For more information on common parameters, see the About CommonParameters section of Microsoft Docs.
Return Type
Example 1
This command adds one more server to the failover plan named "MS Exchange Group Failover".
- Create a new failover plan object for the new VM. For details, see New-VBRFailoverPlanObject. Save the object to the $MSExchangeServer03 variable.
- Run Get-VBRFailoverPlan to get the failover plan and save it to the '$MSExchangePlan' variable.
- Get the VMs (failover plan objects) that are currently in the failover plan. Save the array to the $MSExchangeGroup variable.
- Add the new failover plan object to the array.
- Run Set-VBRFailoverPlan using the $MSExchangePlan variable and the updated array of the failover plan objects.
$MSExchangeServer03 = Find-VBRViEntity -Name "MS Exchange Server 03" $MSExchangePlan = Get-VBRFailoverPlan -Name "MS Exchange Group Failover" $MSExchangeGroup = $MSExchangePlan.FailoverObject $MSExchangeGroup += $MSExchangeServer03 Set-VBRFailoverPlan -FailoverPlan $MSExchangePlan -FailoverPlanObject $MSExchangeGroup -Description "Failover plan for the mail servers group: UPDATED" |
Example 2
[Cloud provider] This command adds a pre-failover script to a tenant failover plan named "ABC Company Failover Plan".
- Run Get-VBRFailoverPlan to get the failover plan of the tenant stored in the $tenant variable. Save the failover plan to the $failoverplan variable.
- Run Set-VBRFailoverPlan with the $failoverplan variable. Use the -PrefailoverCommand parameter to add the path to the script to the failover plan.
$failoverplan = Get-VBRFailoverPlan -Tenant $tenant -Name "ABC Company Failover Plan" Set-VBRFailoverPlan -FailoverPlan $failoverplan -PrefailoverCommand "C:\Users\Administrator\TriggerEmailNotification.cmd" |
Related Commands