Oct 19 2021 04:48 AM - edited Oct 24 2021 06:31 AM
Just notice that I have a new tab under my AVD Portal for Scaling Plan.
Before I just explore it, I checked Microsoft DOCs to understand the new feature and see how I can enable it, but I didn't find any relevant info even when I google it I end up with the same result... did I stop here.. Absolutely not, created a temp host pool and followed the wizard to enable and configure the new feature and here is my test result
Autoscaling is a demanded feature and has been waiting for so long, we used to automatically scale host sessions using PowerShell scripts and Azure Automation, but it was long and complicated procedures involving a lot of components, Now with AVD Scaling plans you can define ramp-up hours, peak hours, ramp-down hours, and off-peak hours for weekdays and specify autoscaling triggers. but you can only add one schedule per day and a Scaling plan must include an associated schedule for at least one day of the week.
Requirements
Click on JSON Tab
Click on Edit Tab
Past the following JSON template
{
"properties": {
"roleName": "Autoscale",
"description": "Friendly description.",
"assignableScopes": [
"/subscriptions/<SubscriptionID>"
],
"permissions": [
{
"actions": [
"Microsoft.Insights/eventtypes/values/read",
"Microsoft.Compute/virtualMachines/deallocate/action",
"Microsoft.Compute/virtualMachines/restart/action",
"Microsoft.Compute/virtualMachines/powerOff/action",
"Microsoft.Compute/virtualMachines/start/action",
"Microsoft.Compute/virtualMachines/read",
"Microsoft.DesktopVirtualization/hostpools/read",
"Microsoft.DesktopVirtualization/hostpools/write",
"Microsoft.DesktopVirtualization/hostpools/sessionhosts/read",
"Microsoft.DesktopVirtualization/hostpools/sessionhosts/write",
"Microsoft.DesktopVirtualization/hostpools/sessionhosts/usersessions/delete",
"Microsoft.DesktopVirtualization/hostpools/sessionhosts/usersessions/read", "Microsoft.DesktopVirtualization/hostpools/sessionhosts/usersessions/sendMessage/action",
"Microsoft.DesktopVirtualization/hostpools/sessionhosts/usersessions/read"
],
"notActions": [],
"dataActions": [],
"notDataActions": []
}
]
}
}
Change <SubscriptionID> with your SubscriptionID
Save the template
Click Review + Create.
Last, Click Create.
Next, Click on Select members
In the search bar, enter and select Windows Virtual Desktop, as shown in the following screenshot.
Last, Click Review + Assign.
As you can see the below step is almost the same as the previous one, so just to clarify the difference:
Usually, every application has its own peak hours where concurrent users tend to increase slowly before the start of peak time. same for AVD users start getting in slowing to the host sessions and at a specific time most of the users will start hitting the services (this is the peak hour)
Then Create..
In the next step, we have to assign the host pool that we will apply this schedule on, scaling plan can be assigned to any number of host pools.
Review and Create..
Testing And Validation
After a few minutes of creating the scaling plan..
Jump to the running AVD virtual machine and check the activity log, you should get an activity stating that the VM was started and this event initiated by WindowsVirtal Desktop App.
Oct 19 2021 02:10 PM - edited Oct 19 2021 02:16 PM
SolutionPlease verify documentation here: https://docs.microsoft.com/en-us/azure/virtual-desktop/autoscale-scaling-plan., which came with slight delay. When searching the table of contents for autoscale you will find additional articles how to use diagnostics and FAQ
Ensure your review limitations and ensure you have the custom RBAC role set-up :)!
Oct 20 2021 07:53 AM
Oct 20 2021 08:21 AM
Oct 21 2021 02:37 PM
Oct 23 2021 03:10 AM
Oct 24 2021 06:33 AM - edited Oct 24 2021 06:34 AM
Thanks, @evasse for the hint, I have updated the post with the pending configuration steps as well as testing and validation..
Oct 25 2021 06:00 AM
Great work. I do have a question regarding the Capacity treshold during ramp-up/ramp-down.
The docs state:
Is this treshold calculated based on the current capacity? So let's say I have 10VM's in total, 10 sessions per/VM, Total capacity is 100 sessions. 2 hosts are active, which means current capacity is 20. If we set capacity to 60%, will it ramp up when 60% of 20 is reached of 60% of 100. The first seems logical, but that's not what the docs are saying, since it refers to "total host pool capacity".
Oct 25 2021 08:09 AM
Oct 25 2021 08:10 AM
Oct 25 2021 08:12 AM
Oct 25 2021 11:46 AM
@evasse That makes no sense, an example:
Host pool with 10 hosts x10 sessions = 100 sessions max.
Ramp up starts @ 8AM
Ramp up capacity treshold is 60%
Hosts at start ramp up is 40%
In this case @ 8AM, 4 hosts (40%) will be active and max 40 people can login. Based on the docs and what you're saying, no more hosts will be started, because we never hit 60% (=60 sessions) of total capacity.
If I'm mistaken, please elaborate where my logic is flawed.
Oct 25 2021 03:04 PM
Oct 26 2021 06:23 AM
Oct 26 2021 08:00 AM
Oct 26 2021 06:15 PM
Oct 27 2021 01:08 AM
Oct 27 2021 08:22 AM
Oct 29 2021 03:09 AM
@evasse Is there anyway you can see logging when the schedule runs? I'd like to see the behaviour of the schedule
Oct 29 2021 10:06 AM
Oct 19 2021 02:10 PM - edited Oct 19 2021 02:16 PM
SolutionPlease verify documentation here: https://docs.microsoft.com/en-us/azure/virtual-desktop/autoscale-scaling-plan., which came with slight delay. When searching the table of contents for autoscale you will find additional articles how to use diagnostics and FAQ
Ensure your review limitations and ensure you have the custom RBAC role set-up :)!