你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Start-AzureSiteRecoveryProtectionProfileAssociationJob

启动 Site Recovery 复制策略关联作业。

注意

本文档中引用的 cmdlet 用于管理使用 Azure Service Manager (ASM) API 的旧 Azure 资源。 创建新的资源时,不建议使用此旧版 PowerShell 模块,因为 ASM 计划停用。 有关详细信息,请参阅 Azure Service Manager 停用

Az PowerShell 模块是推荐的 PowerShell 模块,用于使用 PowerShell 管理 Azure 资源管理器 (ARM) 资源。

语法

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

说明

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
Accept pipeline input:False
Accept wildcard characters:False

-Profile

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

类型:AzureSMProfile
Position:Named
默认值:None
必需:False
Accept pipeline input:False
Accept wildcard characters:False

-ProtectionProfile

指定要应用于保护容器的保护配置文件设置。 若要获取 ASRProtectionProfile 对象,请使用 New-AzureSiteRecoveryProtectionProfileObject cmdlet。

类型:ASRProtectionProfile
Position:Named
默认值:None
必需:True
Accept pipeline input:True
Accept wildcard characters:False

-RecoveryProtectionContainer

指定要对其应用保护配置文件设置的恢复保护容器。

类型:ASRProtectionContainer
Position:Named
默认值:None
必需:True
Accept pipeline input:False
Accept wildcard characters:False