CConfigure GSLB on NetScaler VPX instances

NetScaler appliances configured for global server load balancing (GSLB) provide disaster recovery and continuous availability of applications by protecting against points of failure in a wide area network (WAN). GSLB can balance the load across data centers by directing client requests to the closest or best performing data center, or to surviving data centers in case of an outage.

This section describes how to enable GSLB on VPX instances on two sites in a Microsoft Azure environment, by using Windows PowerShell commands.

Note

For more information about GSLB, see Global Server Load Balancing.

You can configure GSLB on a NetScaler VPX instances on Azure, in two steps:

  1. Create a VPX instance with multiple NICs and multiple IP addresses, on each site.
  2. Enable GSLB on the VPX instances.

Note

For more information about configuring multiple NICs and IP addresses see:

Configuring Multiple IPs for a NetScaler VPX Appliance in Standalone Mode.

Configuring Multiple Azure NICs and IPs in NetScaler VPX in an HA Mode

Use Case

This use case includes two sites - Site 1 and Site 2. Each site has a VM (VM1 and VM2) configured with multiple NICs, multiple IP addresses, and GSLB.

Figure. GSLB setup implemented across two sites - Site 1 and Site 2.

localized image

In this use case, each VM has three NICs - NIC 0/1, 1/1, and 1/2. Each NIC can have multiple private and public IP addresses. The NICs are configured for the following purposes.

  • NIC 0/1: to serve management traffic
  • NIC 1/1: to serve client-side traffic
  • NIC 1/2: to communicate with back-end servers

For information about the IP addresses configured on each NIC in this use case, see the IP Configuration Details section.

Parameters

Following are sample parameters settings for this use case in this document. You can use different settings if you wish.

$location=”West Central US”

$vnetName=”NSVPX-vnet”

$RGName=”multiIP-RG”

$prmStorageAccountName=”multiipstorageaccnt”

$avSetName=”MultiIP-avset”

$vmSize=”Standard_DS3_V2”

Note: The minimum requirement for a VPX instance is 2 vCPUs and 2GB RAM.

$publisher=”citrix”

$offer=”netscalervpx111”

$sku=”netscalerbyol”

$version=”latest”

$vmNamePrefix=”MultiIPVPX”

$nicNamePrefix=”MultiipVPX”

$osDiskSuffix=”osdiskdb”

$numberOfVMs=1

$ipAddressPrefix=”10.0.0.”

$ipAddressPrefix1=”10.0.1.”

$ipAddressPrefix2=”10.0.2.”

$pubIPName1=”MultiIP-pip1”

$pubIPName2=”MultiIP-pip2”

$IpConfigName1=”IPConfig1”

$IPConfigName2=”IPConfig-2”

$IPConfigName3=”IPConfig-3”

$IPConfigName4=”IPConfig-4”

$frontendSubnetName=”default”

$backendSubnetName1=”subnet_1”

$backendSubnetName2=”subnet_2”

$suffixNumber=10

1. Create a multi-NIC, multi-IP VM by Using PowerShell commands

Follow steps 1-10 to create VM1 with multiple NICs and multi IP addresses, by using PowerShell commands:

1. Create resource group

2. Create storage account

3. Create availability set

4. Create virtual network

5. Create public IP address

6. Create NICs

7. Create VM config object

8. Get credentials and set OS properties for the VM

9. Add NICs

10. Specify OS disk and create VM

After you complete all the steps and commands to create VM1, repeat these steps to create VM2 with parameters specific to it.

Create Resource Group

New-AzureRMResourceGroup -Name $RGName -Location $location

Create Storage Account

$prmStorageAccount=New-AzureRMStorageAccount -Name $prmStorageAccountName -ResourceGroupName $RGName -Type Standard_LRS -Location $location

Create Availability Set

$avSet=New-AzureRMAvailabilitySet -Name $avSetName -ResourceGroupName $RGName -Location $location

Create Virtual Network

1. Add subnets.

