Product Documentation

Appendix

May 20, 2016
This appendix provides cmdlets with which you can do the following in Azure PowerShell:
  • Provision and configure NetScaler in Azure Resource Manager
    • Provision NetScaler VPX in Standalone Mode
    • Configure NetScaler VPX HA with Azure External Load Balancer
    • Configure NetScaler VPX HA with Azure Internal Load Balancer
  • Provision and configure NetScaler in Azure Service Management
    • Provision NetScaler virtual machines in the Azure cloud
    • Configure NetScaler VPX HA with Azure External Load Balancer
    • Configure NetScaler VPX HA with Azure Internal Load Balancer
    • Provision NetScaler VPX in Azure with Static IIP

Provision NetScaler VPX in Standalone Mode in Azure PowerShell

1.   Resource Group creation

$rgName="<resource group name>"

$locName="<location name, such as West US>"

New-AzureRmResourceGroup -Name $rgName -Location $locName

For example:

$rgName = "ARM-VPX"

$locName = "East Asia"

New-AzureRmResourceGroup -Name $rgName -Location $locName

 

2.   Storage account creation: You must pick a globally unique name for your storage account that contains only lowercase letters and numbers.

$saName="<storage account name>"

$saType="<storage account type, specify one: Standard_LRS, Standard_GRS, Standard_RAGRS, or Premium_LRS>"

New-AzureRmStorageAccount -Name $saName -ResourceGroupName $rgName –Type $saType -Location $locName

For example:

$saName="vpxstorage"

$saType="Standard_LRS"

New-AzureRmStorageAccount -Name $saName -ResourceGroupName $rgName –Type $saType -Location $locName

 

3.   Availability Set

$avName="<availability set name>"

New-AzureRmAvailabilitySet –Name $avName –ResourceGroupName $rgName -Location $locName

 

4.   Add new Vnet with at least one subnet if it is not created previously.

$frontendSubnet=New-AzureRmVirtualNetworkSubnetConfig -Name frontendSubnet -AddressPrefix 10.0.1.0/24 ß (this parameter value should be as per your requirement)

$backendSubnet=New-AzureRmVirtualNetworkSubnetConfig -Name backendSubnet -AddressPrefix 10.0.2.0/24

New-AzureRmVirtualNetwork -Name TestNet -ResourceGroupName $rgName -Location $locName -AddressPrefix 10.0.0.0/16 -Subnet $frontendSubnet,$backendSubnet

For example:

$frontendSubnet=New-AzureRmVirtualNetworkSubnetConfig -Name frontendSubnet -AddressPrefix 10.0.1.0/24

$backendSubnet=New-AzureRmVirtualNetworkSubnetConfig -Name backendSubnet -AddressPrefix 10.0.2.0/24

New-AzureRmVirtualNetwork -Name TestNet -ResourceGroupName $rgName -Location $locName -AddressPrefix 10.0.0.0/16

 -Subnet $frontendSubnet,$backendSubnet

 

5.   Create NIC:

From above subnets, frontend Subnet is at index 0 and backend Subnet is at index 1. NIC can be created in multiple ways:

a)      NIC with Public IP address:

$nicName="<name of the NIC of the VM>"

$pip = New-AzureRmPublicIpAddress -Name $nicName -ResourceGroupName $rgName -Location $locName -AllocationMethod Dynamic

$nic = New-AzureRmNetworkInterface -Name $nicName -ResourceGroupName $rgName -Location $locName -SubnetId $vnet.Subnets[$subnetIndex].Id -PublicIpAddressId $pip.Id

b)     NIC with Public IP and DNS label

$nicName="<name of the NIC of the VM>"

$domName="<domain name label>"

$pip = New-AzureRmPublicIpAddress -Name $nicName -ResourceGroupName $rgName -DomainNameLabel $domName -Location $locName -AllocationMethod Dynamic

Before assigning $domName, check it is available or not by using command:

Test-AzureRmDnsAvailability -DomainQualifiedName $domName -Location $locName

$nic = New-AzureRmNetworkInterface -Name $nicName -ResourceGroupName $rgName -Location $locName -SubnetId $vnet.Subnets[$subnetIndex].Id -PublicIpAddressId $pip.Id

For example:

$nicName="frontendNIC"

$domName="vpxazure"

