Edit

Share via


Start-AzureSiteRecoveryTestFailoverJob

Starts a test failover for a Site Recovery protection entity.

Note

The cmdlets referenced in this documentation are for managing legacy Azure resources that use Azure Service Manager (ASM) APIs. This legacy PowerShell module isn't recommended when creating new resources since ASM is scheduled for retirement. For more information, see Azure Service Manager retirement.

The Az PowerShell module is the recommended PowerShell module for managing Azure Resource Manager (ARM) resources with PowerShell.

Syntax

ByPEId (Default)

Start-AzureSiteRecoveryTestFailoverJob
    -Direction <String>
    -ProtectionEntityId <String>
    -ProtectionContainerId <String>
    [-Network <ASRNetwork>]
    [-NetworkType <String>]
    [-WaitForCompletion]
    [-Profile <AzureSMProfile>]
    [<CommonParameters>]

ByRPId

Start-AzureSiteRecoveryTestFailoverJob
    -RpId <String>
    -Direction <String>
    [-Network <ASRNetwork>]
    [-NetworkType <String>]
    [-WaitForCompletion]
    [-Profile <AzureSMProfile>]
    [<CommonParameters>]

ByRPIdWithLogicalNetworkID

Start-AzureSiteRecoveryTestFailoverJob
    -RpId <String>
    -Direction <String>
    -LogicalNetworkId <String>
    [-Network <ASRNetwork>]
    [-NetworkType <String>]
    [-WaitForCompletion]
    [-Profile <AzureSMProfile>]
    [<CommonParameters>]

ByRPIdWithVMNetworkID

Start-AzureSiteRecoveryTestFailoverJob
    -RpId <String>
    -Direction <String>
    -VmNetworkId <String>
    [-Network <ASRNetwork>]
    [-NetworkType <String>]
    [-WaitForCompletion]
    [-Profile <AzureSMProfile>]
    [<CommonParameters>]

ByRPIdWithVMNetwork

Start-AzureSiteRecoveryTestFailoverJob
    -RpId <String>
    -Network <ASRNetwork>
    -Direction <String>
    [-NetworkType <String>]
    [-WaitForCompletion]
    [-Profile <AzureSMProfile>]
    [<CommonParameters>]

ByPEObjectWithVMNetwork

Start-AzureSiteRecoveryTestFailoverJob
    -Network <ASRNetwork>
    -Direction <String>
    -ProtectionEntity <ASRProtectionEntity>
    [-NetworkType <String>]
    [-WaitForCompletion]
    [-Profile <AzureSMProfile>]
    [<CommonParameters>]

ByRPObjectWithVMNetwork

Start-AzureSiteRecoveryTestFailoverJob
    -Network <ASRNetwork>
    -RecoveryPlan <ASRRecoveryPlan>
    -Direction <String>
    [-NetworkType <String>]
    [-WaitForCompletion]
    [-Profile <AzureSMProfile>]
    [<CommonParameters>]

ByPEIdWithVMNetwork

Start-AzureSiteRecoveryTestFailoverJob
    -Network <ASRNetwork>
    -Direction <String>
    -ProtectionEntityId <String>
    -ProtectionContainerId <String>
    [-NetworkType <String>]
    [-WaitForCompletion]
    [-Profile <AzureSMProfile>]
    [<CommonParameters>]

ByRPObject

Start-AzureSiteRecoveryTestFailoverJob
    -RecoveryPlan <ASRRecoveryPlan>
    -Direction <String>
    [-Network <ASRNetwork>]
    [-NetworkType <String>]
    [-WaitForCompletion]
    [-Profile <AzureSMProfile>]
    [<CommonParameters>]

ByRPObjectWithLogicalNetworkID

Start-AzureSiteRecoveryTestFailoverJob
    -RecoveryPlan <ASRRecoveryPlan>
    -Direction <String>
    -LogicalNetworkId <String>
    [-Network <ASRNetwork>]
    [-NetworkType <String>]
    [-WaitForCompletion]
    [-Profile <AzureSMProfile>]
    [<CommonParameters>]

ByRPObjectWithVMNetworkID

Start-AzureSiteRecoveryTestFailoverJob
    -RecoveryPlan <ASRRecoveryPlan>
    -Direction <String>
    -VmNetworkId <String>
    [-Network <ASRNetwork>]
    [-NetworkType <String>]
    [-WaitForCompletion]
    [-Profile <AzureSMProfile>]
    [<CommonParameters>]

ByPEIdWithLogicalNetworkID

Start-AzureSiteRecoveryTestFailoverJob
    -Direction <String>
    -ProtectionEntityId <String>
    -ProtectionContainerId <String>
    -LogicalNetworkId <String>
    [-Network <ASRNetwork>]
    [-NetworkType <String>]
    [-WaitForCompletion]
    [-Profile <AzureSMProfile>]
    [<CommonParameters>]

ByPEIdWithVMNetworkID

Start-AzureSiteRecoveryTestFailoverJob
    -Direction <String>
    -ProtectionEntityId <String>
    -ProtectionContainerId <String>
    -VmNetworkId <String>
    [-Network <ASRNetwork>]
    [-NetworkType <String>]
    [-WaitForCompletion]
    [-Profile <AzureSMProfile>]
    [<CommonParameters>]

ByPEObject

Start-AzureSiteRecoveryTestFailoverJob
    -Direction <String>
    -ProtectionEntity <ASRProtectionEntity>
    [-Network <ASRNetwork>]
    [-NetworkType <String>]
    [-WaitForCompletion]
    [-Profile <AzureSMProfile>]
    [<CommonParameters>]

ByPEObjectWithLogicalNetworkID