$subnet1=New-AzureRmVirtualNetworkSubnetConfig -Name $frontendSubnetName -AddressPrefix "10.0.0.0/24"
$subnet2=New-AzureRmVirtualNetworkSubnetConfig -Name $backendSubnetName1 -AddressPrefix "10.0.1.0/24"
$subnet3=New-AzureRmVirtualNetworkSubnetConfig -Name $backendSubnetName2 -AddressPrefix "10.0.2.0/24"

2. Add virtual network object.

$vnet=New-AzureRmVirtualNetwork -Name $vnetName -ResourceGroupName $RGName -Location $location -AddressPrefix 10.0.0.0/16 -Subnet $subnet1, $subnet2, $subnet3

3. Retrieve subnets.

$frontendSubnet=$vnet.Subnets|?{$_.Name -eq $frontendSubnetName}
$backendSubnet1=$vnet.Subnets|?{$_.Name -eq $backendSubnetName1}
$backendSubnet2=$vnet.Subnets|?{$_.Name -eq $backendSubnetName2}

Create Public IP Address

$pip1=New-AzureRmPublicIpAddress -Name $pubIPName1 -ResourceGroupName $RGName -Location $location -AllocationMethod Dynamic
$pip2=New-AzureRmPublicIpAddress -Name $pubIPName2 -ResourceGroupName $RGName -Location $location -AllocationMethod Dynamic

Create NICs

NIC 0/1

$nic1Name=$nicNamePrefix + $suffixNumber + "-Mgmnt"
$ipAddress1=$ipAddressPrefix + $suffixNumber
$IPConfig1=New-AzureRmNetworkInterfaceIpConfig -Name $IPConfigName1 -SubnetId $frontendSubnet.Id -PublicIpAddress $pip1 -PrivateIpAddress $ipAddress1 -Primary
$nic1=New-AzureRMNetworkInterface -Name $nic1Name -ResourceGroupName $RGName -Location $location -IpConfiguration $IpConfig1

NIC 1/1

$nic2Name $nicNamePrefix + $suffixNumber + "-frontend"
$ipAddress2=$ipAddressPrefix1 + ($suffixNumber)
$ipAddress3=$ipAddressPrefix1 + ($suffixNumber + 1)
$IPConfig2=New-AzureRmNetworkInterfaceIpConfig -Name $IPConfigName2 -PublicIpAddress $pip2 -SubnetId $backendSubnet1.Id  -PrivateIpAddress $ipAddress2  -Primary
$IPConfig3=New-AzureRmNetworkInterfaceIpConfig -Name $IPConfigName3 -SubnetId $backendSubnet1.Id  -PrivateIpAddress $ipAddress3  
nic2=New-AzureRMNetworkInterface -Name $nic2Name -ResourceGroupName $RGName -Location $location -IpConfiguration $IpConfig2, $IpConfig3

NIC 1/2

$nic3Name=$nicNamePrefix + $suffixNumber + "-backend"
$ipAddress4=$ipAddressPrefix2 + ($suffixNumber)
$IPConfig4=New-AzureRmNetworkInterfaceIpConfig -Name $IPConfigName4 -SubnetId $backendSubnet2.Id -PrivateIpAddress $ipAddress4 -Primary
$nic3=New-AzureRMNetworkInterface -Name $nic3Name -ResourceGroupName $RGName -Location $location -IpConfiguration $IpConfig4

Create VM config object

$vmName=$vmNamePrefix
$vmConfig=New-AzureRMVMConfig -VMName $vmName -VMSize $vmSize -AvailabilitySetId $avSet.Id

Get credentials and set OS properties for the VM

$cred=Get-Credential -Message "Type the name and password for VPX login."
$vmConfig=Set-AzureRMVMOperatingSystem -VM $vmConfig -Linux -ComputerName $vmName -Credential $cred
$vmConfig=Set-AzureRMVMSourceImage -VM $vmConfig -PublisherName $publisher -Offer $offer -Skus $sku -Version $version

Add NICs

$vmConfig=Add-AzureRMVMNetworkInterface -VM $vmConfig -Id $nic1.Id -Primary
$vmConfig=Add-AzureRMVMNetworkInterface -VM $vmConfig -Id $nic2.Id
$vmConfig=Add-AzureRMVMNetworkInterface -VM $vmConfig -Id $nic3.Id

