共用方式為


Start-AzRecoveryServicesAsrTestFailoverJob

啟動測試故障轉移作業。

語法

Start-AzRecoveryServicesAsrTestFailoverJob
     -ReplicationProtectedItem <ASRReplicationProtectedItem>
     -Direction <String>
     [-CloudServiceCreationOption <String>]
     [-DataEncryptionPrimaryCertFile <String>]
     [-DataEncryptionSecondaryCertFile <String>]
     [-RecoveryPoint <ASRRecoveryPoint>]
     [-DefaultProfile <IAzureContextContainer>]
     [-WhatIf]
     [-Confirm]
     [<CommonParameters>]
Start-AzRecoveryServicesAsrTestFailoverJob
     -RecoveryPlan <ASRRecoveryPlan>
     -Direction <String>
     [-CloudServiceCreationOption <String>]
     [-DataEncryptionPrimaryCertFile <String>]
     [-DataEncryptionSecondaryCertFile <String>]
     [-RecoveryTag <String>]
     [-MultiVmSyncPoint <String>]
     [-DefaultProfile <IAzureContextContainer>]
     [-WhatIf]
     [-Confirm]
     [<CommonParameters>]
Start-AzRecoveryServicesAsrTestFailoverJob
     -RecoveryPlan <ASRRecoveryPlan>
     -Direction <String>
     -VMNetwork <ASRNetwork>
     [-DataEncryptionPrimaryCertFile <String>]
     [-DataEncryptionSecondaryCertFile <String>]
     [-RecoveryTag <String>]
     [-DefaultProfile <IAzureContextContainer>]
     [-WhatIf]
     [-Confirm]
     [<CommonParameters>]
Start-AzRecoveryServicesAsrTestFailoverJob
     -RecoveryPlan <ASRRecoveryPlan>
     -Direction <String>
     -AzureVMNetworkId <String>
     [-CloudServiceCreationOption <String>]
     [-DataEncryptionPrimaryCertFile <String>]
     [-DataEncryptionSecondaryCertFile <String>]
     [-RecoveryTag <String>]
     [-DefaultProfile <IAzureContextContainer>]
     [-WhatIf]
     [-Confirm]
     [<CommonParameters>]
Start-AzRecoveryServicesAsrTestFailoverJob
     -ReplicationProtectedItem <ASRReplicationProtectedItem>
     -Direction <String>
     -VMNetwork <ASRNetwork>
     [-DataEncryptionPrimaryCertFile <String>]
     [-DataEncryptionSecondaryCertFile <String>]
     [-RecoveryPoint <ASRRecoveryPoint>]
     [-DefaultProfile <IAzureContextContainer>]
     [-WhatIf]
     [-Confirm]
     [<CommonParameters>]
Start-AzRecoveryServicesAsrTestFailoverJob
     -ReplicationProtectedItem <ASRReplicationProtectedItem>
     -Direction <String>
     -AzureVMNetworkId <String>
     [-CloudServiceCreationOption <String>]
     [-DataEncryptionPrimaryCertFile <String>]
     [-DataEncryptionSecondaryCertFile <String>]
     [-RecoveryPoint <ASRRecoveryPoint>]
     [-DefaultProfile <IAzureContextContainer>]
     [-WhatIf]
     [-Confirm]
     [<CommonParameters>]

Description

Start-AzRecoveryServicesAsrTestFailoverJob Cmdlet 會啟動 Azure Site Recovery 複寫受保護專案或復原方案的測試故障轉移。 您可以使用 Get-AzRecoveryServicesAsrJob Cmdlet 來檢查作業是否成功。

範例

範例 1

$currentJob = Start-AzRecoveryServicesAsrTestFailoverJob -RecoveryPlan $RP -Direction PrimaryToRecovery -VMNetwork $TestRecoveryNetwork

使用指定的參數啟動復原計劃的測試故障轉移作業,並傳回用來追蹤作業的 ASR 作業。

範例 2

啟動測試故障轉移作業。 ( 自動產生 )

Start-AzRecoveryServicesAsrTestFailoverJob -AzureVMNetworkId <String> -Direction PrimaryToRecovery -RecoveryPlan $RP

參數

-AzureVMNetworkId

指定故障轉移後復原 VM 的 Azure VM 網路識別碼。

類型:String
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-CloudServiceCreationOption

指定是否應該建立新的雲端服務,或針對 VM 設定的復原雲端服務是否應該用於測試故障轉移。

類型:String
接受的值:UseRecoveryCloudService, AutoCreateCloudService
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-Confirm

執行 Cmdlet 之前先提示您確認。

類型:SwitchParameter
別名:cf
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-DataEncryptionPrimaryCertFile

指定主要憑證檔案。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-DataEncryptionSecondaryCertFile

指定次要憑證檔案。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-DefaultProfile

用於與 Azure 通訊的認證、帳戶、租用戶和訂用帳戶。

類型:IAzureContextContainer
別名:AzContext, AzureRmContext, AzureCredential
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-Direction

指定故障轉移方向。 此參數可接受的值為:

  • PrimaryToRecovery
  • RecoveryToPrimary
類型:String
接受的值:PrimaryToRecovery, RecoveryToPrimary
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-MultiVmSyncPoint

指定是否啟用多重 VM 同步點,以故障轉移已啟用多重 VM 同步的 VM(僅適用於 VMware 至 Azure 複寫案例)。

類型:String
接受的值:Enable, Disable
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-RecoveryPlan

指定 ASR 復原方案物件。

類型:ASRRecoveryPlan
Position:Named
預設值:None
必要:True
接受管線輸入:True
接受萬用字元:False

-RecoveryPoint

指定要測試受保護機器故障轉移的自定義恢復點。

類型:ASRRecoveryPoint
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-RecoveryTag

指定要測試故障轉移至的復原標籤

類型:String
接受的值:Latest, LatestAvailable, LatestAvailableApplicationConsistent
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-ReplicationProtectedItem

指定 ASR 複寫受保護的專案。

類型:ASRReplicationProtectedItem
Position:Named
預設值:None
必要:True
接受管線輸入:True
接受萬用字元:False

-VMNetwork

指定要將測試故障轉移虛擬機連線到的 Site Recovery 虛擬機網路。

類型:ASRNetwork
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-WhatIf

顯示執行 Cmdlet 後會發生的情況。 未執行 Cmdlet。

類型:SwitchParameter
別名:wi
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

輸入

ASRRecoveryPlan

ASRReplicationProtectedItem

輸出

ASRJob