More in-depth investigation of all the logs is needed to find out what causes the provisioning to fail at some point. I suggest you contact VMware support for that.
For the time being, I used this script to check provisioning status of all enabled desktop pools and if provisioning is disabled, it writes an event to the eventlog (which is then picked up by the monitoring system). Of course, you can write your own action of what must be done when the provisioning is disabled. It uses the Horizon REST API to get the status of the pools. You can schedule this script so it runs for example every 15 minutes.
##################################
### Gets provisioning status from desktop poools
###
### Parts of this script grabbed from
### https://www.retouw.nl/2020/05/15/horizonapi-getting-started-with-the-horizon-rest-api/
###
##################################
# Horizon information
$url = "https://connectionserver.domain.local"
$username = "horizon administrator"
$password = "password"
$Domain = "domain.local"
# Eventlog information
$eventlog = "Application"
$eventsource = "Horizon"
$eventId = 3001
# Functions
function Get-HRHeader(){
param($accessToken)
return @{
'Authorization' = 'Bearer ' + $($accessToken.access_token)
'Content-Type' = "application/json"
}
}
function Open-HRConnection(){
param(
[string] $username,
[string] $password,
[string] $domain,
[string] $url
)
$Credentials = New-Object psobject -Property @{
username = $username
password = $password
domain = $domain
}
return invoke-restmethod -Method Post -uri "$url/rest/login" -ContentType "application/json" -Body ($Credentials | ConvertTo-Json)
}
function Close-HRConnection(){
param(
$accessToken,
$url
)
return Invoke-RestMethod -Method post -uri "$url/rest/logout" -ContentType "application/json" -Body ($accessToken.refresh_token | ConvertTo-Json)
}
# Main
try {
# Get API Access Token
$accessToken = Open-HRConnection -username $username -password $password -domain $Domain -url $url
# Get List of all desktop pools on local POD
$Pools = Invoke-RestMethod -Method Get -uri "$url/rest/inventory/v2/desktop-pools" -ContentType "application/json" -Headers (Get-HRHeader -accessToken $accessToken)
# Get Provisioning state of all enabled pools
foreach ($Pool in $Pools){
if ($Pool.enabled -and !$Pool.enable_provisioning) {
$msg = "Provisioning is disabled for Horizon desktop pool ""$($Pool.display_name)"" ($($Pool.name)) on $url"
write-host $msg
Write-EventLog -LogName $eventlog -Source $eventsource -EventId $eventId -EntryType Error -Message $msg -Category 0
}
}
#Log out of the API
Close-HRConnection $accessToken $url
}
catch {
$msg = "Errors occured while retrieving desktop pool status from $url. Please check if all parameters are correct."
write-host $msg
Write-EventLog -LogName $eventlog -Source $eventsource -EventId $eventId -EntryType Error -Message $msg -Category 0
}