Forum Discussion

RomeroSilva's avatar
RomeroSilva
Copper Contributor
May 06, 2021

WVD Scaling Script: Doesn't Logoff user sessions and stop VMs during off-peak hours

Hi,

 

We have experienced that during the off-peak hours the scaling script doesn't logoff user sessions and stop VMs when there are active or disconnected sessions. 

 

Minimum number of running session host threshold is set to 1

 

Findings:

  • Script recognize it as off-peak hours but doesn't logoff any user sessions. 

But we have noticed following log not sure if there is any relation.

Number of user sessions is more than 90 % of the max number of sessions allowed with minimum number of running session hosts required (10). Adjusted minimum number of running session hosts required to 2

 

Any advice or a solution for this ?

 

Thank You!

 

BR,

Romero Silva

 

2 Replies

  • JereVirta's avatar
    JereVirta
    Copper Contributor
    Hi,

    Which scaling solutions are you using? Is the one provided at Microsoft Docs -site?
    https://docs.microsoft.com/en-us/azure/virtual-desktop/set-up-scaling-script

    Have you set parameter LimitSecondsToForceLogOffUser. Think it defaults to zero, but I'm not sure as I have not used this solution in ages. When set to zero, any user logged in will be left untouched.

    You could control session limit also with Group Policy at Computer Configuration > Policies > Administrative Templates > Windows Components > Remote Desktop Services > Remote Desktop Session Host > Session Time Limits

    I use scaling solution by Travis Roberts found at https://www.ciraltos.com/update-with-breadth-first-auto-scale-session-hosts-in-windows-virtual-desktop-spring-update-arm-with-azure-function/

    - Jere






    • StevenR's avatar
      StevenR
      Copper Contributor
      Use gpo to log inactive sessions off and people who haven’t had any activity for a certain amount of time. Works fine

Resources