你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Start-AzRecoveryServicesAsrPlannedFailoverJob

Starts a planned failover operation.

Syntax

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

Description

The Start-AzRecoveryServicesAsrPlannedFailoverJob 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-AzRecoveryServicesAsrJob cmdlet.

Examples

Example 1

$currentJob = Start-AzRecoveryServicesAsrPlannedFailoverJob -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:AzContext, 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

-MultiVmSyncPoint

Specifies whether to enable multi VM sync points for failover of multi VM sync enabled VMs (Applicable only for VMware to Azure replication scenario).

Type:String
Accepted values:Enable, Disable
Position:Named
Default value:None
Required:False
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

-RecoveryTag

Specifies the recovery tag: RecoveryTagApplicationConsistent, RecoveryTagCrashConsistent (Applicable only for VMware to Azure replication scenario).

Type:String
Accepted values:RecoveryTagApplicationConsistent, RecoveryTagCrashConsistent
Position:Named
Default value:None
Required:True
Accept pipeline input:False
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

ASRReplicationProtectedItem

Outputs

ASRJob