You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -3,8 +3,9 @@ title: Create and assign an autoscale scaling plan for Azure Virtual Desktop
3
3
description: How to create and assign an autoscale scaling plan to optimize deployment costs.
4
4
author: Heidilohr
5
5
ms.topic: how-to
6
-
ms.date: 01/16/2024
6
+
ms.date: 01/10/2024
7
7
ms.author: helohr
8
+
manager: femila
8
9
ms.custom: references_regions
9
10
---
10
11
# Create and assign an autoscale scaling plan for Azure Virtual Desktop
@@ -33,6 +34,7 @@ To use scaling plans, make sure you follow these guidelines:
33
34
> [!IMPORTANT]
34
35
> Hibernation is currently in PREVIEW.
35
36
> See the [Supplemental Terms of Use for Microsoft Azure Previews](https://azure.microsoft.com/support/legal/preview-supplemental-terms/) for legal terms that apply to Azure features that are in beta, preview, or otherwise not yet released into general availability.
37
+
- If you are using PowerShell to create and assign your scaling plan, you will need module [Az.DesktopVirtualization](https://www.powershellgallery.com/packages/Az.DesktopVirtualization/) version 4.2.0 or later.
36
38
37
39
## Assign the Desktop Virtualization Power On Off Contributor role with the Azure portal
38
40
@@ -42,7 +44,9 @@ To learn how to assign the *Desktop Virtualization Power On Off Contributor* rol
42
44
43
45
## Create a scaling plan
44
46
45
-
Now that you've assigned the *Desktop Virtualization Power On Off Contributor* role to the service principal on your subscriptions, you can create a scaling plan. To create a scaling plan:
47
+
### [Portal](#tab/portal)
48
+
49
+
Now that you've assigned the *Desktop Virtualization Power On Off Contributor* role to the service principal on your subscriptions, you can create a scaling plan. To create a scaling plan using the portal:
46
50
47
51
1. Sign in to the [Azure portal](https://portal.azure.com).
48
52
@@ -72,7 +76,7 @@ Now that you've assigned the *Desktop Virtualization Power On Off Contributor* r
72
76
73
77
1. Select **Next**, which should take you to the **Schedules** tab. Schedules let you define when autoscale turns VMs on and off throughout the day. The schedule parameters are different based on the **Host pool type** you chose for the scaling plan.
74
78
75
-
#### [Pooled host pools](#tab/pooled-autoscale)
79
+
#### Pooled host pools
76
80
77
81
In each phase of the schedule, autoscale only turns off VMs when in doing so the used host pool capacity won't exceed the capacity threshold. The default values you'll see when you try to create a schedule are the suggested values for weekdays, but you can change them as needed.
78
82
@@ -124,7 +128,7 @@ Now that you've assigned the *Desktop Virtualization Power On Off Contributor* r
124
128
- Load-balancing algorithm. We recommend choosing **depth-first** to gradually reduce the number of session hosts based on sessions on each VM.
125
129
- Just like peak hours, you can't configure the capacity threshold here. Instead, the value you entered in **Ramp-down** will carry over.
In each phase of the schedule, define whether VMs should be deallocated based on the user session state.
130
134
@@ -180,10 +184,142 @@ Now that you've assigned the *Desktop Virtualization Power On Off Contributor* r
180
184
> [!NOTE]
181
185
> If you change resource settings on other tabs after creating tags, your tags will be automatically updated.
182
186
183
-
1. Once you're done, go to the **Review + create** tab and select **Create** to deploy your host pool.
187
+
1. Once you're done, go to the **Review + create** tab and select **Create** to create and assign your scaling plan to the host pools you selected.
188
+
189
+
### [PowerShell](#tab/powershell)
190
+
191
+
Here's how to create a scaling plan using the Az.DesktopVirtualization PowerShell module. The following examples show you how to create a scaling plan and scaling plan schedule.
192
+
193
+
> [!IMPORTANT]
194
+
> In the following examples, you'll need to change the `<placeholder>` values for your own.
2. Create a scaling plan for your pooled or personal host pool(s) using the [New-AzWvdScalingPlan](/powershell/module/az.desktopvirtualization/new-azwvdscalingplan) cmdlet:
199
+
200
+
```azurepowershell
201
+
$scalingPlanParams = @{
202
+
ResourceGroupName = '<resourceGroup>'
203
+
Name = '<scalingPlanName>'
204
+
Location = '<AzureRegion>'
205
+
Description = '<Scaling plan description>'
206
+
FriendlyName = '<Scaling plan friendly name>'
207
+
HostPoolType = '<Pooled or personal>'
208
+
TimeZone = '<Time zone, such as Pacific Standard Time>'
* For pooled host pools, use the [New-AzWvdScalingPlanPooledSchedule](/powershell/module/az.desktopvirtualization/new-azwvdscalingplanpooledschedule) cmdlet. This example creates a pooled scaling plan that runs on Monday through Friday, ramps up at 6:30 AM, starts peak hours at 8:30 AM, ramps down at 4:00 PM, and starts off-peak hours at 10:45 PM.
* For personal host pools, use the [New-AzWvdScalingPlanPersonalSchedule](/powershell/module/az.desktopvirtualization/new-azwvdscalingplanpersonalschedule) cmdlet. The following example creates a personal scaling plan that runs on Monday, Tuesday, and Wednesday, ramps up at 6:00 AM, starts peak hours at 8:15 AM, ramps down at 4:30 PM, and starts off-peak hours at 6:45 PM.
> We recommended that `RampUpStartVMOnConnect` is enabled for the ramp up phase of the schedule if you opt out of having autoscale start session host VMs. For more information, see [Start VM on Connect](start-virtual-machine-connect.md).
300
+
301
+
4. Use [Get-AzWvdScalingPlan](/powershell/module/az.desktopvirtualization/get-azwvdscalingplan) to get the host pool(s) that your scaling plan is assigned to.
You have now created a new scaling plan, 1 or more schedules, assigned it to your pooled or personal host pool(s), and enabled autoscale.
314
+
315
+
316
+
317
+
---
184
318
185
319
## Edit an existing scaling plan
186
320
321
+
### [Portal](#tab/portal)
322
+
187
323
To edit an existing scaling plan:
188
324
189
325
1. Sign in to the [Azure portal](https://portal.azure.com).
@@ -198,45 +334,104 @@ To edit an existing scaling plan:
198
334
199
335
1. To edit the plan's friendly name, description, time zone, or exclusion tags, go to the **Properties** tab.
200
336
337
+
### [PowerShell](#tab/powershell)
338
+
339
+
Here's how to update a scaling plan using the Az.DesktopVirtualization PowerShell module. The following examples show you how to update a scaling plan and scaling plan schedule.
340
+
341
+
* Update a scaling plan using [Update-AzWvdScalingPlan](/powershell/module/az.desktopvirtualization/update-azwvdscalingplan). This example updates the scaling plan's timezone.
342
+
343
+
```azurepowershell
344
+
$scalingPlanParams = @{
345
+
ResourceGroupName = 'resourceGroup'
346
+
Name = 'scalingPlanPersonal'
347
+
Timezone = 'Eastern Standard Time'
348
+
}
349
+
350
+
Update-AzWvdScalingPlan @scalingPlanParams
351
+
```
352
+
353
+
* Update a scaling plan schedule using [Update-AzWvdScalingPlanPersonalSchedule](/powershell/module/az.desktopvirtualization/update-azwvdscalingplanpersonalschedule). This example updates the ramp up start time.
You can assign a scaling plan to any existing host pools in your deployment. When you assign a scaling plan to your host pool, the plan will apply to all session hosts within that host pool. The scaling plan also automatically applies to any new session hosts you create in the assigned host pool.
372
+
You can assign a scaling plan to any existing host pools of the same type in your deployment. When you assign a scaling plan to your host pool, the plan will apply to all session hosts within that host pool. The scaling plan also automatically applies to any new session hosts you create in the assigned host pool.
204
373
205
374
If you disable a scaling plan, all assigned resources will remain in the state they were in at the time you disabled it.
206
375
207
-
### Assign a scaling plan to a single existing host pool
208
-
To assign a scaling plan to an existing host pool:
376
+
### [Portal](#tab/portal)
377
+
378
+
To assign a scaling plan to existing host pools:
209
379
210
380
1. Open the [Azure portal](https://portal.azure.com).
211
381
212
382
1. In the search bar, type *Azure Virtual Desktop* and select the matching service entry.
213
383
214
-
1. Select **Host pools**, and select the host pool you want to assign the scaling plan to.
384
+
1. Select **Scaling plans**, and select the scaling plan you want to assign to host pools.
215
385
216
-
1. Under the **Settings** heading, select **Scaling plan**, and then select **+ Assign**. Select the scaling plan you want to assign and select **Assign**. The scaling plan must be in the same Azure region as the host pool and the scaling plan's host pool type must match the type of host pool that you're trying to assign it to.
386
+
1. Under the **Manage** heading, select **Host pool assignments**, and then select **+ Assign**. Select the host pools you want to assign the scaling plan to and select **Assign**. The host pools must be in the same Azure region as the scaling plan and the scaling plan's host pool type must match the type of host pools you're trying to assign it to.
217
387
218
388
> [!TIP]
219
389
> If you've enabled the scaling plan during deployment, then you'll also have the option to disable the plan for the selected host pool in the **Scaling plan** menu by unselecting the **Enable autoscale** checkbox, as shown in the following screenshot.
220
390
>
221
391
> [!div class="mx-imgBorder"]
222
392
> 
223
393
224
-
### Assign a scaling plan to multiple existing host pools
394
+
### [PowerShell](#tab/powershell)
225
395
226
-
To assign a scaling plan to multiple existing host pools at the same time:
396
+
1. Assign a scaling plan to existing host pools using [Update-AzWvdScalingPlan](/powershell/module/az.desktopvirtualization/update-azwvdscalingplan). The following example assigns a personal scaling plan to two existing personal host pools.
227
397
228
-
1. Open the [Azure portal](https://portal.azure.com).
1. In the search bar, type *Azure Virtual Desktop* and select the matching service entry.
417
+
2. Use [Get-AzWvdScalingPlan](/powershell/module/az.desktopvirtualization/get-azwvdscalingplan) to get the host pool(s) that your scaling plan is assigned to.
231
418
232
-
1. Select **Scaling plans**, and select the scaling plan you want to assign to host pools.
1. Under the **Manage** heading, select **Host pool assignments**, and then select **+ Assign**. Select the host pools you want to assign the scaling plan to and select **Assign**. The host pools must be in the same Azure region as the scaling plan and the scaling plan's host pool type must match the type of host pools you're trying to assign it to.
235
430
236
431
## Next steps
237
432
238
433
Now that you've created your scaling plan, here are some things you can do:
239
434
240
435
- [Enable diagnostics for your scaling plan](autoscale-diagnostics.md)
241
436
242
-
If you'd like to learn more about terms used in this article, check out our [autoscale glossary](autoscale-glossary.md). For examples of how autoscale works, see [Autoscale example scenarios](autoscale-scenarios.md). You can also look at our [Autoscale FAQ](autoscale-faq.yml) if you have other questions.
437
+
If you'd like to learn more about terms used in this article, check out our [autoscale glossary](autoscale-glossary.md). For examples of how autoscale works, see [Autoscale example scenarios](autoscale-scenarios.md). You can also look at our [Autoscale FAQ](autoscale-faq.yml) if you have other questions.
0 commit comments