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-vm-powershell.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: Create a lab virtual machine by using Azure PowerShell
3
3
description: Learn how to use Azure PowerShell to create and manage virtual machines in Azure DevTest Labs.
4
4
ms.topic: how-to
5
-
ms.date: 03/16/2022
5
+
ms.date: 03/17/2022
6
6
ms.custom: devx-track-azurepowershell
7
7
---
8
8
@@ -112,7 +112,7 @@ Save the preceding script in a file named *Create-LabVirtualMachine.ps1*. Run th
112
112
113
113
This section shows how to get the specific properties for the type of VM you want to create. You can get the properties from an Azure Resource Manager (ARM) template in the Azure portal, or by calling the DevTest Labs Azure REST API.
114
114
115
-
### Get VM properties from the Azure portal
115
+
### Use the Azure portal to get VM properties
116
116
117
117
Creating a VM in the Azure portal generates an Azure Resource Manager (ARM) template that shows the VM's properties. Once you choose a VM base, you can see the ARM template and get the properties without actually creating the VM. This method is the easiest way to get the JSON VM description if you don't already have a lab VM of that type.
118
118
@@ -167,7 +167,7 @@ Creating a VM in the Azure portal generates an Azure Resource Manager (ARM) temp
167
167
168
168
169
169
170
-
### Get VM properties by using the DevTest Labs Azure REST API
170
+
### Use the DevTest Labs Azure REST API to get VM properties
171
171
172
172
You can also call the DevTest Labs REST API to get the properties of existing lab VMs. You can use those properties to create more lab VMs of the same types.
Copy file name to clipboardExpand all lines: articles/devtest-labs/start-machines-use-automation-runbooks.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,20 +1,20 @@
1
1
---
2
-
title: Start machines in sequence with an Azure Automation runbook
2
+
title: Define VM start order with Azure Automation
3
3
description: Learn how to start virtual machines in a specific order by using Azure Automation runbooks in Azure DevTest Labs.
4
4
ms.topic: how-to
5
-
ms.date: 03/15/2022
5
+
ms.date: 03/17/2022
6
6
ms.custom: devx-track-azurepowershell
7
7
---
8
8
9
-
# Start DevTest Labs VMs in sequence with an Azure Automation runbook
9
+
# Define the startup order for DevTest Lab VMs with Azure Automation
10
10
11
11
This article explains how to start up DevTest Labs virtual machines (VMs) in a specific order by using a PowerShell runbook in Azure Automation. The PowerShell script uses tags on lab VMs, so you can change the startup order without having to change the script.
12
12
13
13
The DevTest Labs [autostart](devtest-lab-set-lab-policy.md#set-autostart) feature can configure lab VMs to start automatically at a specified time. However, sometimes you might want lab VMs to start in a specific sequence. For example, if a jumpbox VM in a lab is the access point to the other VMs, the jumpbox VM must start before the other VMs.
14
14
15
15
## Prerequisites
16
16
17
-
-Apply the tag **StartupOrder** to all lab VMs with an appropriate startup value, 0 through 10. Designate any machines that don't need starting as -1.
17
+
-[Create and apply a tag](devtest-lab-add-tag.md) called**StartupOrder** to all lab VMs with an appropriate startup value, 0 through 10. Designate any machines that don't need starting as -1.
18
18
19
19
- Create an Azure Automation account by following instructions in [Create a standalone Azure Automation account](/azure/automation/automation-create-standalone-account). Choose the **Run As Accounts** option when you create the account.
20
20
@@ -24,7 +24,7 @@ The DevTest Labs [autostart](devtest-lab-set-lab-policy.md#set-autostart) featur
24
24
1. On the **Runbooks** page, select **Create a runbook**.
25
25
1. Follow the instructions in [Create an Automation PowerShell runbook using managed identity](../automation/learn/powershell-runbook-managed-identity.md) to create a PowerShell runbook. Populate the runbook with the following PowerShell script.
26
26
27
-
###PowerShell script
27
+
##Prepare the PowerShell script
28
28
29
29
The following script takes the subscription name and the lab name as parameters. The script gets all the VMs in the lab and parses their tag information to create a list of VM names and their startup order. The script walks through the list in order and starts the VMs.
30
30
@@ -128,7 +128,7 @@ While ($current -le 10) {
128
128
}
129
129
```
130
130
131
-
## Alternatives
131
+
## Run the PowerShell script
132
132
133
133
- To run this script daily, [create a schedule](../automation/shared-resources/schedules.md#create-a-schedule) in the Automation Account, and [link the schedule to the runbook](../automation/shared-resources/schedules.md#link-a-schedule-to-a-runbook).
0 commit comments