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
Copy file name to clipboardExpand all lines: articles/devtest-labs/devtest-lab-auto-shutdown.md
+48-66Lines changed: 48 additions & 66 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,21 +1,19 @@
1
1
---
2
-
title: Manage autoshutdown policies in Azure DevTest Labs and Compute VMs
3
-
description: Learn how to set autoshutdown policy for a lab so that virtual machines are automatically shut down when they aren't in use.
2
+
title: Configure auto shutdown policies for Azure virtual machines in DevTest Labs
3
+
description: Learn how to set a lab auto shutdown policy to automatically shut down virtual machines at a set time.
4
4
ms.topic: how-to
5
5
ms.date: 10/26/2021
6
6
---
7
7
8
-
# Configure auto-shutdown for lab and compute virtual machines in Azure DevTest Labs
8
+
# Configure autoshutdown schedule and policy for Azure virtual machines in DevTest Labs
9
9
10
-
This article explains how to configure the DevTest Labs's auto-shutdown policy for Azure virtual machines (VMs). It also shows how to set a shut-down policy for an Azure VM outside of DevTest Labs.
10
+
Azure DevTest Labs enables you to control cost in your labs by managing policies for each lab. This article shows you how to configure an autoshutdown policy for Azure virtual machines (VMs) at the lab level. It also shows how to configure auto shutdown settings for VMs at the individual level within the defined policy. To view how to set every lab policy, see [Define lab policies in Azure DevTest Labs](devtest-lab-set-lab-policy.md).
11
11
12
-
## Configure auto-shutdown for lab VMs (DevTest Labs)
12
+
## Configure auto-shutdown schedule
13
13
14
-
Azure DevTest Labs enables you to control cost and minimize waste in your labs by managing policies for each lab. This article shows you how to configure auto-shutdown policy for a lab. It also shows how to configure auto-shutdown settings for a ??lab VM??. To view how to set every lab policy, see [Define lab policies in Azure DevTest Labs](devtest-lab-set-lab-policy.md).
14
+
As a lab owner, you can configure a shutdown schedule for the VMs in your lab. The auto-shutdown schedule minimizes lab waste by allowing you to specify the time that the lab's VMs are shut down. Auto-shutdown schedule updates within 30 minutes of the current schedule will apply towards the next day's schedule.
15
15
16
-
### Set auto-shutdown policy for a lab
17
-
18
-
As a lab owner, you can configure a shutdown schedule for all the VMs in your lab. By doing so, you can reducing costs by ensuring machines are not let left on while not in use. You can enforce a shutdown policy on all your lab VMs centrally and also save your lab users the effort from setting up a schedule for their individual machines. This feature enables you to set the policy on your lab schedule ranging from allowing lab users to have full control over their VM's shutdown schedule to no control over their VM's shutdown. As a lab owner, you can configure this policy by taking the following steps:
16
+
To view or change the lab schedule:
19
17
20
18
1. Sign in to the [Azure portal](https://portal.azure.com/).
21
19
@@ -25,99 +23,80 @@ As a lab owner, you can configure a shutdown schedule for all the VMs in your la
25
23
26
24
:::image type="content" source="./media/devtest-lab-auto-shutdown/portal-lab-configuration-policies.png" alt-text="Screenshot of the DevTest Labs home page.":::
27
25
28
-
1. On **Configuration and policies** page, under **Schedules**, select **Auto shutdown policy**.
29
-
30
-
1. Select the level of control lab users will have over their individual VM shutdown schedule.
31
-
32
-
| Level of control | Description |
33
-
|----|----|
34
-
|User sets a schedule and can opt out| If you set your lab to this policy, the lab users can override or opt out of the lab schedule. This option grants lab users full control over auto shutdown schedule of their VMs. Lab users see no change in their VM auto shutdown schedule page.|
35
-
|User sets a schedule and cannot opt out| If you set your lab to this policy, lab users can override the lab schedule. However, they can't opt out of auto shutdown policy. This option makes sure that every machine in your lab is under an auto-shutdown schedule. Lab users may update auto-shutdown schedule of their VMs, and set up shutdown notifications.|
36
-
|User has no control over the schedule set by lab administrator| If you set your lab to this policy, lab users can't override or opt out of the lab schedule. This option offers lab admin the complete control on the schedule for every machine in the lab. Lab users can only set up auto shutdown notifications for their VMs.|
37
-
38
-
:::image type="content" source="./media/devtest-lab-auto-shutdown/auto-shutdown-policy-options.png" alt-text="Screenshot of auto shutdown policy options.":::
39
-
40
-
1. Select **Save**. Changes to the shutdown policy only apply to new VMs created in the lab and not to existing VMs.
41
-
42
-
### Configure auto-shutdown settings
43
-
44
-
The auto shutdown policy helps to minimize lab waste by allowing you to specify the time that this lab's VMs are shut down. If you update the auto shutdown schedule for your lab or a specific lab virtual machine within 30 mins of the current scheduled time, the updated shutdown time will apply towards the next day's schedule.
45
-
46
-
To view or change the policies for a lab, follow these steps:
47
-
48
-
1. On **Configuration and policies** page, under **Schedules**, select **Auto-shutdown**.
26
+
1. On the **Configuration and policies** page, under **Schedules**, select **Auto-shutdown**.
49
27
50
28
1. Configure the following properties:
51
29
52
30
|Property | Description |
53
31
|---|---|
54
-
|Enabled| Select **On** to enable this policy, and**Off** to disable it.|
32
+
|Enabled| Select **On** to enable this policy, or**Off** to disable it.|
55
33
|Scheduled shutdown| Enter a time to shut down all VMs in the current lab.|
56
34
|Time zone| Select a time zone from the drop-down list.|
57
-
|Notification | Select **Yes** or **No** to send a notification 30 minutes before the specified autoshutdown time. If you choose **Yes**, enter a webhook URL endpoint or email address specifying where you want the notification to be posted or sent. The user receives notification and is given the option to delay the shutdown. For more information, see the [Notifications](#notifications) section.|
35
+
|Send notification before auto-shutdown? | Select **Yes** or **No** to send a notification 30 minutes before the specified auto-shutdown time. If you choose **Yes**, enter a webhook URL endpoint or email address specifying where you want the notification to be posted or sent. The user receives notification and is given the option to delay the shutdown. For more information, see [Notifications](#notifications), below.|
58
36
|Webhook URL| A notification will be posted to the specified webhook endpoint when the auto-shutdown is about to happen.|
59
37
|Email address| Enter a set of semicolon-delimited email addresses to receive alert notification emails.|
60
38
61
-
:::image type="content" source="./media/devtest-lab-auto-shutdown/auto-shutdown.png" alt-text="Screenshot of auto-shutdown details.":::
39
+
:::image type="content" source="./media/devtest-lab-auto-shutdown/auto-shutdown.png" alt-text="Screenshot of auto-shutdown schedule details.":::
62
40
63
-
1. Select **Save**. By default, once enabled, this policy applies to all VMs in the current lab. To remove this setting from a specific VM, open the VM's management pane and change its **Auto-shutdown** setting.
41
+
1. Select **Save**. By default, the enabled policy applies to all VMs in the current lab. To modify the schedule for an individual VM, see [Configure auto shutdown for individual VMs](#configure-auto-shutdown-for-individual-vms), below.
42
+
43
+
## Configure auto shutdown policy
64
44
45
+
You can enforce a shutdown policy on all your lab VMs centrally and also save your lab users the effort from setting up a schedule for their individual machines. Configure this policy by taking the following steps:
65
46
66
-
## Configure auto shutdown for compute VMs
47
+
1. Sign in to the [Azure portal](https://portal.azure.com/).
67
48
68
49
1. Navigate to your lab in **DevTest Labs**.
69
50
70
-
1. Under **My Lab**, select **My Virtual machines**. Then select a virtual machine.
51
+
1. Under **Settings**, select **Configuration and policies**.
71
52
72
-
:::image type="content" source="./media/devtest-lab-auto-shutdown/portal-lab-virtual-machines.png" alt-text="Screenshot of list of virtual machines.":::
53
+
1. On the **Configuration and policies** page, under **Schedules**, select **Auto shutdown policy**.
73
54
55
+
1. Select the level of control lab users will have over their individual VM's shutdown schedule.
74
56
57
+
| Level of control | Description |
58
+
|----|----|
59
+
|User sets a schedule and can opt out| Lab users can override or opt out of the lab schedule. This option grants lab users full control over the auto shutdown schedule of their VMs.|
60
+
|User sets a schedule and cannot opt out| Lab users can override the lab schedule. However, they can't opt out of the auto shutdown policy. This option ensures that every machine in your lab is under an auto shutdown schedule. Lab users can also modify shutdown notifications.|
61
+
|User has no control over the schedule set by lab administrator| Lab users can't override or opt out of the lab schedule. This option offers the lab admin the complete control on the schedule for every machine in the lab.|
75
62
76
-
1. On the **Virtual machine** page, select **Auto-shutdown** on the left menu in the **Operations** section.
77
-
2. On the **Auto-shutdown** page, select **On** to enable this policy, and **Off** to disable it.
78
-
3. If you enable this policy, specify the **time** (and **time zone**) at which the VM should be shut down.
79
-
4. Choose **Yes** or **No** for the option to send a notification 30 minutes before the specified autoshutdown time. If you choose **Yes**, enter a webhook URL endpoint or email address specifying where you want the notification to be posted or sent. The user receives notification and is given the option to delay the shutdown. For more information, see the [Notifications](#notifications) section.
80
-
5. Select **Save**.
63
+
:::image type="content" source="./media/devtest-lab-auto-shutdown/auto-shutdown-policy-options.png" alt-text="Screenshot of auto shutdown policy options.":::
81
64
82
-

65
+
1. Select **Save**. Changes to the shutdown policy only apply to new VMs created in the lab and not to existing VMs.
83
66
84
-
### View activity logs for auto shutdown updates
67
+
##Configure auto shutdown for individual VMs
85
68
86
-
When you update the autoshutdown setting, you'll see the activity logged in the activity log for the VM.
69
+
1. Navigate to your lab in **DevTest Labs**.
87
70
88
-
1. In the [Azure portal](https://portal.azure.com), navigate to the home page for your VM.
89
-
2. Select **Activity log** from the left menu.
90
-
3. Remove **Resource: mycomputevm** from filters.
91
-
4. Confirm that you see the **Add or modify schedules** operation in the activity log. If you don't see it, wait for sometime and refresh the activity log.
71
+
1. Under **My Lab**, select **My Virtual machines**. Then select a virtual machine.
72
+
73
+
:::image type="content" source="./media/devtest-lab-auto-shutdown/portal-lab-virtual-machines.png" alt-text="Screenshot of list of virtual machines.":::
74
+
75
+
1. On the **virtual machine** page, under **Operations**, select **Auto-shutdown**.
5. Select the **Add or modify schedules** operation to see the following information on the **Summary** page:
77
+
:::image type="content" source="./media/devtest-lab-auto-shutdown/virtual-machines-autho-shutdown.png" alt-text="Screenshot of virtual machines home page.":::
95
78
96
-
- Operation name (Add or modify schedules)
97
-
- The date and time at which the autoshutdown setting was updated.
98
-
- The email address of the user who updated the setting.
79
+
1. The configurations are the same as described in [Configure auto-shutdown schedule](#configure-auto-shutdown-schedule), above. The auto shutdown policy determines the lab user's ability to modify the configurations as described in [Configure auto shutdown policy](#configure-auto-shutdown-policy), above.
6. Switch to the **Change history** tab in the **Add or modify schedules** page, you see the change history for the setting. In the following example, the shutdown time was changed from 7 PM to 6 PM on April 10, 2020 at 15:18:47 EST. And, the setting was disabled at 15:25:09 EST.
7. To see more details about the operation, switch to the **JSON** tab in the **Add or modify schedules** page.
83
+
When you update the auto shutdown schedule or policy, you'll see the history in the VM's [Activity log](../azure-monitor/essentials/activity-log.md). When searching, remove the lab's resource group and add [Filter](azure-monitor/essentials/activity-log.md#view-the-activity-log)**Operation**: for `Add or modify policies` and `Add or modify schedules`.
105
84
106
85
## Notifications
107
86
108
-
Once autoshutdown is configured, notifications will be sent to the lab users 30 minutes before the autoshutdown triggered if any of their VMs will be affected. This option gives lab users a chance to save their work before the shutdown. The notification also provides links for each VM for the following actions in case someone needs to keep working on their VM.
87
+
Once auto shutdown is configured, notifications will be sent to the lab users 30 minutes before their VMs will be affected. This option gives lab users a chance to save their work before the shutdown. The notification also provides links for each VM in case someone needs to keep working on their VM. The user will have the following choices:
109
88
110
-
- Skip the autoshutdown for this time
111
-
- Snooze the autoshutdown for an hour
112
-
- Snooze the autoshutdown for 2 hours
89
+
- Skip the auto shutdown for this time
90
+
- Snooze the auto shutdown for an hour
91
+
- Snooze the auto shutdown for two hours
113
92
114
-
The Notification is sent to the webhook url if a webhook was specified. If an email address was specified in the autoshutdown settings, an email will be sent to that email address. Webhooks allow you to build or set up integrations that subscribe to certain events. When one of those events is triggered, DevTest Labs will send an HTTP POST payload to the webhook's configured URL. For more information about responding to webhooks, see [Azure Functions HTTP triggers and bindings overview](../azure-functions/functions-bindings-http-webhook.md) or [adding an HTTP trigger for Azure Logic Apps](../connectors/connectors-native-http.md#add-an-http-trigger).
93
+
The Notification is sent to the webhook url if a webhook was specified. If an email address was specified, an email will be sent to that email address. Webhooks allow you to build or set up integrations that subscribe to certain events. When one of those events is triggered, DevTest Labs will send an HTTP POST payload to the webhook's configured URL. For more information about responding to webhooks, see [Azure Functions HTTP triggers and bindings overview](../azure-functions/functions-bindings-http-webhook.md) or [adding an HTTP trigger for Azure Logic Apps](../connectors/connectors-native-http.md#add-an-http-trigger).
115
94
116
-
We recommend you to use web hooks because they're extensively supported by various apps like Azure Logic Apps and Slack. Webhooks allow you to implement your own way for sending notifications. As an example, this article walks you through how to configure autoshutdown notification to send an email to the VM owner by using Azure Logic Apps. First, let's quickly go through the basic steps to enable autoshutdown notification in your lab.
95
+
We recommend you to use webhooks because they're extensively supported by various apps like Azure Logic Apps and Slack. Webhooks allow you to implement your own way for sending notifications. As an example, this article walks you through how to configure an auto shutdown email notification to the VM owner by using Azure Logic Apps. First, let's quickly go through the basic steps to enable auto shutdown notification in your lab.
117
96
118
-
###Create a logic app that sends email notifications
97
+
## Create a logic app that sends email notifications
119
98
120
-
[Azure Logic Apps](../logic-apps/logic-apps-overview.md) provides many connectors that makes it easy to integrate a service with other clients, like Office 365 and Twitter. At the high level, the steps to set up a Logic App for email notification can be divided into four phases:
99
+
[Azure Logic Apps](../logic-apps/logic-apps-overview.md) provides connectors to integrate a service with other clients, like Office 365 and Twitter. At a high level, setting up a Logic App for email notification can be divided into four phases:
121
100
122
101
- Create a logic app.
123
102
- Configure the built-in template.
@@ -138,6 +117,7 @@ To get started, create a logic app in your Azure subscription by using the follo
0 commit comments