Skip to content

Commit 687e55e

Browse files
committed
updates
1 parent deb9ff3 commit 687e55e

File tree

2 files changed

+30
-89
lines changed

2 files changed

+30
-89
lines changed

articles/virtual-desktop/autoscale-create-assign-scaling-plan.md

Lines changed: 8 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,15 @@ To use a dynamic scaling plan, make sure you follow these guidelines:
6565
::: zone pivot="power-management"
6666
## Assign the Desktop Virtualization Power On Off Contributor role with the Azure portal
6767

68-
Before creating your first scaling plan, you'll need to assign the *Desktop Virtualization Power On Off Contributor* RBAC role to the Azure Virtual Desktop service principal with your Azure subscription as the assignable scope. Assigning this role at any level lower than your subscription, such as the resource group, host pool, or VM, will prevent autoscale from working properly. You'll need to add each Azure subscription as an assignable scope that contains host pools and session host VMs you want to use with autoscale. This role and assignment will allow Azure Virtual Desktop to manage the power state of any VMs in those subscriptions. It will also let the service apply actions on both host pools and VMs when there are no active user sessions.
68+
Before creating your first scaling plan, you'll need to assign the *Desktop Virtualization Power On Off Contributor* RBAC role to the Azure Virtual Desktop service principal with your Azure subscription as the assignable scope. Assigning this role at any level lower than your subscription, such as the resource group, host pool, or VM, will prevent autoscale from working properly. You'll need to add each Azure subscription as an assignable scope that contains host pools and session host VMs you want to use with autoscale. This role and assignment allows Azure Virtual Desktop to manage the power state of any VMs in those subscriptions. It also lets the service apply actions on both host pools and VMs when there are no active user sessions.
6969

7070
To learn how to assign the *Desktop Virtualization Power On Off Contributor* role to the Azure Virtual Desktop service principal, see [Assign Azure RBAC roles or Microsoft Entra roles to the Azure Virtual Desktop service principals](service-principal-assign-roles.md).
7171
::: zone-end
7272

7373
::: zone pivot="dynamic"
7474
## Assign the Desktop Virtualization Power On Off Contributor and Desktop Virtualization Virtual Machine Contributor roles with the Azure portal
7575

76-
Before creating your first scaling plan, you'll need to assign the *Desktop Virtualization Power On Off Contributor* and *Desktop Virtualization Virtual Machine Contributor* RBAC roles to the Azure Virtual Desktop service principal with your Azure subscription as the assignable scope. Assigning these roles at any level lower than your subscription, such as the resource group, host pool, or VM, will prevent autoscale from working properly. You'll need to add each Azure subscription as an assignable scope that contains host pools and session host VMs you want to use with autoscale. These roles and assignments will allow Azure Virtual Desktop to manage the power state of any VMs and to create, delete, update, start, and stop any VMs in those subscriptions. They'll also let the service apply actions on both host pools and VMs when there are no active user sessions.
76+
Before creating your first scaling plan, you'll need to assign the *Desktop Virtualization Power On Off Contributor* and *Desktop Virtualization Virtual Machine Contributor* RBAC roles to the Azure Virtual Desktop service principal with your Azure subscription as the assignable scope. Assigning these roles at any level lower than your subscription, such as the resource group, host pool, or VM, will prevent autoscale from working properly. You'll need to add each Azure subscription as an assignable scope that contains host pools and session host VMs you want to use with autoscale. These roles and assignments allow Azure Virtual Desktop to manage the power state of any VMs and to create, delete, update, start, and stop any VMs in those subscriptions. They also let the service apply actions on both host pools and VMs when there are no active user sessions.
7777

7878
To learn how to assign the *Desktop Virtualization Power On Off Contributor* role to the Azure Virtual Desktop service principal, see [Assign Azure RBAC roles or Microsoft Entra roles to the Azure Virtual Desktop service principals](service-principal-assign-roles.md).
7979
::: zone-end
@@ -115,7 +115,7 @@ Now that you've assigned the *Desktop Virtualization Power On Off Contributor* r
115115

116116
#### Pooled host pools
117117

118-
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.
118+
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 see when you try to create a schedule are the suggested values for weekdays, but you can change them as needed.
119119

120120
To create or change a schedule:
121121

@@ -234,7 +234,7 @@ Here's how to create a scaling plan using the Az.DesktopVirtualization PowerShel
234234

235235
[!INCLUDE [include-cloud-shell-local-powershell](includes/include-cloud-shell-local-powershell.md)]
236236

237-
2. Create a scaling plan for your pooled or personal host pool(s) using the [New-AzWvdScalingPlan](/powershell/module/az.desktopvirtualization/new-azwvdscalingplan) cmdlet:
237+
2. Create a scaling plan for your pooled or personal host pools using the [New-AzWvdScalingPlan](/powershell/module/az.desktopvirtualization/new-azwvdscalingplan) cmdlet:
238238

