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
+36-32Lines changed: 36 additions & 32 deletions
Original file line number
Diff line number
Diff line change
@@ -1,32 +1,32 @@
1
1
---
2
2
title: Manage autoshutdown in Azure DevTest Labs and virtual machines
3
-
description: Learn how to set autoshutdown policies for Azure DevTest Labs or for individual virtual machines (VMs) to shut down the VMs at a specific time.
3
+
description: Learn how to set autoshutdown policies for Azure DevTest Labs or for individual virtual machines (VMs) to shut down the VMs at a specific time daily.
4
4
ms.topic: how-to
5
5
ms.date: 11/01/2021
6
6
---
7
7
8
-
# Configure autoshutdown for DevTest Labs labs and VMs
8
+
# Configure autoshutdown for labs and VMs in DevTest Labs
9
9
10
-
As an Azure DevTest Labs lab owner, you can configure a shutdown schedule for all the virtual machines (VMs) in your lab. You save costs of running machines that aren't being used.
10
+
As an Azure DevTest Labs lab owner, you can configure a schedule to shut down all the virtual machines (VMs) in your lab at a specific time of day or night. You save the cost of running machines that aren't being used.
11
11
12
-
You can also set a central autoshutdown policy on all your lab VMs so lab users don't have to schedule autoshutdown for their individual machines. Autoshutdown policies range from allowing lab users to fully control their VM's shutdown schedules to allowing them no control over shutdown.
12
+
You can also set a central autoshutdown policy to control whether lab users can schedule autoshutdown for their own individual VMs. Autoshutdown policies range from allowing VM owners to fully control their VM's shutdown schedules to allowing them no control over the schedules.
13
13
14
-
This article explains how to configure autoshutdown for DevTest Labs labs and for individual VMs. The article also describes how to set autoshutdown policies, and how to configure autoshutdown notifications.
14
+
This article explains how to set autoshutdown schedules for DevTest Labs labs and for individual lab VMs. The article also describes how to set lab autoshutdown policy, and how to configure autoshutdown notifications.
15
15
16
16
## Configure lab autoshutdown schedule
17
17
18
-
Autoshutdown helps minimize lab waste by shutting down a lab's VMs at a specific time daily. To view or change a lab's autoshutdown schedule, follow these steps:
18
+
Autoshutdown helps minimize lab waste by shutting down all of a lab's VMs at a specific time of day or night. To view or change a lab's autoshutdown schedule, follow these steps:
19
19
20
20
1. On the home page for your lab, select **Configuration and policies**.
21
21
1. In the **Schedules** section of the left menu, select **Auto-shutdown**.
22
-
1.Select**On** to enable autoshutdown, or **Off** to disable it.
23
-
1.If you turned on autoshutdown, specify the time and time zone to shut down all VMs in the lab.
24
-
1.Select**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 addresses where you want the notification to post or be sent. For more information and instructions, see the [Autoshutdown notifications](#autoshutdown-notifications) section.
22
+
1.On the **Auto-shutdown** screen, for **Enabled**, select**On** to enable autoshutdown, or **Off** to disable it.
23
+
1.For **Scheduled shutdown** and **Time zone**, if you turned on autoshutdown, specify the time and time zone to shut down all lab VMs.
24
+
1.For**Send notification before auto-shutdown?**, select **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 under **Webhook URL**or semicolon-separated email addresses under **Email address**where you want the notification to post or be sent. For more information, see the [Autoshutdown notifications](#autoshutdown-notifications) section.
25
25
1. Select **Save**.
26
26
27
-

27
+

28
28
29
-
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.
29
+
By default, this schedule applies to all VMs in the lab. To remove this setting from a specific VM, if allowed by policy, open the VM's management pane and change its **Auto-shutdown** setting.
30
30
31
31
> [!NOTE]
32
32
> If you update the autoshutdown schedule for your lab or a VM within 30 minutes of the previously scheduled shutdown time, the new shutdown time takes effect the next day.
@@ -46,59 +46,61 @@ As a lab owner, you can control cost and minimize waste in your labs by managing
46
46
47
47

48
48
49
-
-**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 their VMs' autoshutdown schedules. Lab users can set their VMs' autoshutdown schedule.
49
+
-**User sets a schedule and can opt out**: Lab users can override or opt out of the lab schedule. This option grants VM owners full control to set their VMs' autoshutdown schedules.
50
50
51
-
-**User sets a schedule and cannot opt out**: Lab users can override the lab schedule, but they can't opt out of the autoshutdown policy. This option ensures that every lab VM is under an autoshutdown schedule. Lab users can update the schedules, and set up shutdown notifications.
51
+
-**User sets a schedule and cannot opt out**: Lab users can override the lab schedule, but they can't opt out of the autoshutdown policy. This option ensures that every lab VM is under an autoshutdown schedule. VM owners can update the schedule time, and set up shutdown notifications.
52
52
53
-
-**User has no control over the schedule set by lab administrator**: Lab users can't alter or opt out of the lab autoshutdown schedule. This option gives the lab administrator complete control of the schedule for all lab VMs. Lab users can still set up autoshutdown notifications for their VMs.
53
+
-**User has no control over the schedule set by lab administrator**: Lab users can't alter or opt out of the lab autoshutdown schedule. This option gives the lab administrator complete control of the schedule for all lab VMs. VM owners can still set up autoshutdown notifications for their VMs.
54
54
55
55
1. Select **Save**.
56
56
57
57
## Configure VM autoshutdown settings
58
58
59
-
Depending on the autoshutdown policy, you can also set an autoshutdown schedule for an individual VM.
59
+
Depending on the autoshutdown policy, you can also set an autoshutdown schedule for individual lab VMs.
60
60
61
61
1. On the home page for the VM, in the **Operations** section on the left menu, select **Auto-shutdown**.
62
-
1. On the **Auto-shutdown**page, select **On** to enable autoshutdown, or **Off** to disable it.
63
-
1.If you turned on autoshutdown, specify the time and time zone to shut down the VM.
64
-
1.Select**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 addresses where you want the notification to post or be sent. For more information and instructions, see the [Autoshutdown notifications](#autoshutdown-notifications) section.
62
+
1. On the **Auto-shutdown**screen, for **Enabled**, select **On** to enable autoshutdown, or **Off** to disable it.
63
+
1.For **Scheduled shutdown** and **Time zone**, if you turned on autoshutdown, specify the time and time zone to shut down all lab VMs.
64
+
1.For**Send notification before auto-shutdown?**, select **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 under **Webhook URL**or semicolon-separated email addresses under **Email address**where you want the notification to post or be sent. For more information, see the [Autoshutdown notifications](#autoshutdown-notifications) section.
65
65
1. Select **Save**.
66
66
67
-

67
+

68
68
69
69
### View activity logs for autoshutdown updates
70
70
71
71
After you update autoshutdown settings, you can see the activity logged in the activity log for the VM.
72
72
73
73
1. On the home page for the VM, select **Activity log** from the left menu.
74
-
1. Remove the **Resource** filter, apply the appropriate **Resource group** filter, and view the entries for **Add or modify policies** or **Add or modify schedules**.
74
+
1. Remove the **Resource** filter, apply the appropriate **Resource group** filter, and view the entries for **Add or modify schedules**.
75
75
76
76

77
77
78
-
1. Select the **Add or modify schedules** operation to open a summary page showing more details about the operation.
78
+
1. Select the **Add or modify schedules** operation to open a summary page that shows more details about the operation.
79
79
80
80
## Autoshutdown notifications
81
81
82
-
When you enable notifications in autoshutdown configuration, lab users receive a notification 30 minutes before autoshutdown if any of their VMs will be affected. The notification gives users a chance to save their work before the shutdown. The notification also provides links that allow the following actions for each VM if someone needs to keep working:
82
+
When you enable notifications in autoshutdown configuration, lab users receive a notification 30 minutes before autoshutdown if any of their VMs will be affected. The notification gives users a chance to save their work before the shutdown. If the autoshutdown settings specify an email address, the notification sends to that email address. If the settings specify a webhook, the notification sends to the webhook URL.
83
+
84
+
The notification can also provide links that allow the following actions for each VM if someone needs to keep working:
83
85
84
86
- Skip the autoshutdown this time
85
87
- Snooze the autoshutdown for an hour
86
88
- Snooze the autoshutdown for 2 hours
87
89
88
-
If the autoshutdown settings specify an email address, the notification sends to that email address. If the settings specify a webhook, the notification sends to the webhook URL.
90
+
You can use webhooks to implement your own way of sending notifications. You set up integrations that subscribe to certain events. When one of those events happens, an HTTP POST payload sends to the webhook's URL.
89
91
90
-
Webhooks are extensively supported by apps like Azure Logic Apps and Slack. With webhooks, you can implement your own way of sending notifications. You set up integrations that subscribe to certain events. When one of those events happens, DevTest Labs sends an HTTP POST payload to the webhook's URL. For more information about responding to webhooks, see [Azure Functions HTTP triggers and bindings overview](../azure-functions/functions-bindings-http-webhook.md)or [add an HTTP trigger for Azure Logic Apps](../connectors/connectors-native-http.md#add-an-http-trigger).
92
+
Apps like [Azure Logic Apps](../logic-apps/logic-apps-overview.md) and Slack have extensive support for webhooks. For more information about responding to webhooks, see [Azure Functions HTTP triggers and bindings overview](../azure-functions/functions-bindings-http-webhook.md)and [Add an HTTP trigger for Azure Logic Apps](../connectors/connectors-native-http.md#add-an-http-trigger).
91
93
92
-
The following example shows you how to use Logic Apps to configure an autoshutdown notification that sends an email to the VM owner.
94
+
The following example shows you how to use Logic Apps to configure an autoshutdown notification that sends an email to VM owners.
93
95
94
96
### Create a logic app that sends email notifications
95
97
96
-
[Logic Apps](../logic-apps/logic-apps-overview.md) provides many connectors that make it easy to integrate a service with other clients, like Office 365 and Twitter. At a high level, the steps to set up a Logic App for email notification are:
98
+
Logic Apps provides many connectors that make it easy to integrate a service with other clients, like Office 365 and Twitter. At a high level, the steps to set up a Logic App for email notification are:
97
99
98
100
1. Create a logic app.
99
101
1. Configure the built-in template.
100
102
1. Integrate with your email client.
101
-
1. Get the Webhook URL to use in the autoshutdown notification settings.
103
+
1. Get the Webhook URL to use in autoshutdown notification settings.
102
104
103
105
To get started, create a logic app in Azure with the following steps:
104
106
@@ -133,7 +135,9 @@ Next, configure the built-in template.
133
135
134
136

135
137
136
-
1. Paste the following JSON code into the **Request Body JSON Schema** section:
138
+
1. Paste the following JSON code into the **Request Body JSON Schema** section.
139
+
140
+

137
141
138
142
```json
139
143
{
@@ -198,25 +202,25 @@ Next, configure the built-in template.
198
202
}
199
203
```
200
204
201
-

202
-
203
205
Now, integrate with your email client.
204
206
205
207
1. In the designer, select **New step**.
206
208
209
+

210
+
207
211
1. Enter *Office 365 Outlook - Send an email* in the Search field, and then select **Send an email (V2)** from **Actions**.
208
212
209
213

210
214
211
215
1. In the **Send an email (V2)** form, fill in the **To**, **Subject**, and **Body** fields.
212
216
213
-
Select **Dynamic content** to automatically populate the notification with values that are used in the app and connectors. For example, for **To**, select **owner**. Populate **Subject** with **vmName** and **labName**. Add **skipUrl** and **delayUrl**s to the message body.
217
+
Select **Add dynamic content** to automatically populate the notification with values that the app and connectors use. For example, for **To**, select **owner**. Populate **Subject** with **vmName** and **labName**. Add content like **skipUrl** and **delayUrl**s to the message body.
214
218
215
219

216
220
217
221
1. Select **Save** on the toolbar.
218
222
219
-
Now you can copy the webhook URL. Select the **When a HTTP request is received** step, and then select the copy button next to **HTTP POST URL** to copy the URL to the clipboard. Paste this webhook URL into the autoshutdown notification settings.
223
+
Now you can copy the webhook URL. Select the **When a HTTP request is received** step, and then select the copy button to copy the HTTP POST URL to the clipboard. Paste this webhook URL into the autoshutdown notification settings.
220
224
221
225

0 commit comments