Posted in : Azure, NetScaler By Simon Gottschlag Translate with Google ⟶

7 years ago

Microsoft has released a tech preview to support multiple IPs on the same NIC in Azure. I’ve tried it with NetScaler and seems to be working like expected!
More info about it can be found here: Assign multiple IP addresses to virtual machines using PowerShell
As always, logon and select your subscription using PowerShell:

Register-AzureRmProviderFeature -FeatureName AllowMultipleIpConfigurationsPerNic -ProviderNamespace Microsoft.Network
Register-AzureRmProviderFeature -FeatureName AllowLoadBalancingonSecondaryIpconfigs -ProviderNamespace Microsoft.Network
Register-AzureRmResourceProvider -ProviderNamespace Microsoft.Network

FYI: This may take a few minutes. Even after registring the features (and seeing them being registered), I received the following error message when trying to assign multiple IP configurations to one NIC: Subscription <ID> is not registered for feature Microsoft.Network/AllowMultipleIpConfigurationsPerNic required to carry out the requested operation.
It started working for me after running Register-AzureRmResourceProvider, but maybe I just didn’t wait long enough.
Verify that they have the state ”Registered”:

PS C:\Users\Simon> Get-AzureRmProviderFeature
FeatureName                            ProviderName      RegistrationState
-----------                            ------------      -----------------
AllowLoadBalancingonSecondaryIpconfigs Microsoft.Network Registered
AllowMultipleIpConfigurationsPerNic    Microsoft.Network Registered

You can now go to the portal and assign new IP configurations, or do it from PowerShell. See below for how I added new IPs to an already existing NetScaler:

$VMName = "<VM Name>"
$RGName = "<Resource Group Name>"
$Location = (Get-AzureRmResourceGroup -Name $RGName).Location
$NICName = "<NIC Name>"
$SubnetName = "<Subnet Name>"
$VNET = Get-AzureRmVirtualNetwork -ResourceGroupName $RGName -Name $VNETName
$Subnet = Get-AzureRmVirtualNetworkSubnetConfig -VirtualNetwork $VNET | ?{$_.Name -eq $SubnetName}
$PIPName02 = "pip-$($VMName)-snip"
$PublicIp02 = New-AzureRmPublicIpAddress -Name $PIPName02 -ResourceGroupName $RGName -Location $Location -AllocationMethod Static
$PIPName03 = "pip-$($VMName)-vip"
$PublicIp03 = New-AzureRmPublicIpAddress -Name $PIPName03 -ResourceGroupName $RGName -Location $Location -AllocationMethod Static
$NIC = Get-AzureRmNetworkInterface -Name $NICName -ResourceGroupName $RGName
Add-AzureRmNetworkInterfaceIpConfig -Name ipcfg-02-snip -NetworkInterface $NIC -Subnet $Subnet -PublicIpAddress $PublicIp02 -PrivateIpAddress <Private IP for SNIP>
Add-AzureRmNetworkInterfaceIpConfig -Name ipcfg-03-vip -NetworkInterface $NIC -Subnet $Subnet -PublicIpAddress $PublicIp03 -PrivateIpAddress <Private IP for VIP>
Set-AzureRmNetworkInterface -NetworkInterface $NIC

Now, just add a SNIP and then start working with your VIP or VIPs in NetScaler. Remember, this is still a Tech preview and shouldn’t be used in production – you may not get support from Microsoft or Citrix if something stops working.

Tags : Azure, NetScaler, Tech Preview

Personlig rådgivning

Vi erbjuder personlig rådgivning med författaren för 1400 SEK per timme. Anmäl ditt intresse i här så återkommer vi så snart vi kan.

Add comment

Your comment will be revised by the site if needed.