$pip = New-AzureRmPublicIpAddress -Name $nicName -ResourceGroupName $rgName -DomainNameLabel $domName -Location

$locName -AllocationMethod Dynamic

$nic = New-AzureRmNetworkInterface -Name $nicName -ResourceGroupName $rgName -Location $locName -SubnetId $vnet.

Subnets[0].Id -PublicIpAddressId $pip.Id

c)      NIC with Dynamic Public Address and Static Private IP address       

$nicName="<name of the NIC of the VM>"

$staticIP="<available static IP address on the subnet>"

$pip = New-AzureRmPublicIpAddress -Name $nicName -ResourceGroupName $rgName -Location $locName -AllocationMethod Dynamic

$nic = New-AzureRmNetworkInterface -Name $nicName -ResourceGroupName $rgName -Location $locName -SubnetId $vnet.Subnets[$subnetIndex].Id -PublicIpAddressId $pip.Id -PrivateIpAddress $staticIP

 

6.   Create VM object.

$vmName="<VM name>"

$vmSize="<VM size string>"

$avSet=Get-AzureRmAvailabilitySet –Name $avName –ResourceGroupName $rgName

$vm=New-AzureRmVMConfig -VMName $vmName -VMSize $vmSize -AvailabilitySetId $avset.Id

 

7.    Get required image

$pubName="<Image publisher name>"

$offerName="<Image offer name>"

$skuName="<Image SKU name>"

$cred=Get-Credential -Message "Type the name and password of the local administrator account."

Provide your credentials that is used to login into VPX

$vm=Set-AzureRmVMOperatingSystem -VM $vm -Linux -ComputerName $vmName -Credential $cred -Verbose

$vm=Set-AzureRmVMSourceImage -VM $vm -PublisherName $pubName -Offer $offerName -Skus $skuName -Version "latest"

$vm=Add-AzureRmVMNetworkInterface -VM $vm -Id $nic.Id

For example:

$pubName="citrix"

 

The following command is used for displaying all offers from Citrix:

Get-AzureRMVMImageOffer -Location $locName -Publisher $pubName | Select Offer

$offerName="netscalervpx110-6531"

 

The following command is used to know sku offered by publisher for specific offer name:

Get-AzureRMVMImageSku -Location $locName -Publisher $pubName -Offer $offerName | Select Skus

 

8.   Create VM

$diskName="<name identifier for the disk in Azure storage, such as OSDisk>"

For example:

$diskName="dynamic”

$storageAcc=Get-AzureRmStorageAccount -ResourceGroupName $rgName -Name $saName

$osDiskUri=$storageAcc.PrimaryEndpoints.Blob.ToString() + "vhds/" + $diskName  + ".vhd"

$vm=Set-AzureRmVMOSDisk -VM $vm -Name $diskName -VhdUri $osDiskUri -CreateOption fromImage

When you create VM from Images present in marketplace, use the following command to specify the VM plan:

Set-AzureRmVMPlan -VM $vm -Publisher citrix -Product netscalervpx110-6531 -Name netscalerbyol

 

Note: Product parameter should match with offer name parameter specified earlier. Name parameter should match with sku that was selected previously.

New-AzureRmVM -ResourceGroupName $rgName -Location $locName -VM $vm

Provision NetScaler VPX in HA with Azure External Load Balancer

1)      Resource Group creation

$rgName="<resource group name>"

$locName="<location name, such as West US>"

New-AzureRmResourceGroup -Name $rgName -Location $locName

For example:

$rgName = "ARM-LB-NS"

$locName = "East Asia"

New-AzureRmResourceGroup -Name $rgName -Location $locName

 

2)      Storage account creation: You must pick a globally unique name for your storage account that contains only lowercase letters and numbers.

$saName="<storage account name>"

$saType="<storage account type, specify one: Standard_LRS, Standard_GRS, Standard_RAGRS, or Premium_LRS>"

New-AzureRmStorageAccount -Name $saName -ResourceGroupName $rgName –Type $saType -Location $locName

For example:

$saName="vpxstorage"

$saType="Standard_LRS"

New-AzureRmStorageAccount -Name $saName -ResourceGroupName $rgName –Type $saType -Location $locName

 

3)      Availability Set

$avName="<availability set name>"

New-AzureRmAvailabilitySet –Name $avName –ResourceGroupName $rgName -Location $locName

 

