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

Starts the commit failover action for a Site Recovery object.

Syntax

Start-AzureSiteRecoveryCommitFailoverJob
     [-Direction <String>]
     [-Profile <AzureSMProfile>]
     -ProtectionContainerId <String>
     -ProtectionEntityId <String>
     [-WaitForCompletion]
     [<CommonParameters>]
Start-AzureSiteRecoveryCommitFailoverJob
     [-Direction <String>]
     [-Profile <AzureSMProfile>]
     -ProtectionEntity <ASRProtectionEntity>
     [-WaitForCompletion]
     [<CommonParameters>]
Start-AzureSiteRecoveryCommitFailoverJob
     [-Direction <String>]
     [-Profile <AzureSMProfile>]
     -RecoveryPlan <ASRRecoveryPlan>
     [-WaitForCompletion]
     [<CommonParameters>]
Start-AzureSiteRecoveryCommitFailoverJob
     [-Direction <String>]
     [-Profile <AzureSMProfile>]
     -RPId <String>
     [-WaitForCompletion]
     [<CommonParameters>]

Description

The Start-AzureSiteRecoveryCommitFailoverJob cmdlet starts the commit failover process for an Azure Site Recovery object after a failover operation.

Examples

Example 1: Start a commit failover job

PS C:\> $Container = Get-AzureSiteRecoveryProtectionContainer 
PS C:\> $Protected = Get-AzureSiteRecoveryProtectionEntity -ProtectionContainer $Container 
PS C:\> Start-AzureSiteRecoveryCommitFailoverJob -ProtectionEntity $Protected
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 all protected containers for the current Azure Site Recovery vault by using the Get-AzureSiteRecoveryProtectionContainer cmdlet, and then stores the results in the $Container variable.

The second command gets the protected virtual machines that belong to the container stored in $Container by using the Get-AzureSiteRecoveryProtectionEntity cmdlet. The command stores the results in the $Protected variable.

The final command starts the failover job for the protected objects stored in $Protected.

Required Parameters

-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 an ASRProtectionEntity object for which to start the job. To obtain an ASRProtectionEntity object, use the Get-AzureSiteRecoveryProtectionEntity cmdlet.

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 for which to start the job. To obtain an ASRRecoveryPlan object, use the Get-AzureSiteRecoveryRecoveryPlan cmdlet.

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

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