- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We are running with Horizon view 7.13. Using linked clones. We are experiencing issues where a pool will be set to Provisioning Disabled. Error points to composer server. Most times we can reboot the composer server and set the provisioning to enabled and it kicks back off. IF we try to enable it without rebooting the compsoer (usually), it will disable again. This can affect one pool or several pools (depending on impact). What could be causing this? Is there any way to monitor the pools to get notification if the provisioning gets disabled? Right now, if I happen to be in the Horizon admin console I may catch it, or when users start to complain because the pool is empty / not replenish(set to refresh when log out).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
}
Regards,
Mickeybyte (ITPro blog)
If you found this comment useful or an answer to your question, please mark as 'Solved' and/or click the 'Kudos' button, please ask follow-up questions if you have any.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Mickeybyte Thanks. Yeah, Sev1 ticket in place and waiting callback. This is exactly what I am looking for. Thanks.