4)      Add new Vnet with atleast one subnet if it is not created previously.

$vnetName = “LBVnet”

$frontendSubnet=New-AzureRmVirtualNetworkSubnetConfig -Name frontendSubnet -AddressPrefix 10.0.1.0/24

Note: The AddressPrefix parameter value should be as per your requirement.

$backendSubnet=New-AzureRmVirtualNetworkSubnetConfig -Name backendSubnet -AddressPrefix 10.0.2.0/24

New-AzureRmVirtualNetwork -Name $vnetName -ResourceGroupName $rgName -Location $locName -AddressPrefix 10.0.0.0/16 -Subnet $frontendSubnet,$backendSubnet

 

5)      Create Public IP

$publicIP1 = New-AzureRmPublicIpAddress -Name PublicIp1 -ResourceGroupName $rgName -Location $locName –AllocationMethod Static -DomainNameLabel nsvpx

Note: Before using, check for the availability of the value for DomainNameLabel.

 

6)      Create Fronted IP for given public IP

$FIPName = “ELBFIP”

$frontendIP1 = New-AzureRmLoadBalancerFrontendIpConfig -Name $FIPName -PublicIpAddress $publicIP1

 

7)      Create backend pool

$BEPool = “LB-backend-Pool”

$beaddresspool1= New-AzureRmLoadBalancerBackendAddressPoolConfig -Name $BEPool

 

8)      Create health probe:

Create TCP health probe with port 9000 and interval 5 seconds.

$healthProbe = New-AzureRmLoadBalancerProbeConfig -Name HealthProbe -Protocol Tcp -Port 9000 –IntervalInSeconds 5 -ProbeCount 2

 

9)      Create LB rule for services for which you want to do load balancing.

For example, here we are load balancing http service.

$lbrule1 = New-AzureRmLoadBalancerRuleConfig -Name "HTTP-LB" -FrontendIpConfiguration $frontendIP1 -BackendAddressPool  $beAddressPool1 -Probe $healthProbe -Protocol Tcp -FrontendPort 80 -BackendPort 80

 

10)   Create Inbound NAT Rules:

For Services, which does not require to load balanced, create NAT rules.

For example, ssh access to VPX instance.

Note: Protocol-FrontEndPort-BackendPort triplet should not be same for two NAT rules.

$inboundNATRule1= New-AzureRmLoadBalancerInboundNatRuleConfig -Name SSH1 -FrontendIpConfiguration $frontendIP1 -Protocol TCP -FrontendPort 22 -BackendPort 22

$inboundNATRule2= New-AzureRmLoadBalancerInboundNatRuleConfig -Name SSH2 -FrontendIpConfiguration $frontendIP1 -Protocol TCP -FrontendPort 10022 -BackendPort 22

11)   Create Load balancer entity

$NRPLB = New-AzureRmLoadBalancer -ResourceGroupName $rgName -Name ELB -Location $locName -InboundNatRule $inboundNATRule1, $inboundNATRule2 -FrontendIpConfiguration $frontendIP1 -LoadBalancingRule $lbrule1 -BackendAddressPool $beAddressPool1 -Probe $healthProbe

 

12)   Create NICs.

Create two NICs and associate each NIC with each VPX instance

a)      NIC1 with VPX1

For example:

$nicName="NIC1”

$lbName="ELB"

$bePoolIndex=0  ß Rule indexes starts from 0.

$natRuleIndex=0

$subnetIndex=0 ß Frontend subnet index

$lb=Get-AzureRmLoadBalancer -Name $lbName -ResourceGroupName $rgName

$nic1=New-AzureRmNetworkInterface -Name $nicName -ResourceGroupName $rgName -Location $locName -Subnet $vnet.Subnets[$subnetIndex] -LoadBalancerBackendAddressPool $lb.BackendAddressPools[$bePoolIndex] -LoadBalancerInboundNatRule $lb.InboundNatRules[$natRuleIndex]

b)      NIC2 with VPX2

For example:

$nicName="NIC2”

$lbName="ELB"

$bePoolIndex=0

$natRuleIndex=1 ß Second Inbound NAT (ssh) rule we need to use

$subnetIndex=0 ß Frontend subnet index

$lb=Get-AzureRmLoadBalancer -Name $lbName -ResourceGroupName $rgName

