Start-​Azure​Rm​Recovery​Services​Asr​Planned​Failover​Job

Starts a planned failover operation.

Syntax

Start-AzureRmRecoveryServicesAsrPlannedFailoverJob
     [-CreateVmIfNotFound <String>]
     [-DataEncryptionPrimaryCertFile <String>]
     [-DataEncryptionSecondaryCertFile <String>]
     -Direction <String>
     [-Optimize <String>]
     -RecoveryPlan <ASRRecoveryPlan>
     [-Confirm]
     [-WhatIf]
     [<CommonParameters>]
Start-AzureRmRecoveryServicesAsrPlannedFailoverJob
     [-CreateVmIfNotFound <String>]
     [-DataEncryptionPrimaryCertFile <String>]
     [-DataEncryptionSecondaryCertFile <String>]
     -Direction <String>
     [-Optimize <String>]
     -ReplicationProtectedItem <ASRReplicationProtectedItem>
     [-ServicesProvider <ASRRecoveryServicesProvider>]
     [-Confirm]
     [-WhatIf]
     [<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.

Required Parameters

-Direction

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

  • PrimaryToRecovery
  • RecoveryToPrimary
Type:String
Parameter Sets:PrimaryToRecovery, RecoveryToPrimary
Position:Named
Default value:None
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
Accept pipeline input:True (ByValue)
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
Accept pipeline input:True (ByValue)
Accept wildcard characters:False

Optional Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
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
Parameter Sets:Yes, No
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DataEncryptionPrimaryCertFile

Specifies the primary certificate file.

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

Specifies the secondary certificate file.

Type:String
Position:Named
Default value:None
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 a 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
Parameter Sets:ForDownTime, ForSynchronization
Position:Named
Default value:None
Accept pipeline input:False
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
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
Accept pipeline input:False
Accept wildcard characters:False

Inputs

Microsoft.Azure.Commands.RecoveryServices.SiteRecovery.ASRRecoveryPlan

Microsoft.Azure.Commands.RecoveryServices.SiteRecovery.ASRReplicationProtectedItem

Outputs

Microsoft.Azure.Commands.RecoveryServices.SiteRecovery.ASRJob