Edit

Share via


Start-AzRecoveryServicesAsrClusterTestFailoverJob

Starts a test failover operation for a cluster.

Syntax

Start-AzRecoveryServicesAsrClusterTestFailoverJob
     -ReplicationProtectionCluster <ASRReplicationProtectionCluster>
     -Direction <String>
     [-ClusterRecoveryPoint <ASRClusterRecoveryPoint>]
     [-ListNodeRecoveryPoint <System.Collections.Generic.List`1[System.String]>]
     [-LatestProcessedRecoveryPoint]
     -AzureVMNetworkId <String>
     [-DefaultProfile <IAzureContextContainer>]
     [-WhatIf]
     [-Confirm]
     [<CommonParameters>]

Description

The Start-AzRecoveryServicesAsrClusterTestFailoverJob cmdlet starts test failover of an Azure Site Recovery replication protection cluster. You can check whether the job succeeded by using the Get-AzRecoveryServicesAsrJob cmdlet.

Examples

Example 1

$currentJob = Start-AzRecoveryServicesAsrClusterTestFailoverJob -ReplicationProtectionCluster $protectionCluster -Direction PrimaryToRecovery -AzureVMNetworkId $TestRecoveryNetwork -LatestProcessedRecoveryPoint

Starts a test failover operation for the specified cluster. If LatestProcessedRecoveryPoint is passed and no specific recovery point is provided, it will pick the lastest processed recovery points and the ASR job used to track the operation.

Example 2

$currentJob = Start-AzRecoveryServicesAsrClusterTestFailoverJob -ReplicationProtectionCluster $protectionCluster -Direction PrimaryToRecovery -AzureVMNetworkId $TestRecoveryNetwork -ClusterRecoveryPoint $clusterRecoveryPoint -ListNodeRecoveryPoint $nodeRecoveryPoints

Starts a test failover operation for the specified cluster and by passing ClusterRecoveryPoint and NodeRecoveryPoints, it will pick the specified recovery points and returns the ASR job used to track the operation.

Parameters

-AzureVMNetworkId

Specifies the Azure vm network id for recovery VM after failover.

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

-ClusterRecoveryPoint

Specifies the recovery point for the cluster.

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

-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

-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 failover direction. 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

-LatestProcessedRecoveryPoint

Fetch the latest processed recovery points if not passed for cluster or any individual node.

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

-ListNodeRecoveryPoint

Specifies the recovery points for the nodes which are not part of cluster recovery point.

Type:List<T>[String]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ReplicationProtectionCluster

Specifies the replication protection cluster.

Type:ASRReplicationProtectionCluster
Position:Named
Default value:None
Required:True
Accept pipeline input:True
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

ASRReplicationProtectionCluster

Outputs

ASRJob