< Back

New-AzureRmRecoveryServicesAsrReplicationProtectedItem

Tue Jan 29, 2019 10:01 pm

NAME New-AzureRmRecoveryServicesAsrReplicationProtectedItem



SYNOPSIS

Enables replication for an ASR protectable item by creating a replication protected item.





SYNTAX

New-AzureRmRecoveryServicesAsrReplicationProtectedItem [-VMwareToAzure] -Account <ASRRunAsAccount> [-Confirm] [-DefaultProfile

<IAzureContextContainer>] [-IncludeDiskId <String[]>] [-LogStorageAccountId <String>] -Name <String> -ProcessServer <ASRProcessServer>

-ProtectableItem <ASRProtectableItem> -ProtectionContainerMapping <ASRProtectionContainerMapping> [-RecoveryAzureNetworkId <String>]

-RecoveryAzureStorageAccountId <String> [-RecoveryAzureSubnetName <String>] -RecoveryResourceGroupId <String> [-RecoveryVmName <String>]

[-ReplicationGroupName <String>] [-WaitForCompletion] [-WhatIf] [<CommonParameters>]



New-AzureRmRecoveryServicesAsrReplicationProtectedItem [-AzureToAzure] -AzureToAzureDiskReplicationConfiguration

<ASRAzuretoAzureDiskReplicationConfig[]> -AzureVmId <String> [-Confirm] [-DefaultProfile <IAzureContextContainer>] -Name <String>

-ProtectionContainerMapping <ASRProtectionContainerMapping> [-RecoveryAvailabilitySetId <String>] [-RecoveryCloudServiceId <String>]

-RecoveryResourceGroupId <String> [-RecoveryVmName <String>] [-WaitForCompletion] [-WhatIf] [<CommonParameters>]



New-AzureRmRecoveryServicesAsrReplicationProtectedItem [[-HyperVToAzure]] [-Confirm] [-DefaultProfile <IAzureContextContainer>] -Name <String>

-ProtectableItem <ASRProtectableItem> -ProtectionContainerMapping <ASRProtectionContainerMapping> -RecoveryAzureStorageAccountId <String>

-RecoveryResourceGroupId <String> [-RecoveryVmName <String>] [-WaitForCompletion] [-WhatIf] [<CommonParameters>]



New-AzureRmRecoveryServicesAsrReplicationProtectedItem [[-HyperVToAzure]] [-Confirm] [-DefaultProfile <IAzureContextContainer>] [-IncludeDiskId

<String[]>] [-LogStorageAccountId <String>] -Name <String> -OS {Windows | Linux} -OSDiskName <String> -ProtectableItem <ASRProtectableItem>

-ProtectionContainerMapping <ASRProtectionContainerMapping> [-RecoveryAzureNetworkId <String>] -RecoveryAzureStorageAccountId <String>

[-RecoveryAzureSubnetName <String>] -RecoveryResourceGroupId <String> [-RecoveryVmName <String>] [-WaitForCompletion] [-WhatIf]

[<CommonParameters>]



New-AzureRmRecoveryServicesAsrReplicationProtectedItem [[-VmmToVmm]] [-Confirm] [-DefaultProfile <IAzureContextContainer>] -Name <String>

-ProtectableItem <ASRProtectableItem> -ProtectionContainerMapping <ASRProtectionContainerMapping> [-WaitForCompletion] [-WhatIf]

[<CommonParameters>]





DESCRIPTION

The New-AzureRmRecoveryServicesAsrReplicationProtectedItem cmdlet creates a new replication protected item. Use this cmdlet to enable replication

for an ASR protectable item.





PARAMETERS

-Account <ASRRunAsAccount>

The run as account to be used to push install the Mobility service if needed. Must be one from the list of run as accounts in the ASR fabric.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-AzureToAzure [<SwitchParameter>]

Switch parameter to specify that the replicated item is an Azure virtual machine replicating to a recovery Azure region.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-AzureToAzureDiskReplicationConfiguration <ASRAzuretoAzureDiskReplicationConfig[]>

Specifies the list of virtual machine disks to replicated and the cache storage account and recovery storage account to be used to replicate

the disk.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-AzureVmId <String>

Specifies the azure vm id to be replicated.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Confirm [<SwitchParameter>]

Prompts for confirmation before starting the operation.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-DefaultProfile <IAzureContextContainer>

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



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-HyperVToAzure [<SwitchParameter>]

Switch parameter to specify the replicated item is a Hyper-V virtual machine that is being replicated to Azure.



Required? false

Position? 0

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-IncludeDiskId <String[]>

The list of disks to include for replication. By default all disks are included.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-LogStorageAccountId <String>

Specifies the log or cache storage account Id to be used to store replication logs.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Name <String>

Specifies a name for the ASR replication protected item. The name must be unique within the vault.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-OS <String>

Specifies the operating system family. The acceptable values for this parameter are: Windows or Linux.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-OSDiskName <String>

Specifies the name of the operating system disk.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-ProcessServer <ASRProcessServer>

