AVD Scaling Plan doesn't turn off a VM

Benedikt Pittl 80 Reputation points
2024-06-19T19:34:09.5166667+00:00

I have a host pool with a single VM. I want to use a scaling plan to turn that VM off/on at a specific time. I use the following settings:

User's image

User's image

Expected behaviour:

At 07:26PM users get a notification and after 1 minute the VM is turned off.

Observed behaviour:

VM remains running, drain mode remains on off

Why is the VM not stopping?

Azure Virtual Desktop
Azure Virtual Desktop
A Microsoft desktop and app virtualization service that runs on Azure. Previously known as Windows Virtual Desktop.
1,431 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Silvia Wibowo 3,411 Reputation points Microsoft Employee
    2024-06-20T04:42:25.9133333+00:00

    Hi @Benedikt Pittl , I understand that you have issues with AVD Autoscaling.

    Please review AVD Autscaling FAQ, which mentions:

    • [General] How many VMs need to be in a host pool for autoscale to work properly?
      • At least one.
    • [Autoscale for pooled host pools] How do I configure autoscale so I run zero session hosts after working hours?
      • Ramp-down mode always uses the lowest possible number of session hosts. However, if there are existing user sessions, the lowest number of usable session hosts won't be zero. To configure the time limit policy to sign out all disconnected users to avoid having usable session hosts after hours, go to Local Computer Policy > Computer Configuration > Administrative Templates > Windows Components > Remote Desktop Services > Remote Desktop Session Host > Session Time Limits > Set time limit for disconnected sessions.
    • [Autoscale for pooled host pools] If I configure autoscale to force users to sign out during ramp-down, will it also sign out users with active sessions?
      • Yes. Idle, disconnected, and active sessions are forced to sign out if the users don't sign out during the ramp-down phase wait time.
    • [Autoscale for pooled host pools] Can forced sign out happen in any phase of the day?
      • No. If you've enabled autoscale, you can only force users to sign out during the ramp-down phase. If you put a session host in drain mode during ramp-down to prepare it to be shut down but not all users sign out before the phase changes to off-peak, the remaining user sessions won't be forced to sign out from their session. The reason users aren't signed out is because autoscale doesn't force users to sign out of their sessions during off-peak hours. Instead, autoscale waits until all users have signed out before deallocating the VM. For example, if the ramp-down phase is 15 minutes long, and the wait time before signing out users and shutting down VMs is 20 minutes long, the schedule shifts to the off-peak phase and the user sessions won't be forced to sign out.
    • Can autoscale turn off all the VMs in a host pool, or does it need to keep at least a few VMs on to work properly?
      • Autoscale can turn off all VMs in a host pool if the minimum percentage of hosts is set to 0% and there are no user sessions on the session hosts in the host pool.

    What I think is causing issue: you configured ramp-down on 7:26PM and 1-minute delay before users are forced to log off, but your Off-peak hours starts at 7:27PM. So, AVD will change to Off-peak before it has the chance to force users to log off during ramp-down.

    My suggestion: modify your Off-peak start time to 7:28PM or later to give the chance for ramp-down to force users to log off. If there's no user session in the session host of your host pool, autoscale will turn off all VMs.

    Please accept an answer if correct. Original posters help the community find answers faster by identifying the correct answer. Here is how.


  2. vipullag-MSFT 25,616 Reputation points
    2024-06-21T04:11:13.6066667+00:00

    Hello Benedikt Pittl

    Welcome to Microsoft Q&A Platform, thanks for posting your query here.

    Few things you need to check is:

    -Whether you’ve enabled autoscale to force users to sign out during ramp-down or not, the capacity threshold and the minimum percentage of hosts are still respected, autoscale will only shut down VMs if all existing user sessions (active and disconnected) in the host pool can be consolidated to fewer VMs without exceeding the capacity threshold. In your test scenario, if there is still active or disconnected session, then that signal VM can't be deallocated as the existing user session can't be consolidated to fewer VMs. Create and assign an autoscale scaling plan for Azure Virtual Desktop | Microsoft Learn

    -You can configure a time limit policy that will apply to all phases to sign out all disconnected users to reduce the used host pool capacity. For more information, see Configure a time limit policy using Microsoft Intune.

    -Force logoff only works in the rampdown phase, with your current configuration, at 07:27 PM, it already enters into the off-peak hours where force logoff will not happen.

    Note: Your policy is defined based on UTC,  just make sure you are also testing in the right time zone.

    Hope this helps.

    0 comments No comments