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-attach-detach-data-disk.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ ms.date: 03/28/2022
7
7
8
8
# Attach or detach a virtual machine data disk in Azure DevTest Labs
9
9
10
-
This article explains how to attach and detach a lab virtual machine (VM) data disk in Azure DevTest Labs. You can create, attach, detach, and reattach [data disks](/azure/virtual-machines/managed-disks-overview) for lab VMs that you own. This functionality is handy for managing storage or software separately from individual VMs.
10
+
This article explains how to attach and detach a lab virtual machine (VM) data disk in Azure DevTest Labs. You can create, attach, detach, and reattach [data disks](/azure/virtual-machines/managed-disks-overview) for lab VMs that you own. This functionality is useful for managing storage or software separately from individual VMs.
11
11
12
12
## Prerequisites
13
13
@@ -25,7 +25,7 @@ Follow these steps to create and attach a new managed data disk for a DevTest La
25
25
26
26
:::image type="content" source="./media/devtest-lab-attach-detach-data-disk/devtest-lab-attach-new.png" alt-text="Screenshot of Attach new on the V M's Disk page.":::
27
27
28
-
1.On the **Attach new disk** form:
28
+
1.Fill out the **Attach new disk** form as follows:
29
29
30
30
- For **Name**, enter a unique name.
31
31
- For **Disk type**, select a [disk type](/azure/virtual-machines/disks-types) from the drop-down list.
Copy file name to clipboardExpand all lines: articles/devtest-labs/devtest-lab-auto-startup-vm.md
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -7,11 +7,11 @@ ms.date: 03/28/2022
7
7
8
8
# Start up DevTest Labs virtual machines automatically
9
9
10
-
This article shows how to configure and apply an auto-start policy for Azure DevTest Labs virtual machines (VMs). Auto start automatically starts up lab VMs at a specified time of day.
10
+
This article shows how to configure and apply an auto-start policy for Azure DevTest Labs virtual machines (VMs). Auto start automatically starts up lab VMs at specified times and days.
11
11
12
-
To implement auto start, you first configure an auto-start policy for the lab, then enable the policy for individual lab VMs. Requiring individual VMs to enable auto start helps prevent unintentional startups that could increase costs.
12
+
To implement auto start, you configure an auto-start policy for the lab first. Then, you can enable the policy for individual lab VMs. Requiring individual VMs to enable auto start helps prevent unnecessary startups that could increase costs.
13
13
14
-
You can also configure auto-shutdown policies for lab VMs. For more information, see [Manage auto shutdown policies for a lab in Azure DevTest Labs](devtest-lab-auto-shutdown.md).
14
+
You can also configure auto-shutdown policies for lab VMs. For more information, see [Manage auto shutdown policies for a lab in Azure DevTest Labs](devtest-lab-auto-shutdown.md).
Copy file name to clipboardExpand all lines: articles/devtest-labs/use-command-line-start-stop-virtual-machines.md
+30-36Lines changed: 30 additions & 36 deletions
Original file line number
Diff line number
Diff line change
@@ -9,31 +9,27 @@ ms.devlang: azurecli
9
9
10
10
# Use command lines to start and stop DevTest Labs virtual machines
11
11
12
-
This article shows you how to start or stop Azure DevTest Labs virtual machines (VMs) by using Azure PowerShell or Azure CLI command lines and scripts.
12
+
This article shows how to start or stop Azure DevTest Labs virtual machines (VMs) by using Azure PowerShell or Azure CLI command lines and scripts.
13
13
14
-
In the Azure portal, you can start, stop, or [restart](devtest-lab-restart-vm.md) DevTest Labs VMs. You can configure [automatic startup](devtest-lab-auto-startup-vm.md) and [automatic shutdown](devtest-lab-auto-shutdown.md) schedules and policies for lab VMs.
14
+
You can use the Azure portal to start, stop, or [restart](devtest-lab-restart-vm.md) DevTest Labs VMs. You can configure [automatic startup](devtest-lab-auto-startup-vm.md) and [automatic shutdown](devtest-lab-auto-shutdown.md) schedules and policies for lab VMs.
15
15
16
-
You can also use Azure PowerShell or Azure CLI commands and scripts to automate lab VM startup and shutdown. For example, use scripted command lines to start or stop VMs when you want to:
16
+
Use PowerShell or Azure CLI commands when you want to script or automate lab VM start and stop. For example, you can:
17
17
18
18
- Test a three-tier application, where the tiers need to start in a sequence.
19
-
- Turn off VMs when they meet custom criteria, to save costs.
19
+
- Turn off VMs to save costs when they meet custom criteria.
20
20
- Start when a continuous integration and continuous delivery (CI/CD) workflow begins, and stop when it finishes. For an example, see [Run an image factory from Azure DevOps](image-factory-set-up-devops-lab.md).
21
21
22
22
## Prerequisites
23
23
24
24
- A lab VM in DevTest Labs.
25
-
26
25
- For Azure PowerShell, the [Az module](/powershell/azure/new-azureps-module-az) installed on your workstation. Make sure you have the latest version. If necessary, run `Update-Module -Name Az` to update the module.
27
-
28
-
- For Azure CLI, [Azure CLI installed](/cli/azure/install-azure-cli) on your workstation.
26
+
- For Azure CLI, [Azure CLI ](/cli/azure/install-azure-cli) installed on your workstation.
29
27
30
28
## Azure PowerShell script
31
29
32
30
The following PowerShell script starts or stops a VM in a lab by using [Invoke-AzResourceAction](/powershell/module/az.resources/invoke-azresourceaction). The `ResourceId` parameter is the fully qualified ID for the lab VM you want to start or stop. The `Action` parameter determines whether to start or stop the VM, depending on which action you need.
33
31
34
-
1. From your workstation, use the PowerShell [Connect-AzAccount](/powershell/module/Az.Accounts/Connect-AzAccount) cmdlet to sign in to your Azure account. Follow the on-screen instructions.
35
-
36
-
If you have multiple Azure subscriptions, uncomment the `Set-AzContext` line and fill in the `<Subscription ID>` you want to use.
32
+
1. From your workstation, use the PowerShell [Connect-AzAccount](/powershell/module/Az.Accounts/Connect-AzAccount) cmdlet to sign in to your Azure account. If you have multiple Azure subscriptions, uncomment the `Set-AzContext` line and fill in the `<Subscription ID>` you want to use.
37
33
38
34
```powershell
39
35
# Sign in to your Azure subscription
@@ -43,7 +39,6 @@ The following PowerShell script starts or stops a VM in a lab by using [Invoke-A
43
39
Connect-AzAccount
44
40
}
45
41
46
-
# If you have multiple subscriptions, set the one to use
Write-Error "##[error]Failed to update DTL machine: $vMToStart, Action: $vmAction"
71
+
Write-Error "##[error]Failed to update DTL machine: $vMToStart, Action: $vmAction"
77
72
}
78
73
```
79
74
@@ -83,42 +78,41 @@ The following script provides [Azure CLI](/cli/azure/get-started-with-azure-cli)
83
78
84
79
1. Provide appropriate values for `<Subscription ID>`, `<lab name>`, `<VM name>`, and the `<Start or Stop>` action to take.
85
80
86
-
```azurecli
87
-
set SUBSCIPTIONID=<Subscription ID>
88
-
set DEVTESTLABNAME=<lab name>
89
-
set VMNAME=<VM name>
90
-
91
-
REM The action on the virtual machine (Start or Stop)
92
-
set ACTION=<Start or Stop>
93
-
```
81
+
```azurecli
82
+
set SUBSCIPTIONID=<Subscription ID>
83
+
set DEVTESTLABNAME=<lab name>
84
+
set VMNAME=<VM name>
85
+
set ACTION=<Start or Stop>
86
+
```
94
87
95
-
1. Sign in to your Azure subscription, and get the name of the resource group that contains the lab.
88
+
1. Sign in to your Azure account. If you have multiple Azure subscriptions, uncomment the `az account set` line to use the subscription ID you provided.
96
89
97
-
If you have multiple Azure subscriptions, uncomment the `az account set` line to use the subscription ID you provided.
90
+
```azurecli
91
+
az login
92
+
93
+
REM az account set --subscription %SUBSCIPTIONID%
94
+
```
98
95
99
-
```azurecli
100
-
az login
101
-
102
-
REM If you have multiple subscriptions, set the one to use
103
-
REM az account set --subscription %SUBSCIPTIONID%
96
+
1. Get the name of the resource group that contains the lab.
104
97
105
-
az resource list --resource-type "Microsoft.DevTestLab/labs" --name %DEVTESTLABNAME% --query "[0].resourceGroup"
106
-
```
98
+
```azurecli
99
+
az resource list --resource-type "Microsoft.DevTestLab/labs" --name %DEVTESTLABNAME% --query "[0].resourceGroup"
100
+
```
107
101
108
102
1. Replace `<resourceGroup>` with the value you got from the previous step.
109
103
110
-
```azurecli
111
-
set RESOURCEGROUP=<resourceGroup>
112
-
```
104
+
```azurecli
105
+
set RESOURCEGROUP=<resourceGroup>
106
+
```
113
107
114
108
1. Run the command line to start or stop the VM, based on the value you passed to `ACTION`.
115
109
116
-
```azurecli
117
-
az lab vm %ACTION% --lab-name %DEVTESTLABNAME% --name %VMNAME% --resource-group %RESOURCEGROUP%
118
-
```
110
+
```azurecli
111
+
az lab vm %ACTION% --lab-name %DEVTESTLABNAME% --name %VMNAME% --resource-group %RESOURCEGROUP%
0 commit comments