The Process Server to use to replicate this machine. Use the list of process servers in the ASR fabric corresponding to the Configuration

server to specify one.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-ProtectableItem <ASRProtectableItem>

Specifies the ASR protectable item object for which replication is being enabled.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-ProtectionContainerMapping <ASRProtectionContainerMapping>

Specifies the ASR protection container mapping object corresponding to the replication policy to be used for replication.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-RecoveryAvailabilitySetId <String>

The ID of the AvailabilitySet to recover the machine to in the event of a failover.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-RecoveryAzureNetworkId <String>

The ID of the Azure virtual network to recover the machine to in the event of a failover.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-RecoveryAzureStorageAccountId <String>

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



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-RecoveryAzureSubnetName <String>

The subnet within the recovery Azure virtual network to which the failed over virtual machine should be attached in the event of a failover.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-RecoveryCloudServiceId <String>

Specifies the resource ID of the recovery cloud service to failover this virtual machine to.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-RecoveryResourceGroupId <String>

Specifies the ARM identifier of the resource group in which the virtual machine will be created in the event of a failover.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-RecoveryVmName <String>

Name of the recovery Vm created after failover.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-ReplicationGroupName <String>

Specifies the replication group name to use to create multi-VM consistent recovery points. By default each replication protected item is

created in a group of its own and multi-VM consistent recovery points are not generated. Use this option only if you need to create multi-VM

consistent recovery points across a group of machines by protecting all machines to the same replication group.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-VMwareToAzure [<SwitchParameter>]

Switch parameter to specify the replicated item is a VMware virtual machine or physical server that will be replicate to Azure.



Required? true

Position? 0

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-VmmToVmm [<SwitchParameter>]

Switch parameter to specify the replicated item is a Hyper-V virtual machine that is being replicated between VMM managed Hyper-V sites.



Required? false

Position? 0

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-WaitForCompletion [<SwitchParameter>]

Specifies that the cmdlet should wait for completion of the operation before returning.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

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



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

Microsoft.Azure.Commands.RecoveryServices.SiteRecovery.ASRProtectableItem







OUTPUTS

Microsoft.Azure.Commands.RecoveryServices.SiteRecovery.ASRJob







NOTES









Example 1



PS C:\\> $currentJob = New-AzureRmRecoveryServicesAsrReplicationProtectedItem -ProtectableItem $VM -Name $VM.Name -ProtectionContainerMapping

$ProtectionContainerMapping



Starts the replication protected item creation operation for the specified ASR protectable item and returns the ASR job used to track the

operation.





Example 2



PS C:\\>$job = New-AzureRmRecoveryServicesAsrReplicationProtectedItem -ProtectableItem $pi -Name $rpiName -ProtectionContainerMapping $pcm `

-RecoveryAzureStorageAccountId $RecoveryAzureStorageAccountId -RecoveryResourceGroupId $RecoveryResourceGroupId `

-ProcessServer $fabric.fabricSpecificDetails.ProcessServers[0] -Account $fabric.fabricSpecificDetails.RunAsAccounts[0]



Starts the replication protected item creation operation for the specified ASR protectable item and returns the ASR job used to track the

operation(vmWare to Azure scenario).





Example 3



PS C:>$job = New-AzureRmRecoveryServicesAsrReplicationProtectedItem -AzureToAzure -AzureToAzureDiskReplicationConfig disk1,disk2 -AzureVmId $vmId `

-Name "a2aprotectedItem" -RecoveryVmName "vmName" -ProtectionContainerMapping $pcmMapping -RecoveryResourceGroupId $recoveryResourceGroup



Starts the replication protected item creation operation for the specified ASR protectable item and returns the ASR job used to track the

operation (Azure to Azure scenario).





Example 4



PS C:\\> $disk1 = new-AzureToAzureDiskReplicationConfiguration -vhdUri $diskUri1 -RecoveryAzureStorageAccountId $recoveryAzureStorageAccountId `

-LogStorageAccountId $logStorageAccountId

PS C:\\> $disk2 = new-AzureToAzureDiskReplicationConfiguration -vhdUri $diskUri2 -RecoveryAzureStorageAccountId $recoveryAzureStorageAccountId `

-LogStorageAccountId $logStorageAccountId

PS C:\\> $enableDRjob = New-AzureRmRecoveryServicesAsrReplicationProtectedItem -AzureToAzure -AzureVmId $vmId -Name $rpiName `

-RecoveryCloudServiceId $recoveryCloudServiceId -ProtectionContainerMapping $pcm -RecoveryResourceGroupId $RecoveryResourceGroupId `

-AzureToAzureDiskReplicationConfiguration $disk1,$disk2



Starts the replication protected item creation operation for the specified VmId and returns the ASR job used to track the operation (Azure to

Azure scenario).







RELATED LINKS

Online Version:

https://docs.microsoft.com/en-us/powers ... tecteditem

Get-AzureRmRecoveryServicesAsrReplicationProtectedItem

Remove-AzureRmRecoveryServicesAsrReplicationProtectedItem

Set-AzureRmRecoveryServicesAsrReplicationProtectedItem