Start-AzureRmRecoveryServicesAsrPlannedFailoverJob

Starts a planned failover operation.

Warning

The AzureRM PowerShell module has been officially deprecated as of February 29, 2024. Users are advised to migrate from AzureRM to the Az PowerShell module to ensure continued support and updates.

Although the AzureRM module may still function, it's no longer maintained or supported, placing any continued use at the user's discretion and risk. Please refer to our migration resources for guidance on transitioning to the Az module.

Syntax

Start-AzureRmRecoveryServicesAsrPlannedFailoverJob
     -ReplicationProtectedItem <ASRReplicationProtectedItem>
     -Direction <String>
     [-Optimize <String>]
     [-CreateVmIfNotFound <String>]
     [-ServicesProvider <ASRRecoveryServicesProvider>]
     [-DataEncryptionPrimaryCertFile <String>]
     [-DataEncryptionSecondaryCertFile <String>]
     [-DefaultProfile <IAzureContextContainer>]
     [-WhatIf]
     [-Confirm]
     [<CommonParameters>]
Start-AzureRmRecoveryServicesAsrPlannedFailoverJob
     -RecoveryPlan <ASRRecoveryPlan>
     -Direction <String>
     [-Optimize <String>]
     [-CreateVmIfNotFound <String>]
     [-DataEncryptionPrimaryCertFile <String>]
     [-DataEncryptionSecondaryCertFile <String>]
     [-DefaultProfile <IAzureContextContainer>]
     [-WhatIf]
     [-Confirm]
     [<CommonParameters>]

Description

The Start-AzureRmRecoveryServicesAsrPlannedFailoverJob cmdlet starts a planned failover for an Azure Site Recovery replication protected item or recovery plan. You can check whether the job succeeds by using the Get-AzureRmRecoveryServicesAsrJob cmdlet.

Examples

Example 1

PS C:\> $currentJob = Start-AzureRmRecoveryServicesAsrPlannedFailoverJob -RecoveryPlan $RP -Direction PrimaryToRecovery

Starts the planned failover for the specified ASR recovery plan and returns the ASR job used to track the operation.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-CreateVmIfNotFound

Create the virtual machine if not found while failing back to the primary region (used in alternate location recovery.) The acceptable values for this parameter are:

  • Yes
  • No
Type:String
Accepted values:Yes, No
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DataEncryptionPrimaryCertFile

Specifies the primary certificate file.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DataEncryptionSecondaryCertFile

Specifies the secondary certificate file.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Direction

Specifies the direction of the failover. The acceptable values for this parameter are:

  • PrimaryToRecovery
  • RecoveryToPrimary
Type:String
Accepted values:PrimaryToRecovery, RecoveryToPrimary
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Optimize

Specifies what to optimize for. This parameter applies when failover is done from an Azure site to an on-premise site which requires substantial data synchronization. Valid values are:

  • ForDowntime
  • ForSynchronization

When ForDowntime is specified, this indicates that data is synchronized before failover to minimize downtime. Synchronization is performed without shutting down the virtual machine. After synchronization is complete, the job is suspended. Resume the job to do an additional synchronization operation that shuts down the virtual machine.

When ForSynchronization is specified, this indicates that data is synchronized during failover only so data synchronization is minimized. With this setting enabled, the virtual machine is shut down immediately. Synchronization starts after shutdown to complete the failover operation.

Type:String
Accepted values:ForDownTime, ForSynchronization
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RecoveryPlan

Specifies the ASR Recovery plan object corresponding to the recovery plan to be failed over.

Type:ASRRecoveryPlan
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-ReplicationProtectedItem

Specifies the ASR replication protected item object corresponding to the replication protected item to be failed over.

Type:ASRReplicationProtectedItem
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-ServicesProvider

Identifies the host to on which to create the virtual machine while failing over to an alternate location by specifying the ASR services provider object corresponding to the ASR services provider running on the host.

Type:ASRRecoveryServicesProvider
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

ASRRecoveryPlan

Microsoft.Azure.Commands.RecoveryServices.SiteRecovery.ASRReplicationProtectedItem

Outputs

ASRJob