你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Start-AzureSiteRecoveryCommitFailoverJob

启动 Site Recovery 对象的提交故障转移操作。

注意

本文档中引用的 cmdlet 用于管理使用 Azure Service Manager (ASM) API 的旧 Azure 资源。 创建新的资源时,不建议使用此旧版 PowerShell 模块,因为 ASM 计划停用。 有关详细信息,请参阅 Azure Service Manager 停用

Az PowerShell 模块是推荐的 PowerShell 模块,用于使用 PowerShell 管理 Azure 资源管理器 (ARM) 资源。

语法

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

说明

Start-AzureSiteRecoveryCommitFailoverJob cmdlet 在故障转移操作后启动 Azure Site Recovery 对象的提交故障转移过程。

示例

示例 1:启动提交故障转移作业

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           : {}

第一个命令使用 Get-AzureSiteRecoveryProtectionContainer cmdlet 获取当前 Azure Site Recovery 保管库的所有受保护容器,然后将结果存储在$Container变量中。

第二个命令使用 Get-AzureSiteRecoveryProtectionEntity cmdlet 获取属于存储在$Container中的容器的受保护虚拟机。 该命令将结果存储在$Protected变量中。

最后一个命令为存储在$Protected中的受保护对象启动故障转移作业。

参数

-Direction

指定故障转移的方向。 此参数的可接受值为:

  • PrimaryToRecovery
  • RecoveryToPrimary
类型:String
Position:Named
默认值:None
必需:False
接受管道输入:False
接受通配符:False

-Profile

指定此 cmdlet 从中读取的 Azure 配置文件。 如果未指定配置文件,此 cmdlet 将从本地默认配置文件中读取。

类型:AzureSMProfile
Position:Named
默认值:None
必需:False
接受管道输入:False
接受通配符:False

-ProtectionContainerId

指定受保护容器的 ID。 此 cmdlet 为属于此 cmdlet 指定的容器的受保护虚拟机启动作业。

类型:String
Position:Named
默认值:None
必需:True
接受管道输入:False
接受通配符:False

-ProtectionEntity

指定要 为其启动作业的 ASRProtectionEntity 对象。 若要获取 ASRProtectionEntity 对象,请使用 Get-AzureSiteRecoveryProtectionEntity cmdlet。

类型:ASRProtectionEntity
Position:Named
默认值:None
必需:True
接受管道输入:True
接受通配符:False

-ProtectionEntityId

指定要为其启动作业的受保护虚拟机的 ID。

类型:String
Position:Named
默认值:None
必需:True
接受管道输入:False
接受通配符:False

-RecoveryPlan

指定要为其启动作业的恢复计划对象。 若要获取 ASRRecoveryPlan 对象,请使用 Get-AzureSiteRecoveryRecoveryPlan cmdlet。

类型:ASRRecoveryPlan
Position:Named
默认值:None
必需:True
接受管道输入:True
接受通配符:False

-RPId

指定要为其启动作业的恢复计划的 ID。

类型:String
Position:Named
默认值:None
必需:True
接受管道输入:False
接受通配符:False

-WaitForCompletion

指示该 cmdlet 等待操作完成,然后再将控制权返回到 Windows PowerShell 控制台。

类型:SwitchParameter
Position:Named
默认值:None
必需:False
接受管道输入:False
接受通配符:False