Edit

Share via


Start-AzureSiteRecoveryUnplannedFailoverJob

Starts the unplanned failover for a Site Recovery protection entity or recovery plan.

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

ByRPId (Default)

Start-AzureSiteRecoveryUnplannedFailoverJob
    -RPId <String>
    -Direction <String>
    [-PrimaryAction <Boolean>]
    [-PerformSourceSideActions]
    [-WaitForCompletion]
    [-Profile <AzureSMProfile>]
    [<CommonParameters>]

ByPEId

Start-AzureSiteRecoveryUnplannedFailoverJob
    -ProtectionEntityId <String>
    -ProtectionContainerId <String>
    -Direction <String>
    [-PerformSourceSiteOperations <Boolean>]
    [-PerformSourceSideActions]
    [-WaitForCompletion]
    [-Profile <AzureSMProfile>]
    [<CommonParameters>]

ByRPObject

Start-AzureSiteRecoveryUnplannedFailoverJob
    -RecoveryPlan <ASRRecoveryPlan>
    -Direction <String>
    [-PrimaryAction <Boolean>]
    [-PerformSourceSideActions]
    [-WaitForCompletion]
    [-Profile <AzureSMProfile>]
    [<CommonParameters>]

ByPEObject

Start-AzureSiteRecoveryUnplannedFailoverJob
    -ProtectionEntity <ASRProtectionEntity>
    -Direction <String>
    [-PerformSourceSiteOperations <Boolean>]
    [-PerformSourceSideActions]
    [-WaitForCompletion]
    [-Profile <AzureSMProfile>]
    [<CommonParameters>]

Description

The Start-AzureSiteRecoveryUnplannedFailoverJob cmdlet starts the unplanned failover of an Azure Site Recovery protection entity or recovery plan. You can check whether the job succeeds by using the Get-AzureSiteRecoveryJob cmdlet.

Examples

Example 1: Start an unplanned failover job

PS C:\> $ProtectionContainer = Get-AzureSiteRecoveryProtectionContainer
PS C:\> $ProtectionEntity = Get-AzureSiteRecoveryProtectionEntity -ProtectionContainer $ProtectionContainer
PS C:\> Start-AzureSiteRecoveryUnplannedFailoverJob -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 gets a protected container by using the Get-AzureSiteRecoveryProtectionContainer cmdlet, 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 failover for the protected entities stored in $ProtectionEntity and specifies the direction of the failover.

Parameters

-Direction

Specifies the direction of the failover. 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

-PerformSourceSideActions

Indicates that the action can perform source side actions.

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

-PerformSourceSiteOperations

Indicates that source site operations can be performed.

Parameter properties

Type:Boolean
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
ByPEObject
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-PrimaryAction

Indicates that primary site actions are required.

Parameter properties

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

Parameter sets

ByRPId
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

-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

-ProtectionEntity

Specifies the Site Recovery protection entity object.

Parameter properties

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

Parameter sets

ByPEObject
Position:Named
Mandatory:True
Value from pipeline:True
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

-RecoveryPlan

Specifies a recovery plan object.

Parameter properties

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

Parameter sets

ByRPObject
Position:Named
Mandatory:True
Value from pipeline:True
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

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