|
1 | 1 | ---
|
2 |
| -title: Control costs with lab policies |
| 2 | +title: Set lab policies |
3 | 3 | description: Learn how to define lab policies such as VM sizes, maximum VMs per user, and shutdown automation.
|
4 | 4 | ms.topic: how-to
|
5 | 5 | ms.author: rosemalcolm
|
6 | 6 | author: RoseHJM
|
7 |
| -ms.date: 09/30/2023 |
| 7 | +ms.date: 03/27/2025 |
8 | 8 | ms.custom: UpdateFrequency2
|
9 | 9 | ---
|
10 | 10 |
|
11 |
| -# Manage lab policies to control costs in Azure DevTest Labs |
| 11 | +# Manage lab policies in Azure DevTest Labs |
12 | 12 |
|
13 |
| -This article describes how you can manage Azure DevTest Labs policies to control lab costs and minimize waste. Lab policies you can set to control costs include: |
| 13 | +This article describes how Azure DevTest Labs administrators can manage lab policies to control lab costs, minimize waste, and improve managability. Lab policies include: |
14 | 14 |
|
| 15 | +- Internal support |
15 | 16 | - Allowed virtual machine (VM) sizes
|
16 | 17 | - Maximum VMs per user
|
17 | 18 | - Maximum VMs per lab
|
18 |
| -- Auto-shutdown settings |
19 |
| -- Auto-shutdown policy settings |
20 |
| -- Autostart settings |
| 19 | +- Autoshutdown |
| 20 | +- Autostart |
| 21 | +- Autoshutdown policy |
21 | 22 |
|
22 |
| -## Access lab Configuration and policies |
| 23 | +## Prerequisites |
23 | 24 |
|
24 |
| -1. In the [Azure portal](https://go.microsoft.com/fwlink/p/?LinkID=525040), on the **Overview** page for your lab, select **Configuration and policies** from the left navigation. |
| 25 | +**Contributor** or **Owner** level permissions to the lab. |
25 | 26 |
|
26 |
| - :::image type="content" source="./media/devtest-lab-set-lab-policy/configuration-policies-menu.png" alt-text="Screenshot that shows the Configuration and policies menu for a lab."::: |
| 27 | +## Set lab policies |
27 | 28 |
|
28 |
| -1. On the **Configuration and policies** page, select the policy you want to configure from the left navigation. |
29 |
| - |
30 |
| - :::image type="content" source="./media/devtest-lab-set-lab-policy/policies-menu.png" alt-text="Screenshot that shows a lab's Configuration and Policies options."::: |
| 29 | +To set lab policies, on your lab page in the [Azure portal](https://go.microsoft.com/fwlink/p/?LinkID=525040), select **Configuration and policies** from the left navigation. |
31 | 30 |
|
32 |
| -## Set allowed virtual machine sizes |
| 31 | +:::image type="content" source="./media/devtest-lab-set-lab-policy/configuration-policies-menu.png" alt-text="Screenshot that shows the Configuration and policies menu for a lab."::: |
33 | 32 |
|
34 |
| -This policy specifies the VM sizes that users can create in the lab. |
| 33 | +On the **Configuration and policies** page, select the policy you want to configure from the **Settings** and **Schedules** sections of the left navigation. |
35 | 34 |
|
36 |
| -1. On the lab's **Configuration and policies** page, select **Allowed virtual machines sizes** from the left navigation. |
37 |
| - |
38 |
| -1. On the **Allowed virtual machines sizes** screen, select **Yes** or **No** to enable or disable the policy. |
| 35 | +:::image type="content" source="./media/devtest-lab-set-lab-policy/policies-menu.png" alt-text="Screenshot that shows a lab's Configuration and Policies options."::: |
| 36 | + |
| 37 | +### Allowed virtual machine sizes |
39 | 38 |
|
40 |
| -1. If you enable the policy, select the VM sizes to allow in the lab. |
| 39 | +This policy specifies the VM sizes that users can create in the lab. |
41 | 40 |
|
| 41 | +1. On the lab's **Configuration and policies** page, select **Allowed virtual machines sizes** from the left navigation. |
| 42 | +1. On the **Allowed virtual machines sizes** page, select **All sizes** or **Selected sizes**. |
| 43 | +1. If you select **Selected sizes**, select the VM sizes to allow users to create in the lab. |
42 | 44 | 1. Select **Save**.
|
43 | 45 |
|
44 |
| - :::image type="content" source="./media/devtest-lab-set-lab-policy/allowed-vm-sizes.png" alt-text="Screenshot showing Allowed virtual machines sizes."::: |
| 46 | + :::image type="content" source="./media/devtest-lab-set-lab-policy/allowed-vm-sizes.png" alt-text="Screenshot showing Allowed VM sizes."::: |
45 | 47 |
|
46 |
| -## Set virtual machines per user |
| 48 | +### Virtual machines per user |
47 | 49 |
|
48 |
| -This policy specifies the maximum number of VMs that an individual lab user can own. |
| 50 | +This policy specifies the maximum number of VMs that an individual lab user can claim or create. |
49 | 51 |
|
50 | 52 | 1. On the lab's **Configuration and policies** page, select **Virtual machines per user** from the left navigation.
|
51 |
| - |
52 |
| -1. On the **Virtual machines per user** screen, under **Limit the number of virtual machines**, select **On** or **Off** to enable or disable the policy. |
53 |
| - |
54 |
| -1. If you enable the policy, under **What is the limit**, enter the maximum number of VMs that a user can own. |
55 |
| - |
56 |
| -1. Under **Limit the number of virtual machines using premium OS disks**, select **On** or **Off** to enable or disable limiting the number of a user's VMs that use premium solid-state disks (SSDs). |
57 |
| - |
58 |
| -1. If you selected **On**, enter the maximum number of VMs using premium disks that a user can own. |
59 |
| - |
60 |
| - > [!NOTE] |
61 |
| - > This policy applies only to Premium SSDs. The limitation doesn't apply to Standard SSDs. |
62 |
| -
|
| 53 | +1. On the **Virtual machines per user** page, under **Limit the number of virtual machines**, select **On** or **Off** to enable or disable the policy. |
| 54 | +1. If you select **On**, under **What is the limit**, enter the maximum number of VMs that a user can claim or create. |
| 55 | +1. Under **Limit the number of virtual machines using premium OS disks**, select **On** or **Off** to enable or disable the policy. |
| 56 | +1. If you select **On**, enter the maximum number of VMs using premium solid-state disks (SSDs) that a user can claim or create. This number applies only to Premium SSDs, not Standard SSDs. |
63 | 57 | 1. Select **Save**.
|
64 | 58 |
|
65 | 59 | :::image type="content" source="./media/devtest-lab-set-lab-policy/max-vms-per-user.png" alt-text="Screenshot showing Virtual machines per user.":::
|
66 | 60 |
|
67 |
| -If a user tries to create or claim a VM when the user limit has been met, an error message indicates that the user can't exceed their VM limit. |
| 61 | +If a user tries to create or claim a VM after the user limit is met, an error message indicates that the user can't exceed their VM limit. |
68 | 62 |
|
69 | 63 | :::image type="content" source="./media/devtest-lab-set-lab-policy/error.png" alt-text="Screenshot showing the error that the user can't exceed their VM limit.":::
|
70 | 64 |
|
71 |
| -## Set virtual machines per lab |
| 65 | +### Virtual machines per lab |
72 | 66 |
|
73 |
| -This policy specifies the maximum number of VMs that all users can create or claim in the current lab. |
| 67 | +This policy specifies the maximum number of VMs that all users can create in the current lab. |
74 | 68 |
|
75 | 69 | 1. On the lab's **Configuration and policies** page, select **Virtual machines per lab** from the left navigation.
|
76 |
| - |
77 |
| -1. On the **Virtual machines per user** screen, under **Limit the number of virtual machines**, select **On** or **Off** to enable or disable the policy. |
78 |
| - |
79 |
| -1. If you enable the policy, under **What is the limit**, enter the maximum number of VMs that can be created or claimed. |
80 |
| - |
81 |
| -1. Under **Limit the number of virtual machines using premium OS disks**, select **On** or **Off** to enable or disable limiting the number of VMs that use premium SSDs. |
82 |
| - |
83 |
| -1. If you selected **On**, enter the maximum number of VMs that can use premium disks. |
84 |
| - |
| 70 | +1. On the **Virtual machines per lab** page, under **Limit the number of virtual machines**, select **On** or **Off** to enable or disable the policy. |
| 71 | +1. If you select **On**, under **What is the limit**, enter the maximum number of VMs that can be created in the lab. |
| 72 | +1. Under **Limit the number of virtual machines using premium OS disks**, select **On** or **Off** to enable or disable the policy. |
| 73 | +1. If you selected **On**, enter the maximum number of VMs in the lab that can use premium SSDs. |
85 | 74 | 1. Select **Save**.
|
86 | 75 |
|
87 |
| - :::image type="content" source="./media/devtest-lab-set-lab-policy/max-vms-per-lab.png" alt-text="Screenshot showing Virtual machines per lab."::: |
| 76 | + :::image type="content" source="./media/devtest-lab-set-lab-policy/max-vms-per-lab.png" alt-text="Screenshot showing VMs per lab."::: |
88 | 77 |
|
89 |
| -If a user tries to create or claim a VM when the lab limit has been met, an error message indicates that the VM can't be created or claimed. |
| 78 | +If a user tries to create or claim a VM after the lab limit is met, an error message indicates that the VM can't be created or claimed. |
90 | 79 |
|
91 |
| -## Set auto-shutdown |
| 80 | +<a name="set-auto-shutdown"></a> |
| 81 | +### Autoshutdown |
92 | 82 |
|
93 |
| -Auto-shutdown helps minimize lab waste by shutting down lab VMs at a specific time of day. |
| 83 | +Autoshutdown helps minimize lab waste by shutting down lab VMs at a specific time of day. |
94 | 84 |
|
95 | 85 | 1. On the lab's **Configuration and policies** page, select **Auto-shutdown** from the left navigation.
|
96 |
| - |
97 |
| -1. On the **Auto-shutdown** screen, for **Enabled**, select **On** or **Off** to enable or disable the policy. |
98 |
| - |
99 |
| -1. For **Scheduled shutdown** and **Time zone**, if you enabled auto-shutdown, specify the time and time zone to shut down all lab VMs. |
100 |
| - |
101 |
| -1. For **Send notification before auto-shutdown**, select **Yes** or **No** for the option to send a notification before the specified auto-shutdown time. |
102 |
| - |
103 |
| - If you choose **Yes**, enter a webhook URL endpoint under **Webhook URL** or semicolon-separated email addresses under **Email address** where you want to post or send the notification. |
104 |
| - |
| 86 | +1. On the **Auto-shutdown** page, select **On** or **Off** to enable or disable the policy. |
| 87 | +1. If you select **On**, for **Scheduled shutdown** and **Time zone**, specify the time and time zone to shut down all lab VMs. |
| 88 | +1. For **Send notification before auto-shutdown**, select **Yes** or **No** for the option to send a notification before the specified autoshutdown time. |
| 89 | +1. If you choose **Yes**, enter a webhook URL endpoint under **Webhook URL** or semicolon-separated email addresses under **Email address** to post or send the notification. |
105 | 90 | 1. Select **Save**.
|
106 | 91 |
|
107 | 92 | :::image type="content" source="./media/devtest-lab-set-lab-policy/auto-shutdown.png" alt-text="Screenshot showing Auto shutdown.":::
|
108 | 93 |
|
109 |
| -By default, auto-shutdown applies to all lab VMs. If allowed by policy, lab users can override auto-shutdown settings for their individual lab VMs. To access auto-shutdown settings for individual VMs: |
| 94 | +By default, autoshutdown applies to all lab VMs. If allowed by [autoshutdown policy](#autoshutdown-policy), lab users can override lab autoshutdown settings for their own lab VMs as follows: |
110 | 95 |
|
111 | 96 | 1. Select the VM from **My virtual machines** on the lab **Overview** page.
|
112 |
| -1. On the home page for the VM, in the **Operations** section of the left navigation, select **Auto-shutdown**. |
| 97 | +1. On the home page for the VM, select **Auto-shutdown** from the **Operations** section of the left navigation. |
113 | 98 |
|
114 |
| -For more information about auto-shutdown and sending notifications, see [Configure auto shutdown for labs and VMs in DevTest Labs](devtest-lab-auto-shutdown.md). |
| 99 | +For more information about autoshutdown and sending notifications, see [Configure autoshutdown for labs and VMs in DevTest Labs](devtest-lab-auto-shutdown.md). |
115 | 100 |
|
116 |
| -## Set auto-shutdown policy |
| 101 | +### Autostart |
117 | 102 |
|
118 |
| -Lab owners can configure auto-shutdown on all lab VMs centrally, and set a policy to let lab users override the settings for their own VMs. You can set auto-shutdown policy to allow lab users full control, partial control, or no control over their own VMs' auto-shutdown activity. |
| 103 | +Autostart policy helps you minimize waste by specifying a specific time of day and days of the week to start up lab VMs. |
119 | 104 |
|
120 |
| -> [!IMPORTANT] |
121 |
| -> Auto-shutdown policy changes apply only to new lab VMs, not to already-existing VMs. |
122 |
| -
|
123 |
| -1. On the lab's **Configuration and policies** page, select **Auto shutdown policy** from the left navigation. |
124 |
| - |
125 |
| -1. Select one of the following options: |
126 |
| - |
127 |
| - - **User sets a schedule and can opt out**: Lab users can override or opt out of lab auto-shutdown. Lab users can override the lab schedule, and they don't have to set any auto-shutdown for their VMs. |
128 |
| - |
129 |
| - - **User sets a schedule and cannot opt out**: Lab users can override the lab schedule for their VMs, but they can't opt out of auto-shutdown. This option ensures that every VM in the lab is on some auto-shutdown schedule. |
130 |
| - |
131 |
| - - **User has no control over the schedule set by lab administrator**: Lab users can't override or opt out of the lab auto-shutdown schedule. Lab users can set up auto-shutdown notifications for their own VMs. |
| 105 | +> [!NOTE] |
| 106 | +> This policy isn't automatically applied to lab VMs. To apply this setting to VMs, open the VM's page and change its **Auto-start** setting. |
132 | 107 |
|
| 108 | +1. On the lab's **Configuration and policies** page, select **Auto-start** from the left navigation. |
| 109 | +1. Select **Yes** or **No** to enable or disable the policy. |
| 110 | +1. If you select **Yes**, specify the **Scheduled start**, **Time zone**, and **Days of the week** to start up the lab VMs. |
133 | 111 | 1. Select **Save**.
|
134 | 112 |
|
135 |
| - :::image type="content" source="./media/devtest-lab-set-lab-policy/auto-shutdown-policy-options.png" alt-text="Screenshot showing Auto-shutdown policy options."::: |
| 113 | + :::image type="content" source="./media/devtest-lab-set-lab-policy/auto-start.png" alt-text="Screenshot showing the Autostart selection."::: |
136 | 114 |
|
137 |
| -For more information and details about auto-shutdown policy, see [Configure lab auto shutdown policy](devtest-lab-auto-shutdown.md#configure-lab-auto-shutdown-policy). |
| 115 | +For more information and details about autostart policy, see [Start up lab virtual machines automatically](devtest-lab-auto-startup-vm.yml). |
138 | 116 |
|
139 |
| -## Set autostart |
| 117 | +### Autoshutdown policy |
140 | 118 |
|
141 |
| -Autostart policy helps you minimize waste by specifying a specific time of day and days of the week to start up all lab VMs. |
| 119 | +If you set autoshutdown for lab VMs, you can also set a policy to let lab users override the lab autoshutdown settings for their own VMs. You can set autoshutdown policy to allow lab users full control, partial control, or no control over their own VMs' autoshutdown activity. |
142 | 120 |
|
143 |
| -1. On the lab's **Configuration and policies** page, select **Auto-start** from the left navigation. |
| 121 | +> [!IMPORTANT] |
| 122 | +> Autoshutdown policy changes apply only to new lab VMs, not to already-existing VMs. |
144 | 123 |
|
145 |
| -1. Select **Yes** or **No** to enable or disable the policy. |
| 124 | +1. On the lab's **Configuration and policies** page, select **Auto shutdown policy** from the left navigation. |
| 125 | +1. Select one of the following options: |
146 | 126 |
|
147 |
| -1. If you enable this policy, specify the **Scheduled start**, **Time zone**, and **Days of the week** to start up the lab VMs. |
| 127 | + - **User sets a schedule and can opt out**: Lab users can override or opt out of lab autoshutdown. Lab users can override the lab schedule, and they don't have to set any autoshutdown for their VMs. This setting is the default. |
| 128 | + - **User sets a schedule and cannot opt out**: Lab users can override the lab schedule for their VMs, but they can't opt out of autoshutdown. This option ensures that every VM in the lab is on some autoshutdown schedule. |
| 129 | + - **User has no control over the schedule set by lab administrator**: Lab users can't override or opt out of the lab autoshutdown schedule. They can set up autoshutdown notifications for their own VMs. |
148 | 130 |
|
149 | 131 | 1. Select **Save**.
|
150 | 132 |
|
151 |
| - :::image type="content" source="./media/devtest-lab-set-lab-policy/auto-start.png" alt-text="Screenshot showing the Autostart selection."::: |
| 133 | + :::image type="content" source="./media/devtest-lab-set-lab-policy/auto-shutdown-policy-options.png" alt-text="Screenshot showing autoshutdown policy options."::: |
152 | 134 |
|
153 |
| -> [!NOTE] |
154 |
| -> This policy isn't automatically applied to current VMs in the lab. To apply this setting to current VMs, open the VM's page and change its **Auto-start** setting. |
155 |
| -
|
156 |
| -For more information and details about autostart policy, see [Start up lab virtual machines automatically](devtest-lab-auto-startup-vm.yml). |
| 135 | +For more information and details about autoshutdown policy, see [Configure lab autoshutdown policy](devtest-lab-auto-shutdown.md#configure-lab-auto-shutdown-policy). |
157 | 136 |
|
158 |
| -## Next steps |
| 137 | +## Related content |
159 | 138 |
|
160 | 139 | Besides setting policies, here are more ways to control and manage DevTest Labs costs:
|
161 | 140 |
|
|
0 commit comments