Start-AzureSiteRecoveryCommitFailoverJob
啟動 Site Recovery 物件的認可容錯移轉動作。
注意
本檔中參考的 Cmdlet 用於管理使用服務管理 API 的舊版 Azure 資源。 如需管理 Azure Resource Manager 資源的 Cmdlet,請參閱 Az PowerShell 模組 。
Syntax
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>]
Description
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
指定受保護容器的識別碼。 此 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
指定要啟動作業之受保護虛擬機器的識別碼。
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
指定要啟動作業之復原計畫的識別碼。
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 |