Redigera

Dela via


New-AzRecoveryServicesAsrVMNicConfig

Creates an ASR NIC config that contains the failover and test failover related configuration details.

Syntax

New-AzRecoveryServicesAsrVMNicConfig
   -NicId <String>
   -ReplicationProtectedItem <ASRReplicationProtectedItem>
   [-RecoveryVMNetworkId <String>]
   [-RecoveryNicName <String>]
   [-RecoveryNicResourceGroupName <String>]
   [-ReuseExistingNic]
   [-RecoveryNetworkSecurityGroupId <String>]
   [-EnableAcceleratedNetworkingOnRecovery]
   [-TfoVMNetworkId <String>]
   [-TfoNicName <String>]
   [-TfoNicResourceGroupName <String>]
   [-TfoReuseExistingNic]
   [-TfoNetworkSecurityGroupId <String>]
   [-EnableAcceleratedNetworkingOnTfo]
   [-IPConfig <PSIPConfigInputDetails[]>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The New-AzRecoveryServicesAsrVMNicConfig cmdlet creates an ASR NIC config object that contains the failover and test failover related details. In case any information is not passed, the corresponding values are picked from the replication protected item to avoid these values being updated to null.

Important

We have deprecated the parameters corresponding to IP Configs from the cmdlet, and encapsulated them into a new cmdlet object. Please create a new object using the cmdlet New-AzRecoveryServicesAsrVMNicIPConfig and pass that as a parameter. Please refer to the examples below for more clarity.

Examples

Example 1

$ipConfig1 = New-AzRecoveryServicesAsrVMNicIPConfig -IpConfigName "ipconfig1" -RecoverySubnetName "default" `
-TfoSubnetName "default" -RecoveryStaticIPAddress "10.1.40.10" -TfoStaticIPAddress "10.3.4.33"
$ipConfig2 = New-AzRecoveryServicesAsrVMNicIPConfig -IpConfigName "ipconfig2" -IsSelectedForFailover -RecoverySubnetName "default" `
-TfoSubnetName "default" -RecoveryStaticIPAddress "10.1.40.13" -TfoStaticIPAddress "10.3.4.32"
$ipConfigs = @($ipConfig1, $ipConfig2)
$nicConfig = New-AzRecoveryServicesAsrVMNicConfig -NicId $AsrNicGuid -ReplicationProtectedItem $Rpi -RecoveryVMNetworkId $recoveryNetworkId `
    -TfoVMNetworkId $tfoNetworkId -IPConfig $ipConfigs

Creates an ASRVmNicConfig object with the failover and test failover networking settings configured for the NIC. Any property that's not passed above is fetched from the protected item passed.

Example 2

$nicConfig = New-AzRecoveryServicesAsrVMNicConfig -NicId $AsrNicGuid -ReplicationProtectedItem $Rpi -TfoNicName $TfoNicName -TfoNicResourceGroupName $TfoNicRgName -TfoReuseExistingNic

Creates an ASRVmNicConfig object with the test faiover networking settings configured for the NIC renaming. Any property that's not passed above is fetched from the protected item passed.

Parameters

-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

-EnableAcceleratedNetworkingOnRecovery

Specifies whether accelerated networking is enabled on recovery NIC.

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

-EnableAcceleratedNetworkingOnTfo

Specifies whether accelerated networking is enabled on test failover NIC.

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

-IPConfig

Specifies test failover/failover settings of NIC IP configs.

Type:PSIPConfigInputDetails[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-NicId

Specify the ASR NIC GUID.

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

-RecoveryNetworkSecurityGroupId

Specifies the ID of the NSG associated with recovery NIC.

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

-RecoveryNicName

Specifies the name of the recovery NIC.

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

-RecoveryNicResourceGroupName

Specifies the name of the recovery NIC resource group.

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

-RecoveryVMNetworkId

Specifies the ID of the recovery virtual network.

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

-ReplicationProtectedItem

Specify the ASR Replication Protected Item.

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

-ReuseExistingNic

Specifies whether an existing NIC can be used during failover.

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

-TfoNetworkSecurityGroupId

Specifies the ID of the NSG associated with test failover NIC.

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

-TfoNicName

Specifies the name of the test failover NIC.

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

-TfoNicResourceGroupName

Specifies the name of the test failover NIC resource group.

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

-TfoReuseExistingNic

Specifies whether an existing NIC can be used during test failover.

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

-TfoVMNetworkId

Specifies the ID of the test failover virtual network.

Type:String
Position:Named
Default value:None
Required:False
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

ASRVMNicConfig