Share via

AVD dynamic hostpool not updating

Hans van Deursen 50 Reputation points
2026-04-22T13:10:38.79+00:00

We have set up an AVD dynamic host pool for testing.

The scaling plan properly ensures that a host is created when needed. However, the host is no longer removed after the rampdown.

We observe that the total sessions counter gets stuck.

If I log in with a user and then log out properly, the current sessions in the host pool overview are updated quickly. If I then go to Manage, Session Hosts, the total sessions on that host remain at 1.

Only when I put the host in drain mode are the actual sessions updated.

Additionally, the updating does not work properly, but that may be related to the above.

Azure Virtual Desktop
Azure Virtual Desktop

A Microsoft desktop and app virtualization service that runs on Azure. Previously known as Windows Virtual Desktop.

0 comments No comments

2 answers

Sort by: Most helpful
  1. Manish Deshpande 6,995 Reputation points Microsoft External Staff Moderator
    2026-04-22T13:51:52.0733333+00:00

    Hello Hans van Deursen,

    Your dynamic host pool (using the preview dynamic autoscaling feature) relies on the scaling plan’s ramp-down settings, capacity threshold, and minimum host percentage to deallocate or delete hosts. The most common reasons hosts are not removed are missing RBAC permissions on the Azure Virtual Desktop service principal or the presence of (disconnected) sessions that prevent consolidation below the capacity threshold. The “stuck” total sessions count in the Session Hosts blade is a known portal synchronization behavior—overview refreshes in near real-time on session changes, but the detailed Session Hosts view may lag until a status-changing action (like enabling drain mode) triggers a refresh.

    1.Verify and assign the required RBAC permissions (most frequent cause of scaling not working) The Azure Virtual Desktop service principal must have the Desktop Virtualization Power On Off Contributor role at the subscription level (not resource group or host pool).

    • In the Azure portal, go to your subscription → Access control (IAM) → Add → Add role assignment.
    • Select Desktop Virtualization Power On Off Contributor.
    • Under Members, choose User, group, or service principal and search for Microsoft Azure Virtual Desktop (or the app ID Microsoft.VirtualDesktop).
    • Assign and wait 5–10 minutes for propagation.
    • This permission is required for the scaling plan to start, stop, deallocate, or delete session hosts.

    https://learn.microsoft.com/en-us/azure/virtual-desktop/autoscale-create-assign-scaling-plan?tabs=portal%2Cintune&pivots=dynamic

    2.Review and adjust your scaling plan configuration

    • Go to Azure Virtual Desktop → Scaling plans → select your plan → Properties and Schedules.
    • In the Ramp-down phase, confirm:
      • Capacity threshold (%) is set appropriately (e.g., 20–30 % for aggressive scale-down).
      • Minimum percentage of active hosts (%) is low enough (e.g., 0 % or 10 % for testing).
      • Force logoff of users is enabled (with notification and wait time) if you want hosts removed even when sessions are present.
      • Maximum host pool size matches or exceeds your current hosts.
    • Save changes and allow the next evaluation cycle (triggered by session change events or periodic checks).
    • Tip for testing: Temporarily set Minimum percentage of active hosts to 0 % and enable force logoff to confirm scale-down works.

    https://learn.microsoft.com/en-us/azure/virtual-desktop/autoscale-faq

    3.Address the stuck total sessions counter in Session Hosts view

    • As you observed, enabling drain mode on the affected host forces the broker to refresh and update the session count (this is the expected way the portal reconciles the view).
    • Quick workaround:
      1. In Manage > Session Hosts, select the host → Drain mode → Enable.
      2. Wait for the session count to update.
      3. Disable drain mode once verified.

    For a permanent view, use PowerShell to check real-time status:

    Get-AzWvdSessionHost -HostPoolName <YourHostPool> -ResourceGroupName <RG> | Select Name, Status, Sessions
    
    
    • Refresh the portal browser or wait a few minutes after logoff events—overview updates are faster than the detailed blade.

    https://learn.microsoft.com/en-us/azure/virtual-desktop/drain-mode?tabs=portal

    4.Enable diagnostics for visibility

    After applying the RBAC fix and reviewing the ramp-down settings, test a full logon/logoff cycle during ramp-down and let us know the results.

    Thanks.

    Was this answer helpful?


  2. AI answer

    2026-04-22T13:10:59.2066667+00:00

    In a pooled Azure Virtual Desktop host pool that uses the session host configuration management approach and autoscale, autoscale decisions are based on host pool capacity and user sessions, and it also overwrites drain mode on pooled hosts.

    Key points relevant to the described behavior:

    1. Session host configuration management constraints
      • When a host pool is configured with a session host configuration, all creation, update, and scaling of session hosts must be done through the Azure Virtual Desktop service using the native features (session host configuration, session host management policy, session host update, and autoscale). External or manual management tools designed for standard host pools must not be used for creating, updating, or scaling session hosts.
      • The session host configuration persists for the lifetime of the host pool and is kept aligned with the session hosts via the session host update feature.
    2. Autoscale behavior and drain mode
      • For pooled host pools, autoscale overwrites drain mode on all VMs that are included in scaling. Any manual drain mode settings are not preserved during autoscale actions; autoscale will turn VMs on or off and change drain mode as needed according to the scaling plan.
      • If a VM must be excluded from autoscale actions (including drain mode changes), an exclusion tag must be used. Without an exclusion tag, autoscale can change drain mode and power state even if drain mode was set manually.
    3. How autoscale decides to turn off hosts
      • Autoscale uses parameters such as capacity threshold, minimum percentage of hosts, maximum session limit per host, and the current number of user sessions to determine whether it can safely turn off a session host.
      • During ramp‑down, autoscale will only turn off hosts when doing so keeps the used host pool capacity below the configured capacity threshold and still respects the minimum percentage of hosts. If turning off another host would violate either condition, autoscale will keep the host running even if it appears underutilized.
      • Autoscale chooses the host with the fewest user sessions to turn off. If the force logoff setting is enabled for ramp‑down, autoscale can put the host in drain mode, notify users, and then forcibly sign them out after the configured wait time before shutting down the VM. If force logoff is not enabled and there are still active sessions, autoscale will not force those users off outside the ramp‑down phase.
    4. Forced sign‑out limitations
      • Forced sign‑out can only occur during the ramp‑down phase when the force logoff setting is enabled in the scaling plan. During off‑peak or other phases, autoscale does not forcibly sign out users; it waits for users to sign out before deallocating the VM.
      • If the ramp‑down window is shorter than the configured wait time for forced sign‑out, users might not be forced off before the phase changes, and the VM will remain running with sessions.
    5. Impact on “total sessions” and updates
      • Because autoscale can override drain mode and only forces logoff under specific conditions, a host can remain available with sessions in certain phases, which may appear as “total sessions” not decreasing as expected.
      • If session host update is configured, updates are applied according to the session host management policy (time zone, batch size, logoff delay, logoff message, and whether to leave new hosts in drain mode). If autoscale is simultaneously managing drain mode and host availability, hosts may not enter the expected state for updates unless the scaling plan and update schedule are aligned.

    To restore expected behavior:

    • Ensure the host pool is indeed a pooled host pool using the session host configuration management approach and that all host lifecycle operations are done through Azure Virtual Desktop (not external tooling).
    • Review the scaling plan:
      • Confirm capacity threshold, minimum percentage of hosts, and maximum session limit so that autoscale can safely turn off hosts during ramp‑down.
      • Enable force logoff in the ramp‑down phase if hosts must be drained and shut down even when users remain connected.
      • Ensure the ramp‑down duration is long enough to accommodate the wait time before forced sign‑out.
    • If a particular host must not be controlled by autoscale (for example, for testing update behavior), apply an exclusion tag so autoscale does not change its drain mode or power state.
    • Align the session host update schedule with the autoscale schedule so that hosts are in the correct state (including drain mode) when updates are applied.

    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

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