你当前正在访问 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 的 Azure 资源管理器 (ARM) 资源的 PowerShell 模块。

语法

ByRPId (默认值)

Start-AzureSiteRecoveryCommitFailoverJob
    -RPId <String>
    [-Direction <String>]
    [-WaitForCompletion]
    [-Profile <AzureSMProfile>]
    [<CommonParameters>]

ByPEId

Start-AzureSiteRecoveryCommitFailoverJob
    -ProtectionEntityId <String>
    -ProtectionContainerId <String>
    [-Direction <String>]
    [-WaitForCompletion]
    [-Profile <AzureSMProfile>]
    [<CommonParameters>]

ByRPObject

Start-AzureSiteRecoveryCommitFailoverJob
    -RecoveryPlan <ASRRecoveryPlan>
    [-Direction <String>]
    [-WaitForCompletion]
    [-Profile <AzureSMProfile>]
    [<CommonParameters>]

ByPEObject

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
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-Profile

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

参数属性

类型:AzureSMProfile
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-ProtectionContainerId

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

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

ByPEId
Position:Named
必需:True
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-ProtectionEntity

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

参数属性

类型:ASRProtectionEntity
默认值:None
支持通配符:False
不显示:False

参数集

ByPEObject
Position:Named
必需:True
来自管道的值:True
来自管道的值(按属性名称):False
来自剩余参数的值:False

-ProtectionEntityId

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

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

ByPEId
Position:Named
必需:True
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-RecoveryPlan

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

参数属性

类型:ASRRecoveryPlan
默认值:None
支持通配符:False
不显示:False

参数集

ByRPObject
Position:Named
必需:True
来自管道的值:True
来自管道的值(按属性名称):False
来自剩余参数的值:False

-RPId

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

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

ByRPId
Position:Named
必需:True
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-WaitForCompletion

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

参数属性

类型:SwitchParameter
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

CommonParameters

此 cmdlet 支持通用参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 有关详细信息,请参阅 about_CommonParameters