$nic2=New-AzureRmNetworkInterface -Name $nicName -ResourceGroupName $rgName -Location $locName -Subnet $vnet.Subnets[$subnetIndex] -LoadBalancerBackendAddressPool $lb.BackendAddressPools[$bePoolIndex] -LoadBalancerInboundNatRule  $lb.InboundNatRules[$natRuleIndex]

 

13)   Now create VPX instances.

We will create two VPX instances part of same resource group and availability set and attach it to External Load balancer.

a)      VPX 1

For example:

$vmName="VPX1"

$vmSize="Standard_A3"

$avSet=Get-AzureRmAvailabilitySet –Name $avName –ResourceGroupName $rgName

$vm1=New-AzureRmVMConfig -VMName $vmName -VMSize $vmSize -AvailabilitySetId $avset.Id

$cred=Get-Credential -Message "Type Credentials which will be used to login to VPX instance"

$vm1=Set-AzureRmVMOperatingSystem -VM $vm1 -Linux -ComputerName $vmName -Credential $cred -Verbose

$vm1=Set-AzureRmVMSourceImage -VM $vm1 -PublisherName $pubName -Offer $offerName -Skus $skuName -Version "latest"

$vm1=Add-AzureRmVMNetworkInterface -VM $vm1 -Id $nic1.Id

$diskName="dynamic” 

$storageAcc=Get-AzureRmStorageAccount -ResourceGroupName $rgName -Name $saName

$osDiskUri1=$storageAcc.PrimaryEndpoints.Blob.ToString() + "vhds1/" + $diskName  + ".vhd"

$vm1=Set-AzureRmVMOSDisk -VM $vm1 -Name $diskName -VhdUri $osDiskUri1 -CreateOption fromImage

Set-AzureRmVMPlan -VM $vm1 -Publisher $pubName -Product $offerName -Name $skuName

New-AzureRmVM -ResourceGroupName $rgName -Location $locName -VM $vm1

 

b)      VPX2

For example:

$vmName="VPX2"

$vmSize="Standard_A3"

$avSet=Get-AzureRmAvailabilitySet –Name $avName –ResourceGroupName $rgName

$vm2=New-AzureRmVMConfig -VMName $vmName -VMSize $vmSize -AvailabilitySetId $avset.Id

$cred=Get-Credential -Message " Type Credentials which will be used to login to VPX instance "

$vm2=Set-AzureRmVMOperatingSystem -VM $vm2 -Linux -ComputerName $vmName -Credential $cred -Verbose

$vm2=Set-AzureRmVMSourceImage -VM $vm2 -PublisherName $pubName -Offer $offerName -Skus $skuName -Version "latest"

$vm2=Add-AzureRmVMNetworkInterface -VM $vm2 -Id $nic2.Id

$diskName="dynamic” 

$storageAcc=Get-AzureRmStorageAccount -ResourceGroupName $rgName -Name $saName

$osDiskUri1=$storageAcc.PrimaryEndpoints.Blob.ToString() + "vhds2/" + $diskName  + ".vhd"

$vm2=Set-AzureRmVMOSDisk -VM $vm2 -Name $diskName -VhdUri $osDiskUri1 -CreateOption fromImage

Set-AzureRmVMPlan -VM $vm2 -Publisher $pubName -Product $offerName -Name $skuName

New-AzureRmVM -ResourceGroupName $rgName -Location $locName -VM $vm2

 

14)   When the VPX instances comes up, then ssh to both vpx instances to configure the VMs:

a)      Active-Active: Run the same set of configuration commands on NetScaler CLI.

b)      Active-Passive: Run this command on NetScaler CLI on both nodes

add ha node #nodeID <nsip of otherVPX>

Then, run configuration commands on primary node only.

Provision NetScaler VPX in HA with Azure Internal Load Balancer

1.     Resource Group creation

$rgName="<resource group name>"

$locName="<location name, such as West US>"

New-AzureRmResourceGroup -Name $rgName -Location $locName

For example:

$rgName = "ARM-LB-NS"

$locName = "East Asia"

New-AzureRmResourceGroup -Name $rgName -Location $locName

2.     Storage account creation:

You must select a globally unique name for your storage account that contains only lowercase letters and numbers.

$saName="<storage account name>"

