You can write a load balancing script to generate a load value based on any RDS host metric that you want to use for load balancing.

Your load balancing script must write the load index value to the CustomLoadValue registry key in the following location: HKLM\Sofware\VMware Inc.\VMware VDM\Performance Stats\CustomLoadValue. This value must be between 0-100.

If at least one RDS host in the farm returns a valid load value, the Connection Server assumes a load value of 25 for the other RDS hosts in farm until their load balancing scripts return valid values. If no RDS host in the farm returns a valid load value, the load balancing feature is disabled for the farm.

Note: The Horizon Console dashboard shows -1 for those RDS hosts that do not report a load index. Connection Server only uses the value of 25 for internal load balancing logic.

If your load balancing script writes an invalid load value to the CustomLoadValue registry key, the value is capped at 100 and returned as the load index to the Connection Server. If the script is unable to create the CustomLoadValue registry key, the default value of 0 is sent as the load index to the Connection Server. If the custom script does not finish running within 10 seconds, Horizon 8 terminates the script after 10 seconds and uses stale values from the CustomLoadValue registry key as the load index.

Copy your load balancing script to the Horizon Agent scripts directory (C:\Program Files\VMware\VMware View\Agent\scripts) on each RDS host in the farm. You must copy the same script to every RDS host in the farm.

For an example how to write a load balancing script, see the sample scripts in the Horizon Agent scripts directory. For more information, see Sample Load Balancing Scripts for RDS Hosts.