共用方式為


Start-AzureSiteRecoveryProtectionProfileAssociationJob

啟動 Site Recovery 複寫策略關聯作業。

注意

本文件中參考的 Cmdlet 用於管理使用 Azure Service Manager(ASM) API 的舊版 Azure 資源。 建立新的資源時,不建議使用此舊版 PowerShell 模組,因為 ASM 已排定淘汰。 如需詳細資訊,請參閱 Azure Service Manager 淘汰

Az PowerShell 模組是使用 PowerShell 管理 Azure Resource Manager (ARM) 資源的建議 PowerShell 模組。

語法

Start-AzureSiteRecoveryProtectionProfileAssociationJob
     -ProtectionProfile <ASRProtectionProfile>
     -PrimaryProtectionContainer <ASRProtectionContainer>
     [-Profile <AzureSMProfile>]
     [<CommonParameters>]
Start-AzureSiteRecoveryProtectionProfileAssociationJob
     -ProtectionProfile <ASRProtectionProfile>
     -PrimaryProtectionContainer <ASRProtectionContainer>
     -RecoveryProtectionContainer <ASRProtectionContainer>
     [-Profile <AzureSMProfile>]
     [<CommonParameters>]

Description

Start-AzureSiteRecoveryProtectionProfileAssociationJob Cmdlet 會起始關聯作業,以建立複製策略與 Azure Site Recovery 保護容器的關聯。

範例

範例 1:建立保護配置文件的關聯

PS C:\> $ProtectionContainer01 = Get-AzureSiteRecoveryProtectionContainer -Id "5ba2ea95-856d-4033-9ca3-91e3e2c080b9"
PS C:\> $ProtectionProfile = New-AzureSiteRecoveryProtectionProfileObject -ReplicationProvider "HyperVReplica" -AllowReplicaDeletion -ApplicationConsistentSnapshotFrequencyInHours 1 -CompressionEnabled -RecoveryPoints 2 -ReplicationFrequencyInSeconds 30 -ReplicationMethod "Online" -ReplicationPort 8085 -ReplicationStartTime 1
PS C:\> $ProtectionContainer02 = Get-AzureSiteRecoveryProtectionContainer -Id "cf011f2a-aa19-443c-9f60-357f6b8afb77"
PS C:\> Start-AzureSiteRecoveryProtectionProfileAssociationJob -PrimaryProtectionContainer $ProtectionContainer01 -ProtectionProfile $ProtectionProfile -RecoveryProtectionContainer $ProtectionContainer02
Name             : MyProtectionProfile
ID               : 51978b0f-9241-4153-9171-2e19344f0805
ClientRequestId  : bb6f3200-b7c6-4c6f-bcbc-a70bb9946f03-2015-01-27 22:55:55Z-P
State            : InProgress
StateDescription : InProgress
StartTime        : 1/27/2015 10:56:01 PM
EndTime          : 
AllowedActions   : 
Tasks            : {Adding the protection group, Configuring Windows Server 2012 R2 Hyper-V hosts for Azure}
Errors           : {}

第一個命令會使用 Get-AzureSiteRecoveryProtectionContainer Cmdlet 取得保護容器,然後將該容器儲存在 $ProtectionContainer 01 變數中。

第二個命令會使用 New-AzureSiteRecoveryProtectionProfileObject Cmdlet 來建立保護配置檔,並將該保護配置檔儲存在 $ProtectionProfile 變數中。

第三個命令會取得保護容器,然後將它儲存在 $ProtectionContainer 02 變數中。

最後一個命令會將儲存在 $ProtectionProfile 中的保護配置檔與儲存在 $ProtectionContainer 01 中的容器建立關聯,作為主要保護容器。 命令會將儲存在 $ProtectionContainer 02 中的容器關聯為復原保護容器。

參數

-PrimaryProtectionContainer

指定要套用保護配置檔設定的主要保護容器。

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

-Profile

指定此 Cmdlet 從中讀取的 Azure 設定檔。 如果您未指定設定檔,此 Cmdlet 會從本機預設配置檔讀取。

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

-ProtectionProfile

指定要套用至保護容器的保護配置檔設定。 若要取得 ASRProtectionProfile 物件,請使用 New-AzureSiteRecoveryProtectionProfileObject Cmdlet。

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

-RecoveryProtectionContainer

指定要套用保護配置檔設定的復原保護容器。

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