$saType="<storage account type, specify one: Standard_LRS, Standard_GRS, Standard_RAGRS, or Premium_LRS>"

New-AzureRmStorageAccount -Name $saName -ResourceGroupName $rgName –Type $saType -Location $locName

For example:

$saName="vpxstorage"

$saType="Standard_LRS"

New-AzureRmStorageAccount -Name $saName -ResourceGroupName $rgName –Type $saType -Location $locName

3.     Availability Set

$avName="<availability set name>"

New-AzureRmAvailabilitySet –Name $avName –ResourceGroupName $rgName -Location $locName

For example:

$avname=”HA-AV1”

4.     Add new Vnet with atleast one subnet if it is not created previously.

$vnetName = “LBVnet”

5.     $frontendSubnet=New-AzureRmVirtualNetworkSubnetConfig -Name frontendSubnet -AddressPrefix 10.0.1.0/24 ß (this parameter value should be as per your requirement)

6.     $backendSubnet=New-AzureRmVirtualNetworkSubnetConfig -Name backendSubnet -AddressPrefix 10.0.2.0/24 ß (this parameter value should be as per your requirement)

7.     Assign frontendSubnet and Backendsubnet to vnet-

$vnet=New-AzureRmVirtualNetwork -Name $vnetName -ResourceGroupName $rgName -Location $locName -AddressPrefix 10.0.0.0/16 -Subnet $frontendSubnet,$backendSubnet

For example:

AddressPrefix-2.0.0.0/16

8.     $frontendIP = New-AzureRmLoadBalancerFrontendIpConfig -Name LB-Frontend -PrivateIpAddress 10.0.2.5 -SubnetId $vnet.subnets[0].Id

If frontend subnet is the first element of array vnet  SubnetId will be $vnet.Subnets[0].Id if it’s the second element it should be $vnet.Subnets[1].Id and so on.

For example: PrivateAddressIP-10.0.2.6

For example:  PrivateAddressIP-2.0.2.5

9.     $beaddresspool= New-AzureRmLoadBalancerBackendAddressPoolConfig -Name "LB-backend"

10.  $inboundNATRule1= New-AzureRmLoadBalancerInboundNatRuleConfig -Name "Inboundnatrule1" -FrontendIpConfiguration $frontendIP -Protocol TCP -FrontendPort 3441 -BackendPort 3389

              

Front end port and backend port can be as per user requirement.

For example: 8080, 8081

11.  $inboundNATRule2= New-AzureRmLoadBalancerInboundNatRuleConfig -Name "RDP2" -FrontendIpConfiguration $frontendIP -Protocol TCP -FrontendPort 3442 -BackendPort 3389

Front end port and backend port can be as per user requirement.

For example: 8080, 8081

12.  $healthProbe = New-AzureRmLoadBalancerProbeConfig -Name "HealthProbe"  " -Protocol tcp -Port 9000 -IntervalInSeconds 5 -ProbeCount 2

13.  $lbrule = New-AzureRmLoadBalancerRuleConfig -Name "lbrule1" -FrontendIpConfiguration $frontendIP -BackendAddressPool $beAddressPool -Probe $healthProbe -Protocol Tcp -FrontendPort 80 -BackendPort 80

Front end port and backend port can be as per user requirement.

14.  Create the load balancer.

$NRPLB = New-AzureRmLoadBalancer -ResourceGroupName $rgname -Name "InternalLB" -Location $locName -FrontendIpConfiguration $frontendIP -InboundNatRule $inboundNATRule1,$inboundNatRule2 -LoadBalancingRule $lbrule -BackendAddressPool $beAddressPool -Probe $healthProbe

15.  $backendnic1= New-AzureRmNetworkInterface -ResourceGroupName $rgName -Name lb-nic1-be -Location $locName -PrivateIpAddress 10.0.2.6 -Subnet $backendSubnet -LoadBalancerBackendAddressPool $nrplb.BackendAddressPools[0] -LoadBalancerInboundNatRule $nrplb.InboundNatRules[0]

This nic is for vpx1.

The parameter PrivateIpAddress can have any private ip  as per user requirement.Eg-10.0.2.14

