Get the highest concurrent license usage from a VMware Horizon environment

In some managed VMware Horizon environments, I wanted to know the highest concurrent users per month. This information can be found in the Horizon Administrator Console under Settings -> Product Licensing and Usage -> Usage.

Using the VMware Horizon Administrator console is a manual task. I wanted to automate this. To automated this use VMware PowerCLI which supports access to the View API.

To automate retrieve thehighest concurrent users per month perform the following steps:

  • Setup the Horizon PowerCLI module, link
  • The following PowerCLI code display the highest concurrent license usage
Import-Module -Name VMware.VimAutomation.HorizonView
Connect-HVServer -Server <server> -Domain <domain name>

# Clear screen
Clear

# View API
$horapi = $Global:DefaultHVServers.ExtensionData

# Get the highest concurrent licensing usage
$getusage = $horapi.UsageStatistics.UsageStatistics_GetLicensingCounters()
$totalccu = $getusage.HighestUsage.TotalConcurrentConnections
Write-Output " "
Write-Output "The highest concurrent usage count is: $totalccu"

  • To reset the highest concurrent license usage use the following code
# Reset the highest license usage
$horapi.UsageStatistics.UsageStatistics_ResetHighestUsageCount()
$totalccu = $getusage.HighestUsage.TotalConcurrentConnections
Write-Output "The highest usage count is: $totalccu"

By using this code you can create a scheduled task to get the highest concurrent license usage at the end of each month and perform a reset after it for example. So you know what is the highest concurrent license usage is that is connected to the VMware Horizon environment.

Enable Adobe Flash support for the VMware Horizon Administrator console

Adobe Flash is no longer supported after December 31, 2020, and currently disabled by default.

During my consulting work, I still see organizations that use Adobe Flash-based applications such as the VMware Horizon Administrator. VMware Horizon 7.10 has an HTML5 based Horizon Console that nearly feature-complete and replaces the Adobe Flash-based Horizon Console.

For organizations, it can difficult to manage there VMware Horizon environments below version 7.10 of VMware Horizon. This can be done by enabling Adobe Flash temporarily. Caution: Enabling Adobe Flash is a security breach for your environment. So use with caution!!!

With the following steps you can enable Adobe Flash support on a Windows:

  • Download Firefox 78.6.1 ESR, link
  • Create or edit the following file: ‘C:\Windows\SysWOW64\Macromed\Flash\mms.cfg’ with the following settings:
EOLUninstallDisable=1
SilentAutoUpdateEnable=0
EnableAllowList=1
AutoUpdateDisable=1
ErrorReportingEnable=1
AllowListUrlPattern=https://fqdn-of-the-horizon-connection-server:443
  • Replace the ‘AllowListURLPattern’ with the FQDN of the VMware Horizon Connection server or load balancer URL
  • Open Firefox and enter the VMware Horizon Connection server or load balancing URL

When you are still using the VMware Horizon Administrator make sure to upgrade your VMware Horizon environment. The end of general support for Horizon 7 is March 2021. Upgrade to minimal VMware 7.13 (has general support till October of 2022) or VMware Horizon 8.x.

ControlUp 8.1 Native VMware Horizon integration

In part 2 we highlight the native support for VMware Horizon 7 and higher environments in ControlUp 8.1. The integration is based on the SOAP API. Adding a VMware Horizon environment is easy, click on the Add EUC environment and enter the name a Horizon Connection Server and click ‘OK’. ControlUp discovers Horizon components such as Connection Servers, Cloud Pod Architecture (CPA), desktop pools and sessions automatically.

Horizon Connection Servers

On the top level, you see the stress of all the Horizon Connection Servers and in the view below that each individually Horizon Connection Server is listed with there metrics.

For all the Connection Servers, the following metrics are added to the view:

  • Horizon Pods
  • Stress Level
  • Connection Servers
  • Connection Server health
  • Connection Server Max connections
  • Average machine memory
  • Machine disk IO average latency
  • Machine Disk Transfers/sec
  • Machine Net Total

