I'm trying to put together a script that will gracefully shut down my entire virtual environment, including Horizon VDI.
I've got the server VM side taken care of (already have that scripted), but getting Horizon shut down properly is a tougher nut to crack.
I've got the following code snippets which disable the pools and put the hosts into InstantClone Maintenance mode, but I still need to shut down the VDI VMs.
# get the pool names and disable them
$pools = get-hvpoolsummary
$poolnames = $pools.DesktopSummarydata.name
foreach ($dtp in ($poolnames)) {
set-hvpool -poolname $dtp -disable -whatif
set-hvpool -poolname $dtp -stop -whatif
}
foreach ($vdihost in Get-VMHost) {
Set-Annotation -Entity $vdihost -CustomAttribute 'InstantClone.Maintenance' -Value '1'
}
Or am I just overthinking shutting the VDI sessions down?
Thanks in advance!
Chris