DEV Community

amalkabraham001
amalkabraham001

Posted on

AVD AutoScale for personal desktops

Microsoft had released public preview for AVD auto scaling feature for Personal desktops. This is a real game changer as many customers leverage personal or dedicated desktops and need to control the cost of the deployments.
Enabling auto scale provides the ability to admins to control cost and energy by shutting down instances which are in disconnected and logged off state. You need to ensure that you configure Idle and disconnect timers to make the auto scaling works as expected.

Let us see how can we configure auto scaling for personal desktop hostpools. As part of the auto scaling, we will be configuring Ramp up and Ramp down settings and also what to do during peak hours and off peak hours.

Pre-requisites for creating auto scaling settings

  1. You must grant Azure Virtual Desktop access to manage the power state of your session host VMs. In short, the Azure virtual desktop service principal' need to be given 'Desktop Virtualization Power On Off Contributor' permissions. During the creation phase, the below error will occur if the permissions where not given.

RBAC Permissions error
The permissions looks like below

Image description

  1. You must create the scaling plan in the same Azure region as the host pool you assign it to. You can't assign a scaling plan in one Azure region to a host pool in another Azure region.

Configuring the auto scaling settings.

To configure auto scale settings, navigate to Azure portal-->Azure virtual desktop-->Scaling plans as shown in the below picture.

Auto scaling plans
Click "+Create" and the auto scaling page will load.
In the basics settings, provide the basic details like RG, Name, Region etc.

Basic Settings
Select the time zone in which the auto scaling need to trigger.
Also select the host pool type as "Personal".
Ensure to give exclusion tags if needed. This will prevent auto scaling to applied on the specific VDIs where the tags are applied.

Basic settings Cont.

Create auto scale schedules

In the schedules tab, select "+Add schedule". The Add schedule page will popup. In the general tab, provide the Time zone to be followed for the auto scale. This should match the time zone given in the auto scale configuration to avoid issues. Provide the schedule name and in the repeat on select the number of days where the auto scaling policy will be applied.

Image description

In my example, I am creating two auto scaling policies, one for weekdays and the other for weekends. The weekend auto scaling schedule will be a more aggressive one.
Click on Next and in the Ramp up plan, select the below as per your requirement.

Image description

Image description

Image description
Click Next, In the peak hour settings, provide the start of peak hours and what to do during the peak hours of business.

Image description
Provide the ramp down settings, this allows the settings to enable the ramping down of the session hosts.

Image description

Lastly configure the off peak hour settings and click on Add.

Image description
Follow the same schedule creation steps to create the schedule for weekends.
Once done, click next. In the "host pool assignments" select the personal host pools where you need to apply this settings.You can select multiple host pools to get the auto scaling settings.

Image description

Click Next to add the tags and Click next.
Click on Create to create the auto scaling plan for personal desktops.
The key difference between Ramp up and peak hour is, let us assume that your business starts by 7 AM, so you keep your VMs ready by turning them ON for users to connect starting from 7AM and when the peak hours starts at 8AM so that the VMs are fully up and running for the staffs to connect instantaneously.
Click on review and Create to initiate the creation of the auto scaling policy.

Review and Create Page
The auto scaling policy will create successfully once the role is properly assigned.

Image description

Hope this is useful to you, please let me know if you have any questions or queries.

Top comments (0)