VMware Horizon View – Using ZEN Loadbalancer to loadbalance Connection Server Traffic

General

Zen loadbalancer (ZLB) is as simple and easy to use open source loadbalancer. It can be used to loadbalance a variety for solutions, but here I describe how to configure it to load balance VMware Horizon View connection servers.

The Zen Loadbalancer can also be configred in an HA pair as described here, but I am limiting this article to a single load-balancer appliance.

Software Links and Versions

Server Names and IP addresses

  • Load balancer:
    • Name: ZLB01
    • IP: 10.10.1.10
  • Horizon View load balancing address:
    • URL: view.yourcompany.com
    • IP: 10.10.1.100
  • Horizon View Connection servers:
    • HVCS01: 10.10.1.101
    • HVCS02: 10.10.2.102

Step-by-Step installation guide

Follow the below instructions to install the Zen Load Balancer 3.0.5

  • Create a DNS record for ZLB01 pointing to 10.10.1.10
  • Create a new zone “view.yourcompany.com” and add an A-Host record pointing to 10.10.1.100
  • Download the ZEN Load Balancer ISO image from the download link mentioned above
  • Upload the downloaded iso image to one of the available vSphere datastores
  • Create a new virtual machine

    • Configuration: Custom
    • Name:
      • ZLB01
    • Virtual Machine Version: 8
    • Guest Operating System: Linux – Debian GNU/Linux 6 (32 bit)
    • 1 vCPU
    • 1 GB RAM
    • NIC:
      • Type: E1000
      • Connect at Power on: YES
    • SCSI Controller: LSI logic Parallel
    • 10 GB HDD (thick provisioned eager zero)
    • Connect the zen load balancer iso image to the virtual machine
  • Power on the virtual machine
  • Open a Console to the virtual machine
  • Installer Boot Menu: choose “Install” and press Enter
  • Select a language: choose “English” and press Enter
  • Select your location:  choose “other” – “Europe” – “Luxembourg” and press Enter
  • Configure locales: choose “United States” and press Enter
  • Select a keyboard layout: Choose “American English” and press Enter
  • Configure he Network:
    • IP address:
      • 10.10.1.10
    • Netmask:
      • 255.255.255.0
    • Gateway:
      • 10.10.1.1
    • Name server addresses
      • 10.10.1.2 10.10.1.3 (separated by spaces)
    • Hostname:
      • ZLB01
    • Domain name:
      • yourcompany.local
  • Set up users and passwords:
    • root password: xxx
    • Re-enter root password: xxx
  • Time zone
    • Select appropriate timezone
  • Partitioning disks
    • Partitioning method: choose “Guided – use entire disk” and press Enter
    • Select disk to partition: choose the default selection and press Enter
    • Partitioning scheme: choose “All files in one partition” and press Enter
    • Overview: choose “Finish partitioning and write changes to disk” and press Enter
    • Write changes to disk: choose “Yes” and press Enter
  • Wait until the installation process completes
  • Un-mount the ISO from the virtual machine (Set back to “client device”)
  • Finish the installation: choose “Continue” and press Enter

Step-by Step configuration guide

Install VMware Tools

  • Mount the VMware iso tools to the virtual machine and open a console to the virtual machine
    • in the vSphere Client select the virtual machine
    • Right click the virtual machine
    • Select “Guest” – “Install/Upgrade VMware Tools”
  • Log in as “root” with the password you supplied during the installation process
  • Type the following commands
    • mkdir -p /mnt/cdrom
    • mount /dev/cdrom /mnt/cdrom
    • cd /mnt/cdrom
    • cp VM*.tar.gz /tmp
    • cd /tmp
    • tar xzvf /tmp/VM*.tar.gz
    • cd vmware-tools-distrib/
    • ./vmware-install.pl -d
    • rm -r -f /tmp/vmware*
    • reboot

Install and configure NTP

  • Open a Console to the virtual machine
  • Log in as “root” with the password you supplied during the installation process
  • Type the following commands
    • apt-get install ntp
    • Edit the file /etc/ntp.conf
      • comment out the default NTP servers and add your own ntp servers
        • 10.10.1.2
        • 10.10.1.3

Note: If your firewall does not allow the “apt-get install ntp” command, the NTP addresses can be set via the ZEN load balancer GUI:

  • Open a browser and go to https://ZLB01:444
  • Log in with username “admin” and password “admin”
  • Go to “Settings” – “Server” – “Global Information” – “ntp server”
  • Change the ntp server address to 10.11.1.2
  • Click on “Modify”

