New-AzureSiteRecoveryStorageMapping

Creates a mapping between an Azure Storage object and recovery Storage object.

Note

The cmdlets referenced in this documentation are for managing legacy Azure resources that use Azure Service Manager (ASM) APIs. This legacy PowerShell module isn't recommended when creating new resources since ASM is scheduled for retirement. For more information, see Azure Service Manager retirement.

The Az PowerShell module is the recommended PowerShell module for managing Azure Resource Manager (ARM) resources with PowerShell.

Syntax

New-AzureSiteRecoveryStorageMapping
   -PrimaryStorage <ASRStorage>
   -RecoveryStorage <ASRStorage>
   [-Profile <AzureSMProfile>]
   [<CommonParameters>]

Description

The New-AzureSiteRecoveryStorageMapping cmdlet creates a mapping between an Azure Site Recovery managed primary Azure Storage object and a recovery Storage object.

Examples

Example 1: Create a mapping between a storage object and a recovery storage object

PS C:\> $Servers = Get-AzureSiteRecoveryServer
PS C:\> $Storages = Get-AzureSiteRecoveryStorage -Server $Servers[0]
PS C:\> New-AzureSiteRecoveryStorageMapping -PrimaryStorage $Storages[0] -RecoveryStorage $Storages[1]

The first command cmdlet gets servers for the current Azure Site Recovery vault by using the Get-AzureSiteRecoveryServer cmdlet. The command stores the Site Recovery servers in the $Servers array variable.

The second command gets the site recovery storage for the first server in the $Servers array, and then stores it in the $Storages.

The final command creates a mapping between the primary network and the recovery network. The command specifies the primary Storage object as the first element of $Storages. The command specifies the recovery Storage object as the second element of $Storages.

Parameters

-PrimaryStorage

Specifies the primary Storage to map to the recovery Storage. To obtain an ASRStorage object, use the Get-AzureSiteRecoveryStorage cmdlet.

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

-Profile

Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile.

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

-RecoveryStorage

Specifies the recovery Storage object. This cmdlet maps the primary Storage object to the Storage object that this parameter specifies. To obtain an ASRStorage object, use Get-AzureSiteRecoveryStorage.

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