Azure AVD scaling plans do not automatically shut down AVDs

Anonymous
2023-09-11T04:57:58.8366667+00:00

I'm facing an issue when creating a scaling plan for my host pool.

I have 2 AVDs and am testing with 2 - 3 users at a time. The max session limit is 2 per session host.

The first AVD gets the 2 users and the second AVD gets the 3rd and final one. I have set a GPO that when the user is disconnected it should log them off. When I close all the remote apps as the 3rd user and disconnect the session count for the second AVD goes to 0. Now what I expect to happen here is for that AVD to be deallocated while the first AVD will continue to run as there are still 2 users connected to it.

What I actually observe is that the AVDs only scale down once the total number of sessions is 0 across all AVDs. That means, it only deallocates the AVDs once all users are logged out from both session host 1 and session host 2. However, in the description for VMs have no active sessions it states that it deallocates the virtual machine "if there are no active user sessions on any of the session hosts in the host pool".

Am I misunderstanding what is supposed to happen here?

Thanks for reading.

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
9,041 questions
Azure Virtual Desktop
Azure Virtual Desktop
A Microsoft desktop and app virtualization service that runs on Azure. Previously known as Windows Virtual Desktop.
1,842 questions
{count} vote

2 answers

Sort by: Most helpful
  1. deherman-MSFT 38,021 Reputation points Microsoft Employee Moderator
    2023-09-13T16:18:40.4733333+00:00

    @Anonymous

    It seems that you expect the AVD with no active sessions to be deallocated while the other AVD with active sessions continues to run. Autoscale will only turn off session hosts when all of the following conditions are met:

    1. The used host pool capacity is below the capacity threshold.
    2. Autoscale can turn off session hosts without exceeding the capacity threshold.
    3. Autoscale only turns off session hosts with no user sessions on them (unless the scaling plan is in the ramp-down phase and you've enabled the force logoff setting)

    In your case, it appears that the AVDs are only scaling down when the total number of sessions is 0 across all AVDs. This behavior might be due to the capacity threshold or other autoscale settings. You may need to review your autoscale settings and adjust them to better fit your desired behavior.

    Please review Autoscale scaling plans and example scenarios in Azure Virtual Desktop as this will be helpful in getting your settings configured properly. If you are still having issues please share with me your settings so I can investigate further.


    If you still have questions, please let us know in the "comments" and we would be happy to help you. Comment is the fastest way of notifying the experts.

    If the answer has been helpful, we appreciate hearing from you and would love to help others who may have the same question. Accepting answers helps increase visibility of this question for other members of the Microsoft Q&A community.

    Thank you for helping to improve Microsoft Q&A!

    User's image

    0 comments No comments

  2. Marcin Zarodkiewicz 5 Reputation points
    2023-11-22T16:58:08.87+00:00

    I have a similar problem.

    My ramp down puts VMs that are supposed to be shut down into drain mode. I have force log off disabled, and Stop VMs when no active and disconnected sessions present enabled.

    The hosts are hanging there with no active sessions, no disconnected sessions in drain mode, and don't get powered off.

    Capacity threshold on the ramp down is set very high, 90%, to allow shut down of hosts asap.

    But I tried lower settings and still nothing.

    No idea what's going on.

    When we used automation account with a PowerShell runbook this was working fine.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.