16.  $backendnic2= New-AzureRmNetworkInterface -ResourceGroupName "NRP-RG" -Name lb-nic2-be -Location $locName -PrivateIpAddress 10.0.2.7 -Subnet $backendSubnet -LoadBalancerBackendAddressPool $nrplb.BackendAddressPools[0] -LoadBalancerInboundNatRule $nrplb.InboundNatRules[1].

This nic is for vpx2.The parameter Private IPAddress can have any private Ip as per user      requirement.

For example: 10.0.2.15

17.  Now create VPX instances.

We will create two VPX instances part of same resource group and availability set and attach it to External Load balancer.

        a.     VPX 1

Parameter samples:

$vmName="VPX1"

$vmSize="Standard_A3"

$avSet=Get-AzureRmAvailabilitySet –Name $avName –ResourceGroupName $rgName

$vm1=New-AzureRmVMConfig -VMName $vmName -VMSize $vmSize -AvailabilitySetId $avset.Id

$cred=Get-Credential -Message "Type Credentials which will be used to login to VPX instance"

$vm1=Set-AzureRmVMOperatingSystem -VM $vm1 -Linux -ComputerName $vmName -Credential $cred -Verbose

$vm1=Set-AzureRmVMSourceImage -VM $vm1 -PublisherName $pubName -Offer $offerName -Skus $skuName -Version "latest"

$vm1=Add-AzureRmVMNetworkInterface -VM $vm1 -Id $backendnic1.Id

$diskName="dynamic”         

$storageAcc=Get-AzureRmStorageAccount -ResourceGroupName $rgName -Name $saName

$osDiskUri1=$storageAcc.PrimaryEndpoints.Blob.ToString() + "vhds1/" + $diskName  + ".vhd"

$vm1=Set-AzureRmVMOSDisk -VM $vm1 -Name $diskName -VhdUri $osDiskUri1 -CreateOption fromImage

Set-AzureRmVMPlan -VM $vm1 -Publisher $pubName -Product $offerName -Name $skuName

New-AzureRmVM -ResourceGroupName $rgName -Location $locName -VM $vm1

             b.     VPX2

Sample Parameters.

$vmName="VPX2"

$vmSize="Standard_A3"

$avSet=Get-AzureRmAvailabilitySet –Name $avName –ResourceGroupName $rgName

$vm2=New-AzureRmVMConfig -VMName $vmName -VMSize $vmSize -AvailabilitySetId $avset.Id

$cred=Get-Credential -Message " Type Credentials which will be used to login to VPX instance "

$vm2=Set-AzureRmVMOperatingSystem -VM $vm2 -Linux -ComputerName $vmName -Credential $cred -Verbose

$vm2=Set-AzureRmVMSourceImage -VM $vm2 -PublisherName $pubName -Offer $offerName -Skus $skuName -Version "latest"

$vm2=Add-AzureRmVMNetworkInterface -VM $vm2 -Id $backendnic2.Id

$diskName="dynamic”         

$storageAcc=Get-AzureRmStorageAccount -ResourceGroupName $rgName -Name $saName

$osDiskUri1=$storageAcc.PrimaryEndpoints.Blob.ToString() + "vhds2/" + $diskName  + ".vhd"

$vm2=Set-AzureRmVMOSDisk -VM $vm2 -Name $diskName -VhdUri $osDiskUri1 -CreateOption fromImage

Set-AzureRmVMPlan -VM $vm2 -Publisher $pubName -Product $offerName -Name $skuName

New-AzureRmVM -ResourceGroupName $rgName -Location $locName -VM $vm2

 

Once both NetScaler VPX instances come up, then connect to both VPX instances through SSH to configure the virtual machines.

  1. To configure Active-Passive HA, run “add HA node #nodeID” command on both nodes and then running configuration commands on Primary VPX instance.
  2. To configure Active-Active HA, run same set of configuration commands on both of nodes.

Provisioning NetScaler VPX with Single NIC by Using Azure PowerShell