Per Horizon Connection Server, the following metrics are added such as:

  • Connection server Health
  • Amount of connection Servers
  • Active connections
  • Connection Server health
  • External URL
  • Connection Server certificate valid
  • Connection Server certificate expiration date
  • License model
  • Connection Server version
  • Horizon Pod
  • Horizon Site

When installing the ControlUp agent on the Connection Servers or VDI desktop, the hypervisor and in-guest metrics are combined with the Horizon metrics.

Desktop Pools

Below the Connection Servers, the desktop pools are displayed.

Each Desktop pool in the Horizon environment is displayed with metrics such as:

  • Pool name
  • Pools type
  • Stress level
  • Pool state
  • Provisioning enabled
  • Number of machines
  • Number of machines enabled
  • Sessions
  • Disconnects
  • Problem machines
  • Default protocol
  • Power policy
  • Logoff timeout

Per Horizon pool you can view the VDI desktop and Horizon Session with metrics such as:

  • Pool name
  • Session type
  • Machine name
  • State
  • Session start time
  • Protocol
  • Desktop source
  • Client name
  • Horizon client version
  • Horizon agent version

And from the Horizon session, you can dive deeper into the processes view to troubleshoot further.

The Virtual Expert in ControlUp includes Horizon specific suggestions such as for example the available desktops remaining in a desktop pool.

As you can see, the Horizon integration adds a lot of Horizon specific metrics. All these metrics gives great insight into what happens in the Horizon environment.

Automation

ControlUp can use automation to solve Horizon issues for you. For example, it is possible the check the Horizon agent state of each VDI desktop. If the Horizon agent state goes bad (such as agent unreachable, error, unknown and already used for example) an automated action can be configured to resolve the problem. To configure automated actions, triggers are used in ControlUp.

In this example (demoed by Trentent Tyle), 3 automation triggers are created:

  • Trigger 1 operate at 10 minutes, action: Horizon Agent restart if the horizon state is wrong
  • Trigger 2 operate at 15 minutes, action: VM restart if the horizon state is wrong
  • Trigger 3 operate at 20 minutes, action: Cold Boot VM if the horizon state is wrong

Trigger 1: operate at 10 minutes

When the VDI machine boots up it has 10 minutes to register the Horizon agent state in the Horizon Connection server. A normal VDI desktop has a READY state and is available. After 10 minutes, the trigger looks if the  Horizon agent reports the wrong state such as:

  • UNKOWN
  • *ERROR
  • ALREADY USED
  • DOMAIN FAILURE
  • AGENT UNREACHABLE

If the Horizon agent state is wrong, the following action is executed: Restart the VMware Horizon Agent.

The restart VMware Horizon Agent is a PowerShell script that restarts the VMware Horizon Agent service.

It’s easy to create scripts such as PowerShell, VBS, BAT, and CMD. ControlUp itself offers a huge library of predefined/community scripts that can be used also.

Trigger 2: operate at 15 minutes

This trigger looks at the same wrong Horizon Agent states used in the 10 minutes trigger. As an action, the VDI desktop VM is restarted using a simple command.

Trigger 3: operate at 20 minutes

This trigger looks at the same wrong Horizon Agent states used in the 10 minutes trigger. As an action, a hard reboot (cold boot) is executed using a simple command on the VDI Desktop.

Because of all the Horizon metrics available, it is possible to check and repair the Horizon agent states. For IT departments, morning checks can be easily automated to ensure the VDI desktops are ready for accepting connections.

Besides the example above, there is a huge list of other Horizon items/metrics that can be used for automated actions. Here is a short overview of some:

This huge list of  Horizon metrics/items in combination with custom scripted actions that can be used makes ControlUp very powerful.

Conclusion

ControlUp 8.1 adds support for VMware Horizon integration and discovers Horizon components such as Connection Servers, Cloud Pod Architecture (CPA), pools and sessions automatically. This integration gives great insight into what happens in the Horizon environment. Using automated actions (triggers) with the Horizon metrics and scripted actions makes it a very powerful tool for automating actions and solve specific issues as displayed for example in the example above.

More information and a trail can be found here, link.