239239
```azurepowershell
240240
$scalingPlanParams = @{
@@ -355,8 +355,6 @@ Here's how to create a scaling plan using the Az.DesktopVirtualization PowerShel
355355
::: zone-end
356356

357357
::: zone pivot="dynamic"
358-
### [Azure portal](#tab/portal)
359-
360358
Now that you've assigned the *Desktop Virtualization Power On Off Contributor* role to the service principal on your subscriptions, you can create a dynamic scaling plan. To create a dynamic scaling plan using the portal:
361359

362360
1. Sign in to the [Azure portal](https://portal.azure.com).
@@ -399,7 +397,7 @@ Now that you've assigned the *Desktop Virtualization Power On Off Contributor* r
399397

400398
- Define the virtual machine limit:
401399

402-
- **Minimum percentage of active hosts (%)**: The percentage of minimum number of running session host VMs based on the minimum host pool size that are always available. For example, if the minimum percentage of active hosts (%) is specified as 10 and the minimum host pool size is specified as 10, autoscale will ensure one session host is always available to take user connections.
400+
- **Minimum percentage of active hosts (%)**: The percentage of minimum number of running session host VMs based on the minimum host pool size that is always available. For example, if the minimum percentage of active hosts (%) is specified as 10 and the minimum host pool size is specified as 10, autoscale will ensure one session host is always available to take user connections.
403401

404402
- **Minimum host pool size**: The number of session host VMs to always be part of the host pool. These session hosts can either be in a running state or a stopped state.
405403

@@ -450,7 +448,7 @@ Now that you've assigned the *Desktop Virtualization Power On Off Contributor* r
450448
- Load-balancing algorithm. We recommend choosing **depth-first** to gradually reduce the number of session hosts based on sessions on each VM.
451449
- Just like peak hours, you can't configure the capacity threshold here. Instead, the value you entered in **Ramp-down** will carry over.
452450

453-
1. Select **Next** to take you to the **Host pool assignments** tab. Select the check box next to each host pool you want to include. If you don't want to enable autoscale, unselect all check boxes. You can always return to this setting later and change it. You can only assign the dynamic scaling plan to pooled host pool(s) with session host configuration.
451+
1. Select **Next** to take you to the **Host pool assignments** tab. Select the check box next to each host pool you want to include. If you don't want to enable autoscale, unselect all check boxes. You can always return to this setting later and change it. You can only assign the dynamic scaling plan to pooled host pools with session host configuration.
454452

455453
> [!NOTE]
456454
> - When you create or update a scaling plan that's already assigned to host pools, its changes will be applied immediately.
@@ -462,85 +460,8 @@ Now that you've assigned the *Desktop Virtualization Power On Off Contributor* r
462460
463461
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.
464462

465-
### [Azure PowerShell](#tab/powershell)
466-
467-
Here's how to create a dynamic scaling plan using the Az.DesktopVirtualization PowerShell module. The following examples show you how to create a scaling plan and scaling plan schedule. Be sure to change the `<placeholder>` values for your own.
468-
469-
[!INCLUDE [include-cloud-shell-local-powershell](includes/include-cloud-shell-local-powershell.md)]
470-
471-
2. Create a scaling plan for your pooled or personal host pool(s) using the [New-AzWvdScalingPlan](/powershell/module/az.desktopvirtualization/new-azwvdscalingplan) cmdlet:
472-
473-
```azurepowershell
474-
$scalingPlanParams = @{
475-
ResourceGroupName = '<resourceGroup>'
476-
Name = '<scalingPlanName>'
477-
Location = '<AzureRegion>'
478-
Description = '<Scaling plan description>'
479-
FriendlyName = '<Scaling plan friendly name>'
480-
HostPoolType = '<Pooled>'
481-
TimeZone = '<Time zone, such as Pacific Standard Time>'
482-
HostPoolReference = @(@{'hostPoolArmPath' = '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/<resourceGroup/providers/Microsoft.DesktopVirtualization/hostPools/<hostPoolName>'; 'scalingPlanEnabled' = $true;})
483-
}
484-
485-
$scalingPlan = New-AzWvdScalingPlan @scalingPlanParams
486-
```
487-
488-
489-
3. Create a dynamic scaling plan schedule using 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.
490-
491-
492-
```azurepowershell
493-
$scalingPlanPooledScheduleParams = @{
494-
ResourceGroupName = 'resourceGroup'
495-
ScalingPlanName = 'dynamicScalingPlan'
496-
ScalingPlanScheduleName = 'dynamicAutoscalingSchedule1'
497-
DaysOfWeek = 'Monday','Tuesday','Wednesday','Thursday','Friday'
498-
RampUpStartTimeHour = '6'
499-
RampUpStartTimeMinute = '30'
500-
RampUpLoadBalancingAlgorithm = 'BreadthFirst'
501-
RampUpMinimumHostsPct = '20'
502-
RampUpCapacityThresholdPct = '20'
503-
PeakStartTimeHour = '8'
504-
PeakStartTimeMinute = '30'
505-
PeakLoadBalancingAlgorithm = 'DepthFirst'
506-
RampDownStartTimeHour = '16'
507-
RampDownStartTimeMinute = '0'
508-
RampDownLoadBalancingAlgorithm = 'BreadthFirst'
509-
RampDownMinimumHostsPct = '20'
510-
RampDownCapacityThresholdPct = '20'
511-
RampDownForceLogoffUser = $true
512-
RampDownWaitTimeMinute = '30'
513-
RampDownNotificationMessage = 'Log out now, please.'
514-
RampDownStopHostsWhen = 'ZeroSessions'
515-
OffPeakStartTimeHour = '22'
516-
OffPeakStartTimeMinute = '45'
517-
OffPeakLoadBalancingAlgorithm = 'DepthFirst'
518-
ScalingMethod = 'CreateDeleteDynamic'
519-
CreateDeleteRampUpMaximumHostPoolSize = '10'
520-
CreateDeleteRampUpMinimumHostPoolSize = '5'
521-
CreateDeleteRampDownMaximumHostPoolSize = '5'
522-
CreateDeleteRampDownMinimumHostPoolSize = '1'
523-
}
524-
525-
$scalingPlanPooledSchedule = New-AzWvdScalingPlanPooledSchedule @scalingPlanPooledScheduleParams
526-
```
527-
528-
529-
4. Use [Get-AzWvdScalingPlan](/powershell/module/az.desktopvirtualization/get-azwvdscalingplan) to get the host pool(s) that your scaling plan is assigned to.
530-
531-
```azurepowershell
532-
$params = @{
533-
ResourceGroupName = 'resourceGroup'
534-
Name = 'scalingPlanPersonal'
535-
}
536-
537-
(Get-AzWvdScalingPlan @params).HostPoolReference | FL HostPoolArmPath,ScalingPlanEnabled
538-
```
539-
540-
541-
You have now created a new dynamic scaling plan, one or more schedules, assigned it to your automated pooled host pool(s), and enabled autoscale.
542-
543-
---
463+
> [!IMPORTANT]
464+
> When you deploy session hosts in the portal using session host configuration, it currently by default doesn't automatically delete the NIC and/or disk when deleting the VM. Scaling honors the setting therefore NIC and disks for the VMs created manually in the portal won't be automatically deleted. This default setting will be changed so that NIC and disk for the VMs created by the scaling service will be automatically deleted together with the VMs.
544465
545466
::: zone-end
546467

articles/virtual-desktop/autoscale-faq.yml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,26 @@ sections:
156156
No. You only need to define the virtual machine limit with the minimum host pool size, the maximum host pool size, and the minimum percentage of active hosts (%). When the actual number of VMs needed isn't larger than the minimum host pool size, autoscale will turn on VMs if the used host pool capacity exceeds your defined capacity threshold. When the actual number of VMs needed is larger than the minimum host pool size, autoscale will turn on the stopped VMs and create additional VMs given the total number of active VMs won’t exceed the maximum host pool size defined in the scaling plan if the used host pool capacity exceeds your defined capacity threshold.
157157
158158
- question: |
159-
test
159+
Which image version will be used for the VMs created by autoscale?
160160
answer: |
161-
test
161+
Autoscale will create VMs with the latest image version defined in the active session host configuration, if you don’t already have an active session host configuration.
162+
163+
- question: |
164+
How can I configure my scaling plan to only turn on and deallocate session host VMs?
165+
answer: |
166+
You can either choose **Power management autoscaling** as the scaling method when you create your scaling plan, or you can set the same value for **Minimum host pool size** and **Maximum host pool size** if you chose **Dynamic autoscaling**.
167+
168+
- question: |
169+
How can I configure my scaling plan to only create and delete session host VMs?
170+
answer: |
171+
You can set the **Minimum percentage of active hosts (%)** to 100. Autoscale will only create or delete session host VMs if the Used host pool capacity exceeds or drops below your defined capacity threshold.
172+
173+
- question: |
174+
What happens if the number of session host VMs in the host pool exceeds the maximum host pool size?
175+
answer: |
176+
This might happen if the **Maximum host pool size** is configured differently in each phase. Autoscale will delete the active deallocated session host VMs with no sessions to honor the **Maximum host pool size** setting in the current phase, and then continue to delete/deallocate session host VMs based on the schedule and capacity threshold except in the ramp-up phase. No delete/deallocate action will be taken as long as the number of session host VMs in the host pool doesn't exceed the maximum host pool size. This behavior is consistent with the power management autoscaling scaling method, where session host VMs aren't deallocated in the ramp-up phase for pooled host pools.
177+
178+
- question: |
179+
Can I still manually create and delete session host VMs?
180+
answer: |
181+
Yes, but when the scaling service deletes a session host VM that you manually created, it will honor the settings you set whether to automatically delete the NIC and/or disk.

0 commit comments

Comments
 (0)