Start-AzureSiteRecoveryTestFailoverJob
    -Direction <String>
    -ProtectionEntity <ASRProtectionEntity>
    -LogicalNetworkId <String>
    [-Network <ASRNetwork>]
    [-NetworkType <String>]
    [-WaitForCompletion]
    [-Profile <AzureSMProfile>]
    [<CommonParameters>]

ByPEObjectWithVMNetworkID

Start-AzureSiteRecoveryTestFailoverJob
    -Direction <String>
    -ProtectionEntity <ASRProtectionEntity>
    -VmNetworkId <String>
    [-Network <ASRNetwork>]
    [-NetworkType <String>]
    [-WaitForCompletion]
    [-Profile <AzureSMProfile>]
    [<CommonParameters>]

Description

The Start-AzureSiteRecoveryTestFailoverJob cmdlet starts test failover of an Azure Site Recovery protection entity or recovery plan. You can check whether the job succeeded by using the Get-AzureRMSiteRecoveryJob cmdlet.

Examples

Example 1: Start a test failover

PS C:\> $ProtectionContainer = Get-AzureSiteRecoveryProtectionContainer
PS C:\> $ProtectionEntity = Get-AzureSiteRecoveryProtectionEntity -ProtectionContainer $ProtectionContainer
PS C:\> Start-AzureSiteRecoveryTestFailoverJob -ProtectionEntity $ProtectionEntity -Direction "PrimaryToRecovery"
ID               : c38eecdc-731c-405b-a61c-08db99aae2fe
ClientRequestId  : 32ace403-0916-4967-83a1-529176bd6e88-2014-49-06 15:49:24Z-P
State            : NotStarted
StateDescription : NotStarted
StartTime        :
EndTime          :
AllowedActions   : {}
Name             :
Tasks            : {}
Errors           : {}

The first command uses the Get-AzureSiteRecoveryProtectionContainer cmdlet to get a protected container, and then stores it in the $ProtectionContainer variable.

The second command gets the protected entities that belong to the protected container stored in $ProtectionContainer by using the Get-AzureSiteRecoveryProtectionEntity cmdlet. The command stores the results in the $ProtectionEntity variable.

The final command starts the test failover operation for the protected entities stored in $ProtectionEntity and specifies the direction of the failover.

Example 2: Start a test failover using a recovery plan

PS C:\> $RecoveryPlan = Get-AzureSiteRecoveryRecoveryPlan -Name "RecoveryPlan01"
Start-AzureSiteRecoveryTestFailoverJob -Direction PrimaryToRecovery -RecoveryPlan $RecoveryPlan

This command gets the recovery plan named RecoveryPlan01 for the current Azure Site Recovery vault by using the Get-AzureSiteRecoveryRecoveryPlan cmdlet. The command stores the plan in the $RecoveryPlan variable.

The second command starts the test failover operation for the recovery plan stored in $RecoveryPlan and specifies the direction of the failover.

Parameters

-Direction

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

  • PrimaryToRecovery
  • RecoveryToPrimary

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-LogicalNetworkId

Specifies the ID of the logical network.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByRPIdWithLogicalNetworkID
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ByRPObjectWithLogicalNetworkID
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ByPEIdWithLogicalNetworkID
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ByPEObjectWithLogicalNetworkID
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Network

Specifies the network object to use for test failover. To obtain a network, use the Get-AzureSiteRecoveryNetwork cmdlet.

Parameter properties

Type:ASRNetwork
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByPEId
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ByRPId
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ByRPIdWithLogicalNetworkID
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ByRPIdWithVMNetworkID
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ByRPObject
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ByRPObjectWithLogicalNetworkID
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ByRPObjectWithVMNetworkID
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ByPEIdWithLogicalNetworkID
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ByPEIdWithVMNetworkID
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ByPEObject
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ByPEObjectWithLogicalNetworkID
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ByPEObjectWithVMNetworkID
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-NetworkType

Specifies the network type to use for test failover. The acceptable values for this parameter are:

  • None
  • New
  • Existing

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Profile

Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile.

Parameter properties

Type:AzureSMProfile
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ProtectionContainerId

Specifies the ID of a protected container. This cmdlet starts the job for a protected virtual machine that belongs to the container that this cmdlet specifies.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByPEId
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ByPEIdWithVMNetwork
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ByPEIdWithLogicalNetworkID
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ByPEIdWithVMNetworkID
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ProtectionEntity

Specifies the Site Recovery protection entity object.

Parameter properties

Type:ASRProtectionEntity
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByPEObjectWithVMNetwork
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ByPEObjectWithLogicalNetworkID
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ByPEObjectWithVMNetworkID
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ProtectionEntityId

Specifies the ID of a protected virtual machine for which to start the job.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByPEId
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ByPEIdWithVMNetwork
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ByPEIdWithLogicalNetworkID
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ByPEIdWithVMNetworkID
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-RecoveryPlan

Specifies a recovery plan for which to start the job.

Parameter properties

Type:ASRRecoveryPlan
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByRPObjectWithVMNetwork
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ByRPObjectWithLogicalNetworkID
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ByRPObjectWithVMNetworkID
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-RpId

Specifies the ID of a recovery plan for which to start the job.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByRPId
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ByRPIdWithLogicalNetworkID
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ByRPIdWithVMNetworkID
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ByRPIdWithVMNetwork
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-VmNetworkId

Specifies the ID of the virtual machine network.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByRPIdWithVMNetworkID
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ByRPObjectWithVMNetworkID
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ByPEIdWithVMNetworkID
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ByPEObjectWithVMNetworkID
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WaitForCompletion

Indicates that the cmdlet waits for the operation to complete before it returns control to the Windows PowerShell console.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.