你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Start-AzureSiteRecoveryCommitFailoverJob
启动 Site Recovery 对象的提交故障转移操作。
注意
本文档中引用的 cmdlet 用于管理使用服务管理 API 的旧式 Azure 资源。 若要了解用于管理 Azure 资源管理器资源的 cmdlet,请参阅 Az PowerShell 模块。
语法
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
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Profile
指定此 cmdlet 从中读取的 Azure 配置文件。 如果未指定配置文件,此 cmdlet 将从本地默认配置文件中读取。
Type: | AzureSMProfile |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ProtectionContainerId
指定受保护容器的 ID。 此 cmdlet 为属于此 cmdlet 指定的容器的受保护虚拟机启动作业。
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ProtectionEntity
指定要 为其启动作业的 ASRProtectionEntity 对象。 若要获取 ASRProtectionEntity 对象,请使用 Get-AzureSiteRecoveryProtectionEntity cmdlet。
Type: | ASRProtectionEntity |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ProtectionEntityId
指定要为其启动作业的受保护虚拟机的 ID。
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-RecoveryPlan
指定要为其启动作业的恢复计划对象。 若要获取 ASRRecoveryPlan 对象,请使用 Get-AzureSiteRecoveryRecoveryPlan cmdlet。
Type: | ASRRecoveryPlan |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-RPId
指定要为其启动作业的恢复计划的 ID。
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-WaitForCompletion
指示该 cmdlet 等待操作完成,然后再将控制权返回到 Windows PowerShell 控制台。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |