Error: VMs are stuck in Unavailable or Upgrading state
Open a PowerShell window as an administrator and run the following cmdlet:
Get-AzWvdSessionHost -ResourceGroupName <resourcegroupname> -HostPoolName <hostpoolname> | Select-Object *
If the status listed for the session host or hosts in your host pool always says "Unavailable" or "Upgrading," the agent or stack didn't install successfully.
To resolve this issue, reinstall the side-by-side stack:
- Open a command prompt as an administrator.
- Enter net stop RDAgentBootLoader.
- Go to Control Panel > Programs > Programs and Features.
- Uninstall the latest version of the Remote Desktop Services SxS Network Stack or the version listed in HKEY_LOCAL_MACHINE > SYSTEM > CurrentControlSet > Control > Terminal Server > WinStations under ReverseConnectListener.
- Open a console window as an administrator and go to Program Files > Microsoft RDInfra.
- Select the SxSStack component or run the msiexec /i SxsStack-.msi command to install the MSI.
- Restart your VM.
- Go back to the command prompt and run the qwinsta command.
- Verify that the stack component installed in step 6 says Listen next to it.
-If so, enter net start RDAgentBootLoader in the command prompt and restart your VM.
-If not, you will need to re-register your VM and reinstall the agent component.