11-12-2020 06:09 AM
11-12-2020 06:09 AM
Why do Session Host VM's show the status of "Shutdown" when they are powered off instead of "Unavailable"?
I have been successfully utilizing an auto-scaling script that powers on/off VM's based on user demand. Until recently, all my VM's in my host pools show as status "Unavailable" when they are powered off and the scaling script looks for this and starts them when needed.
I have just added some additional VM's to my existing VM's in two of my Host Pools and now when I shut these VM's down, they show a status of "Shutdown" and so the scaling script cannot start them.
I have tried manually removing the new VM’s from the Host Pool and re-installing the Agent & BootLoader, but still no joy.
The status of “Shutdown” kind of makes more sense than “Unavailable”, so I wondered if there has been a change in the way the VM’s agent reports it’s status to WVD? If so, this would break the scaling script and it would need updating to suit, but I don’t see that this can be the case, as my original VM’s in the Host Pool are running the same latest agent version and show a status of “Unavailable” when they are powered off.
So - what is this "Shutdown" status all about and how do I get these new VM's to show as "Unavailable" when they are powered off so that my scaling script will work again?
Have you or anyone else seen this, or have any advice?
11-12-2020 06:25 PM
I've also noticed something similar in the last week when I added a vm to an existing hostpool, the new vm has a shutdown state not the regular unavailable state when its deallocated by the scaling script.
However I added yet another vm and that shows the regular unavailable status when the vm gets deallocated by the scaling script. Not really sure why
In my case the scaling script can power on and power off the all the vms.
I am curious what the difference is between the 'Shutdown' status and 'Unavailable' status as there is no detail on the docs page https://docs.microsoft.com/en-us/rest/api/desktopvirtualization/sessionhosts/get#status.
11-13-2020 12:07 AM
Hi @Hussayn Visram thanks for confirmation that others are seeing this.
I am using the (popular & useful) Travis Roberts scaling script (https://www.ciraltos.com/auto-start-and-stop-session-hosts-in-windows-virtual-desktop-spring-update-...) which checks for hosts in the "Unavailable" state to start, so the new hosts being in "Shutdown" state breaks the script.
I could probably modify the script, but I wanted to understand what this (new?) "Shutdown" state was all about first as my old hosts are all still showing state "Unavailable" even when running the same latest agent version as the newly added VM's.
11-13-2020 10:20 AM
Hi @garymansell, the scaling script I used was the one they have in the wvd docs
The logic is a bit differnet from the one you mentioned, both are really good.
It takes a bit of time to setup (or via ps script which I ended up doing as part of my wvd deploymet) but worth it to realise the cost savings.
This overview video really helped to understand whats going on
Additionally, I built a new environment today with 7 vm as personal desktops, all the vms show Shutdown state when they are deallocated.
11-15-2020 11:17 AMSolution
@garymansell I modified the script to include the status of "Unavailable" and "Shutdown" to include VM's in the start function. Testing shows it's now starting VM's in either state.
11-16-2020 01:42 AM
@Travis RobertsThis is excellent news - thanks for your speedy resolution. I made the same change myself last week and confirm that it works.
If anyone from the WVD Product Team is on here, though, it would be nice to understand why the change in Status for powered off machines? Is this a permanent change, will we no longer see VM's as "Unavailable"? If both states are still possible - what exactly do they mean>
Might be nice to add some descriptions to the online doc's too...