Edit

Share via


New-AzRecoveryServicesAsrPolicy

Creates an Azure Site Recovery replication policy.

Syntax

HyperVToAzure (Default)

New-AzRecoveryServicesAsrPolicy
    -Name <String>
    -ReplicationProvider <String>
    -ReplicationFrequencyInSeconds <String>
    [-HyperVToAzure]
    [-NumberOfRecoveryPointsToRetain <Int32>]
    [-ApplicationConsistentSnapshotFrequencyInHours <Int32>]
    [-ReplicationStartTime <TimeSpan>]
    [-RecoveryAzureStorageAccountId <String>]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

VMwareToAzure

New-AzRecoveryServicesAsrPolicy
    -Name <String>
    -RecoveryPointRetentionInHours <Int32>
    -RPOWarningThresholdInMinutes <Int32>
    [-VMwareToAzure]
    [-ApplicationConsistentSnapshotFrequencyInHours <Int32>]
    [-MultiVmSyncStatus <String>]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

AzureToVMware

New-AzRecoveryServicesAsrPolicy
    -Name <String>
    -RecoveryPointRetentionInHours <Int32>
    -RPOWarningThresholdInMinutes <Int32>
    [-AzureToVMware]
    [-ApplicationConsistentSnapshotFrequencyInHours <Int32>]
    [-MultiVmSyncStatus <String>]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

AzureToAzure

New-AzRecoveryServicesAsrPolicy
    -Name <String>
    -RecoveryPointRetentionInHours <Int32>
    [-AzureToAzure]
    [-ApplicationConsistentSnapshotFrequencyInHours <Int32>]
    [-MultiVmSyncStatus <String>]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

EnterpriseToEnterprise

New-AzRecoveryServicesAsrPolicy
    -Name <String>
    -ReplicationProvider <String>
    -ReplicationFrequencyInSeconds <String>
    -ReplicationPort <UInt16>
    [-VmmToVmm]
    [-ReplicationMethod <String>]
    [-NumberOfRecoveryPointsToRetain <Int32>]
    [-ApplicationConsistentSnapshotFrequencyInHours <Int32>]
    [-Compression <String>]
    [-Authentication <String>]
    [-ReplicationStartTime <TimeSpan>]
    [-ReplicaDeletion <String>]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ReplicateVMwareToAzure

New-AzRecoveryServicesAsrPolicy
    -Name <String>
    -RecoveryPointRetentionInHours <Int32>
    [-ReplicateVMwareToAzure]
    [-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.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Authentication

Specifies the type of authentication used. Valid values are:

  • Certificate
  • Kerberos

Parameter properties

Type:String
Default value:None
Accepted values:Certificate, Kerberos
Supports wildcards:False
DontShow:False

Parameter sets

EnterpriseToEnterprise
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-AzureToAzure

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

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

AzureToAzure
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-AzureToVMware

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

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

AzureToVMware
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Compression

Specifies if compression should be enabled.

Parameter properties

Type:String
Default value:None
Accepted values:Enable, Disable
Supports wildcards:False
DontShow:False

Parameter sets

EnterpriseToEnterprise
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DefaultProfile

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

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-HyperVToAzure

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

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

HyperVToAzure
Position:0
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-MultiVmSyncStatus

Specifies multiVm sync status for the policy.

Parameter properties

Type:String
Default value:None
Accepted values:Enable, Disable
Supports wildcards:False
DontShow:False

Parameter sets

VMwareToAzure
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
AzureToVMware
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
AzureToAzure
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ReplicateVMwareToAzure
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Name

Specifies the name of the ASR replication policy.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-NumberOfRecoveryPointsToRetain

Specifies the number recovery points to retain.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False
Aliases:RecoveryPoints

Parameter sets

HyperVToAzure
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
EnterpriseToEnterprise
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-RecoveryAzureStorageAccountId

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

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

HyperVToAzure
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-RecoveryPointRetentionInHours

Retain the recovery points for given time in hours.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

VMwareToAzure
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
AzureToVMware
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
AzureToAzure
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ReplicateVMwareToAzure
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ReplicaDeletion

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

Parameter properties

Type:String
Default value:None
Accepted values:Required, NotRequired
Supports wildcards:False
DontShow:False

Parameter sets

EnterpriseToEnterprise
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ReplicateVMwareToAzure

Switch parameter specifying VMware to Azure replication scenario.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ReplicateVMwareToAzure
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ReplicationFrequencyInSeconds

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

  • 30
  • 300
  • 900

Parameter properties

Type:String
Default value:None
Accepted values:30, 300, 900
Supports wildcards:False
DontShow:False

Parameter sets

HyperVToAzure
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
EnterpriseToEnterprise
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ReplicationMethod

Specifies the replication method. Valid values are:

  • Online
  • Offline

Parameter properties

Type:String
Default value:None
Accepted values:Online, Offline
Supports wildcards:False
DontShow:False

Parameter sets

EnterpriseToEnterprise
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ReplicationPort

Specifies the port used for replication.

Parameter properties

Type:UInt16
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

EnterpriseToEnterprise
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ReplicationProvider

Specifies the replication provider for the policy.

Parameter properties

Type:String
Default value:None
Accepted values:HyperVReplica2012R2, HyperVReplica2012, HyperVReplicaAzure
Supports wildcards:False
DontShow:False

Parameter sets

HyperVToAzure
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
EnterpriseToEnterprise
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ReplicationStartTime

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

Parameter properties

Type:

Nullable<T>[TimeSpan]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

HyperVToAzure
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
EnterpriseToEnterprise
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-RPOWarningThresholdInMinutes

The RPO threshold value in minutes to warn on.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

VMwareToAzure
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
AzureToVMware
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-VmmToVmm

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

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

EnterpriseToEnterprise
Position:0
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

VMwareToAzure
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

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

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

None

Outputs

ASRJob