Forum Discussion
Scaling Plan with AVD session hosts on Azure Local doesn't perform a clean shutdown
I have setup a scaling plan for my AVD sessions hosts that are running on Azure Local. The scaling plan is working as expected and the machines are taken offline during the hours specified which is reducing the service fee costs.
However, I've noticed that the Scaling Plan is simply powering off the VM, it's not telling the VM to cleanly shut down which is leading to the sessions hosts having event log entries that they weren't shut down correctly and putting them at risk of disk corruption issues. Is this intended?
2 Replies
Try this as workaround:
1. Custom Automation for Clean Shutdown
Use Azure Automation or PowerShell scripts to:
• Gracefully log off users
• Stop services
• Trigger a clean shutdown before deallocationStop-Computer -ComputerName "SessionHost01" -Force
You can schedule this to run just before the scaling plan kicks in.
2. Use Logoff + Delay Strategy
• Configure session hosts to log off disconnected users automatically
• Add a buffer time between user logoff and VM deallocation
• This gives the OS time to settle before shutdown
3. Monitor with Event Logs
Track shutdown events using:
• Event ID 6008 (unexpected shutdown)
• Event ID 1074 (planned shutdown)
This helps validate whether your workaround is working.- MattENZCopper Contributor
If the session host is shutdown prior will it still deallocate properly to not continue charging service fees? When I was talking to MS in a billing support ticket they said that it will still continue to incur fees in a shutdown state. Doing it this way also adds complexity when you want to keep a certain percentage online.
I don't really see why the scaling plan can't just cleanly shutdown the session host before deallocating?