編集

次の方法で共有


New-AzRecoveryServicesAsrPolicy

Creates an Azure Site Recovery replication policy.

Syntax

New-AzRecoveryServicesAsrPolicy
   [-HyperVToAzure]
   -Name <String>
   -ReplicationProvider <String>
   -ReplicationFrequencyInSeconds <String>
   [-NumberOfRecoveryPointsToRetain <Int32>]
   [-ApplicationConsistentSnapshotFrequencyInHours <Int32>]
   [-ReplicationStartTime <TimeSpan>]
   [-RecoveryAzureStorageAccountId <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzRecoveryServicesAsrPolicy
   [-VMwareToAzure]
   -Name <String>
   -RecoveryPointRetentionInHours <Int32>
   [-ApplicationConsistentSnapshotFrequencyInHours <Int32>]
   [-MultiVmSyncStatus <String>]
   -RPOWarningThresholdInMinutes <Int32>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzRecoveryServicesAsrPolicy
   [-AzureToVMware]
   -Name <String>
   -RecoveryPointRetentionInHours <Int32>
   [-ApplicationConsistentSnapshotFrequencyInHours <Int32>]
   [-MultiVmSyncStatus <String>]
   -RPOWarningThresholdInMinutes <Int32>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzRecoveryServicesAsrPolicy
   [-AzureToAzure]
   -Name <String>
   -RecoveryPointRetentionInHours <Int32>
   [-ApplicationConsistentSnapshotFrequencyInHours <Int32>]
   [-MultiVmSyncStatus <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzRecoveryServicesAsrPolicy
   [-VmmToVmm]
   -Name <String>
   -ReplicationProvider <String>
   [-ReplicationMethod <String>]
   -ReplicationFrequencyInSeconds <String>
   [-NumberOfRecoveryPointsToRetain <Int32>]
   [-ApplicationConsistentSnapshotFrequencyInHours <Int32>]
   [-Compression <String>]
   -ReplicationPort <UInt16>
   [-Authentication <String>]
   [-ReplicationStartTime <TimeSpan>]
   [-ReplicaDeletion <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzRecoveryServicesAsrPolicy
   [-ReplicateVMwareToAzure]
   -Name <String>
   -RecoveryPointRetentionInHours <Int32>
   [-ApplicationConsistentSnapshotFrequencyInHours <Int32>]
   [-MultiVmSyncStatus <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The New-AzRecoveryServicesAsrPolicy cmdlet creates an Azure Site Recovery replication policy. The replication policy is used to specify replication settings such as the replication frequency and number of recovery points.

Examples

Example 1

New-AzRecoveryServicesAsrPolicy -Name "abc" -ReplicationProvider HyperVReplicaAzure -ReplicationFrequencyInSeconds 30 -NumberOfRecoveryPointsToRetain 10

Starts the replication policy creation operation using the specified parameters and returns the ASR job used to track the operation.

Example 2

New-AzRecoveryServicesAsrPolicy -Name "abc122" -ReplicationProvider HyperVReplica2012R2 -ReplicationFrequencyInSeconds 300 -ReplicationPort 211

Name             : 1c609a5b-324e-461c-866f-ad58f944df25
ID               : /Subscriptions/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/resourceGroups/xxxxxxxxxxxx/providers/Microsoft.RecoveryServices/vaults/xxxxxxxxxxxx/replicationJobs/1c609a5b-324e-461c-866f-ad58f944df25
Type             :
JobType          : AddProtectionProfile
DisplayName      : Create replication policy
ClientRequestId  : b10c83ee-fee2-42d4-ad1d-dfc3e166faab ActivityId: 67e8453c-fae0-465f-801c-dfa2e6e6ee23
State            : Succeeded
StateDescription : Completed
StartTime        : 8/29/2017 10:18:10 AM
EndTime          : 8/29/2017 10:18:11 AM
TargetObjectId   : bb8e8c57-221d-5668-9d82-b15a3e19a6a3
TargetObjectType : ProtectionProfile
TargetObjectName : abc122
AllowedActions   :
Tasks            : {Prerequisites check for creating the replication policy, Creating the replication policy}
Errors           : {}

Starts the replication policy creation operation using the specified parameters and returns the ASR job used to track the operation.

Example 3

$Job = New-AzRecoveryServicesAsrPolicy -Name $TestPolicy1 -AzureToAzure -RecoveryPointRetentionInHours 10  -ApplicationConsistentSnapshotFrequencyInHours 5 
Get-AzRecoveryServicesAsrJob -name $Job.id

Starts the replication policy creation operation using the specified parameters and returns the ASR job used to track the operation.

Parameters

-ApplicationConsistentSnapshotFrequencyInHours

Specifies the frequency(in hours) at which to create application consistent recovery points.

Type:Int32
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Authentication

Specifies the type of authentication used. Valid values are:

  • Certificate
  • Kerberos
Type:String
Accepted values:Certificate, Kerberos
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-AzureToAzure

Switch parameter specifies the scenario for azure to azure policy creation.

Type:SwitchParameter
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-AzureToVMware

Switch parameter specifies the scenario for azure to vMWare policy creation.

Type:SwitchParameter
Position:0
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Compression

Specifies if compression should be enabled.

Type:String
Accepted values:Enable, Disable
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-HyperVToAzure

Switch parameter to specify policy is to be used to replicate Hyper-V virtual machines to Azure

Type:SwitchParameter
Position:0
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-MultiVmSyncStatus

Specifies multiVm sync status for the policy.

Type:String
Accepted values:Enable, Disable
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

Specifies the name of the ASR replication policy.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-NumberOfRecoveryPointsToRetain

Specifies the number recovery points to retain.

Type:Int32
Aliases:RecoveryPoints
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RecoveryAzureStorageAccountId

Specifies the ID of the Azure storage account to replicate to.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RecoveryPointRetentionInHours

Retain the recovery points for given time in hours.

Type:Int32
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ReplicaDeletion

Specifies if the replica virtual machine should be deleted on disabling replication from a VMM managed site to another.

Type:String
Accepted values:Required, NotRequired
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ReplicateVMwareToAzure

Switch parameter specifying VMware to Azure replication scenario.

Type:SwitchParameter
Position:0
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ReplicationFrequencyInSeconds

Specifies the replication frequency interval in seconds. Valid values are:

  • 30
  • 300
  • 900
Type:String
Accepted values:30, 300, 900
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ReplicationMethod

Specifies the replication method. Valid values are:

  • Online
  • Offline
Type:String
Accepted values:Online, Offline
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ReplicationPort

Specifies the port used for replication.

Type:UInt16
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ReplicationProvider

Specifies the replication provider for the policy.

Type:String
Accepted values:HyperVReplica2012R2, HyperVReplica2012, HyperVReplicaAzure
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ReplicationStartTime

Specifies the replication start time. It must be no later than 24-hours from the start of the job.

Type:Nullable<T>[TimeSpan]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RPOWarningThresholdInMinutes

The RPO threshold value in minutes to warn on.

Type:Int32
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-VmmToVmm

Switch parameter to specify policy is to be used to replicate between Hyper-V sites managed by a VMM server.

Type:SwitchParameter
Position:0
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-VMwareToAzure

Switch parameter specifying that the replication policy being created will be used to replicate VMware virtual machines and/or Physical servers to Azure.

Type:SwitchParameter
Position:0
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

None

Outputs

ASRJob