Start-​Azure​Site​Recovery​Unplanned​Failover​Job

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

Syntax

Start-AzureSiteRecoveryUnplannedFailoverJob
     -Direction <String>
     [-PerformSourceSideActions]
     [-PerformSourceSiteOperations <Boolean>]
     [-Profile <AzureSMProfile>]
     -ProtectionContainerId <String>
     -ProtectionEntityId <String>
     [-WaitForCompletion]
     [<CommonParameters>]
Start-AzureSiteRecoveryUnplannedFailoverJob
     -Direction <String>
     [-PerformSourceSideActions]
     [-PerformSourceSiteOperations <Boolean>]
     [-Profile <AzureSMProfile>]
     -ProtectionEntity <ASRProtectionEntity>
     [-WaitForCompletion]
     [<CommonParameters>]
Start-AzureSiteRecoveryUnplannedFailoverJob
     -Direction <String>
     [-PerformSourceSideActions]
     [-PrimaryAction <Boolean>]
     [-Profile <AzureSMProfile>]
     -RPId <String>
     [-WaitForCompletion]
     [<CommonParameters>]
Start-AzureSiteRecoveryUnplannedFailoverJob
     -Direction <String>
     [-PerformSourceSideActions]
     [-PrimaryAction <Boolean>]
     [-Profile <AzureSMProfile>]
     -RecoveryPlan <ASRRecoveryPlan>
     [-WaitForCompletion]
     [<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.

Required Parameters

-Direction

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

  • RecoveryToPrimary
Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters: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.

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

Specifies the Site Recovery protection entity object.

Type:ASRProtectionEntity
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-ProtectionEntityId

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

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

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

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

Specifies a recovery plan object.

Type:ASRRecoveryPlan
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False

Optional Parameters

-PerformSourceSideActions

Indicates that the action can perform source side actions.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PerformSourceSiteOperations

Indicates that source site operations can be performed.

Type:Boolean
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PrimaryAction

Indicates that primary site actions are required.

Type:Boolean
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters: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.

Type:AzureSMProfile
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-WaitForCompletion

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

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