I am excited to announce a significant update to the Auto Start and Stop script for WVD. This update adds a new option that works with the peak time settings to change the load balancing type from Depth-First to Breadth-First. When used, it also starts all available session hosts during peak time to accommodate the user load.
At the end of peak time, the host pool goes back to Depth-First load balancing, and session hosts shut down as users log off. Providing a cost savings auto scale solution during times of low demand.
The new feature is optional. If not enabled, the script will work just as it did before, starting and stopping session hosts based on the user load and the server start threshold. The new Use Breadth-First During Peak option provides capacity for the greatest number of users while leveraging Dept-First during the off-peak time to consolidate user connections and shut down unused Session Hosts.
For full details on the script’s functionality and deployment overview, see the previous video on the Auto Start and Stop script located here: https://www.ciraltos.com/auto-start-and-stop-session-hosts-in-windows-virtual-desktop-spring-update-arm-edition-with-an-azure-function/
The Script can be found at my GitHub page here: https://github.com/tsrob50/WVD-Public/blob/master/WVDARM_ScaleHostPoolVMs.ps1
The $usePeak variable must be set to true to enable the new functionality. The new $useBreadthFirstDuringPeak must also be set to true to enable Breadth-First load balancing during peak time.
To use peak time without changing to Breadth-First load balancing, simply set $usePeak to True and $useBreadthFirstDuringPeak set to $false