Hostpool SessionHosts not being kept up to date when rebuilding VMs or reducing rdsh_count
- Dominant language
- PowerShell
- Stars
- 524
- Forks
- 610
- PR merge metrics
- No merged PRs in 30d
Description
I've used this to create an AVD environment with 2 VM's.
Everything works fine with a little effort.
Now say I want to keep the VM's up to date using Terraform, so I go into my variables and change the Windows 10 image version from 20h2 to 21h1:
Terraform wants to do the following:
Remove AD Join Extension, AVD extension, VM and NIC
Create NIC, VM, and both Extensions
This is what I expect to happen too, and Terraform does all of these steps successfully.
But when I then check the hostpool sessionhosts I still have the ghost of the old VM there.
The hostpool now has duplicate entries, and none of them work.
If I understand correctly, terraform doesn't manage the hostpool session hosts entries at all. This is all done by the PowerShell DSC Extension for AVD.
Removing this extension in itself doesn't remove the sessionhost from the hostpool configuration though.
Another way to produce ghost entries in the hostpool is by simply reducing the rdsh_count. You'll see the VM, NIC and both extensions are successfully removed.
But check the hostpool afterwards and you still have the sessionhost there.
Any ideas on how to go about getting this in sync?
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the ARM templates, Terraform variables, and PowerShell DSC extension involved in creating or removing the VM, NIC, and AVD extensions. Trace how replacement and rdsh_count reduction affect hostpool session-host registration, then verify that removed or rebuilt VMs leave no ghost entries and remaining hosts work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, powershell, terraform
- Domain
- cloud, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100