$image = Get-AzureVMImage -ImageName "vpx_105_51_1040"  
$vm = New-AzureVMConfig -Name "vpx_bwc_105" -InstanceSize "Medium" -Image $image.ImageName  
Add-AzureProvisioningConfig -VM $vm -Linux -Linuxuser "user" -Password "Citrix123" 
Set-AzureSubnet –SubnetNames “mgmt.-1” –VM  $vm 
Set-AzureStaticVNetIP -IPAddress "10.3.1.10" -VM $vm  
New-AzureService -ServiceName "vpx105" -Location "North Europe" 
Set-AzureEndpoint -Name “SSH” –LocalPort 22 -PublicPort 22 -Protocol tcp -VM $vm 
Add-AzureEndpoint -Name “HTTP” -LocalPort 80 -PublicPort 80 -Protocol tcp -VM $vm  
Add-AzureEndpoint -Name “SSL” –LocalPort 443 -PublicPort 443 -Protocol tcp -VM $vm  
New-AzureVM -ServiceName "vpx105" -VNetName "systemtestazure" -VM $vm

Configuring NetScaler VPX HA with Azure External Load Balancer by Using Azure PowerShell

$vm1 = "vpxne1" 
$vm2 = "vpxne2” 
$svc = "vpxne" 
$lbsetname = "azurelb" 
$epname = "vip" 
 
Get-AzureVM -Name $vm1 -ServiceName $svc | Add-AzureEndpoint -LBSetName $lbsetname -Name  
$epname -Protocol "tcp" -LocalPort 15000 -PublicPort 15000 –ProbeProtocol TCP –ProbePort  
9000 –ProbeIntervalInSeconds 5 | Update-AzureVM 
 
Get-AzureVM -Name $vm1 -ServiceName $svc | Add-AzureEndpoint -LBSetName $lbsetname -Name  
$epname -Protocol "tcp" -LocalPort 15000 -PublicPort 15000 –ProbeProtocol TCP –ProbePort  
9000 –ProbeIntervalInSeconds 5 | Update-AzureVM

Configuring NetScaler VPX HA with Azure Internal Load Balancer by Using Azure PowerShell

$svc = "vpxne" [Cloud service name]  
$ilb = "vpx-ilb" [Name of the internal load balancer] $subnet = "mgmtsub"  
[Management subnet where the default NIC exists]  
$IP = "10.3.1.50" [IP address from the management subnet]  
 
Add-AzureInternalLoadBalancer -ServiceName $svc -InternalLoadBalancerName $ilb  
–SubnetName $subnet –StaticVNetIPAddress $IP  
 
$vm1 = "vpxne1"  
$vm2 = "vpxne2"  
$epname = "vip2"  
$prot = "TCP"  
$locport = 1500  
$pubport = 1500  
$lbsetname = "azure_ilb"  
 
Get-AzureVM -ServiceName $svc -Name $vm1 | Add-AzureEndpoint -Name $epname -Protocol  
$prot -LocalPort $locport -PublicPort $pubport -LBSetName $lbsetname -InternalLoadBalancerName 
 $ilb –ProbeProtocol TCP –ProbePort 9000 –ProbeIntervalInSeconds 5 | Update-AzureVM  
 
Get-AzureVM -ServiceName $svc -Name $vm2 | Add-AzureEndpoint -Name $epname -Protocol  
$prot -LocalPort $locport -PublicPort $pubport -LBSetName $lbsetname -InternalLoadBalancerName 
 $ilb –ProbeProtocol TCP –ProbePort 9000 –ProbeIntervalInSeconds 5 | Update-AzureVM

Provisioning NetScaler VPX on Azure with a Static IIP by Using Azure PowerShell

Before you begin provisioning the virtual machine with a static internal IP address, make sure that
  • Azure virtual network is configured
  • You have downloaded Azure PowerShell

Run the following commands on Azure PowerShell to provision NetScaler VPX on Azure with static IIP.

$image = Get-AzureVMImage -ImageName “image1045" 
 
$vm = New-AzureVMConfig -Name "vpx3" -InstanceSize "Medium" -Image $image.ImageName 
 
Add-AzureProvisioningConfig -VM $vm -Linux -Linuxuser "user" -Password “Citrix123” 
 
Set-AzureSubnet 
 
–SubnetNames 
 
“mgmt-1” -VM $vm 
 
Set-AzureStaticVNetIP -IPAddress “1.10.1.5" -VM $vm 
 
New-AzureService -ServiceName “singlevpx" -Location "North Europe”  <To add new cloud service> 
 
Set-AzureEndpoint -Name “SSH” –LocalPort 22 -PublicPort 1322 -Protocol tcp -VM $vm 
 
New-AzureVM -ServiceName “singlevpx" -VNetName “pcwestus" -VM $vm