Configure GSLB on Citrix ADC VPX instances
Citrix ADC 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, seeGlobal Server Load Balancing.
You can configure GSLB on a Citrix ADC VPX instances on Azure, in two steps:
- Create a VPX instance with multiple NICs and multiple IP addresses, on each site.
- Enable GSLB on the VPX instances.
Note
For more information about configuring multiple NICs and IP addresses see:Configure multiple IP addresses for a Citrix ADC VPX instance in standalone mode by using PowerShell commands
Scenario
This scenario 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.
In this scenario, 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 scenario, see theIP configuration detailssection.
Parameters
Following are sample parameters settings for this scenario 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
Create a VM
Follow steps 1-10 to create VM1 with multiple NICs and multiple IP addresses, by using PowerShell commands:
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
Create 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
Create 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
Create NIC 1/2
$ nic3Name = nicNamePrefix + suffixNumber +”或是美元nd" $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
$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 vmCon美元fig -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 osVhdUr美元i=$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
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 |
- | 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 | Internal 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 |
- | 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 scenario, showing the IP addresses and intial LB configurations as created through the Citrix ADC VPX CLI for VM1 and VM2.
Here’s an example confiruation on VM1.
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]
Here’s an example confiruation on VM2.
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]
Configure GSLB sites and other settings
Perform the tasks described in the following topic to configure the two GSLB sites and other necessary settings:
For more information, see this support article:https://support.citrix.com/article/CTX110348
Here’s an example GSLB confiruation on VM1 and VM2.
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 Citrix ADC VPX instances running on Azure.