Change default administrator password

  • Open a browser and go to https://ZLB01:444
  • Log in with username “admin” and password “admin”
  • Change password
    • Go to “Settings” – “Change password”
    • Current password: admin
    • New password: yyy (Standard Password)
    • Verify password: yyy (Standard Password)
    • Select “Change”

Add SSL Certificate

  • Open a browser and go to https://ZLB01:444
  • Log in with username “admin” and password yyy
  • Add SSL cerificate
    • Go to “Manage” – “Certificates”
    • Click on green up-arrow in the actions column to “upload .pem certificate”
    • Browse to your certificate in .pem format
    • Select “Upload”

Create Virtual Interface

  • Open a browser and go to https://ZLB01:444
  • Log in with username “admin” and password yyy
  • Add Interface
    • Go to “Settings” – “Interfaces”
    • Click on the “add virtual network interface” button
      • Name: eth0:1
      • Addr: 10.10.1.100
      • Netmask: 255.255.255.0
    • Click on “save virtual interface” button

Create load balanced farms

  • Open a browser and go to https://ZLB01:444
  • Log in with username “admin” and password yyy
  • Add Farms
    • Go to “Manage” – “Farms”
    • Create a new Farm for http connections over port 443
      • Farm Description Name: “HorizonViewLB443” (or any other descriptive name of your choice)
      • Profile: TCP
      • Click “Save & continue”
      • Virtual IP:
        • select eth0:1-><10.10.1.100>
      • Virtual Port: 443
      • Click “Save”

Configure load balanced farms

  • Open a browser and go to https://ZLB01:444
  • Log in with username “admin” and password yyy
  • Configure Farms
    • Go to “Manage” – “Farms”
    • Configure Farm “HorizonViewLB443”
      • Click on button “Edit the HorizonViewLB443 farm”
      • Edit HorizonViewLB443 Farm global parameters (Every change in the GUI needs to be confirmed by clicking on the “Modify” button)
        • Farm’s name: HorizonViewLB443
        • Load Balance Algorithm: Hash: sticky client
        • Enable client IP address persistence through memory: YES
        • Max number of clients memorized in the farm: 2049
        • Client-time: 0 seconds
        • Back-end response timeout secs: 10
        • Max number of simultaneous connections that managed in Virtual IP: 257
        • Max number of real ip servers: 10
        • Add X-forwarded-For header to http requests: NO
        • Frequency to check resurrected backend secs: 30
        • Use FarmGuardian to check Backend Servers: YES
          • Check every 20 secs
          • Command to check: check_http -w 10 -c 10 -S -H view.yourcompany.com -s ‘You can connect to your desktop and applications’
          • Enable farm guardian logs: NO
        • Farm Virtual IP:
          • 10.10.1.100
        • Farm virtual port: 443
      • Edit real IP servers configuration
        • Click button “Add real server”
          • Address:
            • 10.11.1.101 (this is the IP address of the VMware Horizon View Connection server HVCS01)
          • Port: 443
          • Max Connections: 0
          • Weight: 0
          • Priority: 0
          • Click button “Save Real Server”
        • Click button “Add real server”
          • Address:
            • 10.10.1.102 (this is the IP address of the VMware Horizon View Connection server HVCS02)
          • Port: 443
          • Max Connections: 0
          • Weight: 0
          • Priority: 0
          • Click button “Save Real Server”

Farm Guardian Checks

Farm Guardian uses plugins as health checks for checking the backend status. The next three plugins are included by default and are located in the directory /usr.local.zenloadbalancer/app/libexec/:

Backup Zen Load Balancer Configuration

The Zen Load Balancer configuration can be easily backed up through the Zen Load balancer GUI. It is good practice to backup the configuration each time a change has been made to the load balancing configuration.

To backup the configuration of the Zen Load Balancer follow the below steps:

  • Open a browser and go to https://ZLB01:444
  • Log in with username “admin” and password yyy
  • Backup Configuration
    • Go to “Settings” – “Backup”
    • Description Name: ZLB01
    • Click “Create Backup”
    • Save the created backup file “backup-zlb01.tar.gz” to a safe location on your network

Leave a Reply

Your email address will not be published. Required fields are marked *

*