New-AzureRmRecoveryServicesAsrPolicy
Creates an Azure Site Recovery replication policy.
Warning
The AzureRM PowerShell module has been officially deprecated as of February 29, 2024. Users are advised to migrate from AzureRM to the Az PowerShell module to ensure continued support and updates.
Although the AzureRM module may still function, it's no longer maintained or supported, placing any continued use at the user's discretion and risk. Please refer to our migration resources for guidance on transitioning to the Az module.
Syntax
New-AzureRmRecoveryServicesAsrPolicy
[-HyperVToAzure]
-Name <String>
-ReplicationProvider <String>
-ReplicationFrequencyInSeconds <String>
[-NumberOfRecoveryPointsToRetain <Int32>]
[-ApplicationConsistentSnapshotFrequencyInHours <Int32>]
[-ReplicationStartTime <TimeSpan>]
[-RecoveryAzureStorageAccountId <String>]
[-Encryption <String>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzureRmRecoveryServicesAsrPolicy
[-VMwareToAzure]
-Name <String>
-RecoveryPointRetentionInHours <Int32>
[-ApplicationConsistentSnapshotFrequencyInHours <Int32>]
[-MultiVmSyncStatus <String>]
-RPOWarningThresholdInMinutes <Int32>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzureRmRecoveryServicesAsrPolicy
[-AzureToVMware]
-Name <String>
-RecoveryPointRetentionInHours <Int32>
[-ApplicationConsistentSnapshotFrequencyInHours <Int32>]
[-MultiVmSyncStatus <String>]
-RPOWarningThresholdInMinutes <Int32>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzureRmRecoveryServicesAsrPolicy
[-AzureToAzure]
-Name <String>
-RecoveryPointRetentionInHours <Int32>
[-ApplicationConsistentSnapshotFrequencyInHours <Int32>]
[-MultiVmSyncStatus <String>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzureRmRecoveryServicesAsrPolicy
[-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>]
Description
The New-AzureRmRecoveryServicesAsrPolicy 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
PS C:\> New-AzureRmRecoveryServicesAsrPolicy -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
PS C:\> New-AzureRmRecoveryServicesAsrPolicy -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
PS C:\> New-AzureRmRecoveryServicesAsrPolicy -Name $policyName1 -ReplicationProvider InMageAzureV2 -RecoveryPoints 40 -RPOWarningThresholdInMinutes 5 -ApplicationConsistentSnapshotFrequencyInMinutes 15
Name : ed69e451-878b-4f19-9c0f-73184be05eaf
ID : /Subscriptions/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/resourceGroups/xxxxxxxxxxxx/providers/Microsoft.RecoveryServices/vaults/xxxxxxxxxxxx/replicationJobs/ed69e451-878b-4f19-9c0f-73184be05eaf
Type :
JobType :
DisplayName :
ClientRequestId : d8922fa2-303c-4eb4-b556-e07969ea6fba ActivityId: 9e946cdf-2351-44c2-9aef-70ef2eab29b4
State : NotStarted
StateDescription : NotStarted
StartTime :
EndTime :
TargetObjectId :
TargetObjectType :
TargetObjectName :
AllowedActions :
Tasks : {}
Errors : {}
Example 4
PS C:\> $Job = New-AzureRmRecoveryServicesAsrPolicy -Name $TestPolicy1 -AzureToAzure -RecoveryPointRetentionInHours 10 -ApplicationConsistentSnapshotFrequencyInHours 5
PS C:\> Get-AsrJob -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 specifying that the replication policy being created will be used to replicated Azure virtual machines between two Azure regions.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-AzureToVMware
Switch parameter specifying that the replication policy being created will be used to reverse replicate failed over VMware virtual machines and Physical servers running in Azure back to an on-premises VMware site.
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: | AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Encryption
{{Fill Encryption Description}}
Type: | String |
Accepted values: | Enable, Disable |
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 |
-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