Specify OS disk and create VM

$osDiskName=$vmName + "-" + $osDiskSuffix
$osVhdUri=$prmStorageAccount.PrimaryEndpoints.Blob.ToString() + "vhds/" +$osDiskName + ".vhd"
$vmConfig=Set-AzureRMVMOSDisk -VM $vmConfig -Name $osDiskName -VhdUri $osVhdUri -CreateOption fromImage
Set-AzureRmVMPlan -VM $vmConfig -Publisher $publisher -Product $offer -Name $sku
New-AzureRMVM -VM $vmConfig -ResourceGroupName $RGName -Location $location

Note

Repeat steps 1-10 listed in “Create Multi-NIC VMs by Using PowerShell Commands” to create VM2 with parameters specific to VM2.

IP Configuration details

In this use case, the following IP addresses are used.

Table 1. IP addresses used in VM1

NIC Private IP Public IP (PIP) Description
0/1 10.0.0.10 PIP1 Configured as NSIP (management IP)
1/1 10.0.1.10 PIP2 Configured as SNIP/GSLB Site IP
1/1 10.0.1.11   Configured as LB server IP; public IP is not mandatory
1/2 10.0.2.10   Configured as SNIP for sending monitor probes to services; public IP is not mandatory

Table 2. IP addresses used in VM2 |NIC|Private IP|Public IP (PIP)|Description| |—|—|—|—| |0/1|20.0.0.10|PIP4|Configured as NSIP (management IP)| |1/1|20.0.1.10|PIP5|Configured as SNIP/GSLB Site IP| |1/1|20.0.1.11||Configured as LB server IP; public IP is not mandatory| |1/2|20.0.2.10||Configured as SNIP for sending monitor probes to services; public IP is not mandatory|

Here are sample configurations for this use case, showing the IP addresses and intial LB configurations as created through the NetScaler CLI for VM1 and VM2.

add ns ip 10.0.1.10 255.255.255.0 -mgmtAccess ENABLED
Add nsip 10.0.2.10 255.255.255.0
add service svc1 10.0.1.10 ADNS 53
add lb vserver v1 HTTP 10.0.1.11 80
add service s1 10.0.2.120 http 80
Add service s2 10.0.2.121 http 80
Bind lb vs v1 s[1-2]

add ns ip 20.0.1.10 255.255.255.0  -mgmtAccess ENABLED
Add nsip 20.0.2.10 255.255.255.0
add service svc1 20.0.1.10 ADNS 53
add lb vserver v1 HTTP 20.0.1.11 80
Add service s1 20.0.2.90 http 80
Add service s2 20.0.2.91 http 80
Bind lb vs v1 s[1-2]

2. Configure GSLB sites and other necessary GSLB settings

Perform the tasks described in the following topic to configure the two GSLB sites and other necessary settings:

Configuring Global Server Load Balancing (GSLB)

For more information, see this support article:  https://support.citrix.com/article/CTX110348

Here is a sample GSLB configuration for this use case.

enable ns feature LB  GSLB
add gslb site site1 10.0.1.10 -publicIP PIP2
add gslb site site2 20.0.1.10 -publicIP PIP5
add gslb service site1_gslb_http_svc1 10.0.1.11 HTTP 80 -publicIP PIP3 -publicPort 80 -siteName site1
add gslb service site2_gslb_http_svc1 20.0.1.11 HTTP 80 -publicIP PIP6 -publicPort 80 -siteName site2
add gslb vserver gslb_http_vip1 HTTP
bind gslb vserver gslb_http_vip1 -serviceName site2_gslb_http_svc1
bind gslb vserver gslb_http_vip1 -serviceName site1_gslb_http_svc1
bind gslb vserver gslb_http_vip1 -domainName www.gslbindia.com -TTL 5

You’ve configured GSLB on NetScaler VPX instances running on Azure. For additional information about how to configure GSLB on NetScaler VPX instances, see the Configuring Citrix NetScaler GSLB in Microsoft Azure video.