Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 1dede64

Browse files
committedMar 28, 2022
some more changes
1 parent 8635121 commit 1dede64

7 files changed

+35
-41
lines changed
 

‎articles/devtest-labs/devtest-lab-attach-detach-data-disk.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ms.date: 03/28/2022
77

88
# Attach or detach a virtual machine data disk in Azure DevTest Labs
99

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.
1111

1212
## Prerequisites
1313

@@ -25,7 +25,7 @@ Follow these steps to create and attach a new managed data disk for a DevTest La
2525

2626
:::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.":::
2727

28-
1. On the **Attach new disk** form:
28+
1. Fill out the **Attach new disk** form as follows:
2929

3030
- For **Name**, enter a unique name.
3131
- For **Disk type**, select a [disk type](/azure/virtual-machines/disks-types) from the drop-down list.

‎articles/devtest-labs/devtest-lab-auto-startup-vm.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ ms.date: 03/28/2022
77

88
# Start up DevTest Labs virtual machines automatically
99

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.
1111

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.
1313

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).
1515

1616
## Configure lab auto-start settings
1717

‎articles/devtest-labs/use-command-line-start-stop-virtual-machines.md

Lines changed: 30 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -9,31 +9,27 @@ ms.devlang: azurecli
99

1010
# Use command lines to start and stop DevTest Labs virtual machines
1111

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.
1313

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.
1515

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:
1717

1818
- 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.
2020
- 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).
2121

2222
## Prerequisites
2323

2424
- A lab VM in DevTest Labs.
25-
2625
- 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.
2927

3028
## Azure PowerShell script
3129

3230
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.
3331

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.
3733

3834
```powershell
3935
# 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
4339
Connect-AzAccount
4440
}
4541
46-
# If you have multiple subscriptions, set the one to use
4742
# Set-AzContext -SubscriptionId "<Subscription ID>"
4843
```
4944
@@ -73,7 +68,7 @@ The following PowerShell script starts or stops a VM in a lab by using [Invoke-A
7368
Write-Output "##[section] Successfully updated DTL machine: $vMToStart, Action: $vmAction"
7469
}
7570
else {
76-
Write-Error "##[error]Failed to update DTL machine: $vMToStart, Action: $vmAction"
71+
Write-Error "##[error] Failed to update DTL machine: $vMToStart, Action: $vmAction"
7772
}
7873
```
7974
@@ -83,42 +78,41 @@ The following script provides [Azure CLI](/cli/azure/get-started-with-azure-cli)
8378
8479
1. Provide appropriate values for `<Subscription ID>`, `<lab name>`, `<VM name>`, and the `<Start or Stop>` action to take.
8580
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+
```
9487

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.
9689

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+
```
9895

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.
10497

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+
```
107101

108102
1. Replace `<resourceGroup>` with the value you got from the previous step.
109103

110-
```azurecli
111-
set RESOURCEGROUP=<resourceGroup>
112-
```
104+
```azurecli
105+
set RESOURCEGROUP=<resourceGroup>
106+
```
113107

114108
1. Run the command line to start or stop the VM, based on the value you passed to `ACTION`.
115109

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%
112+
```
119113

120114
## Next steps
121115

122116
- [Azure CLI az lab reference](/cli/azure/lab)
123117
- [PowerShell Az.DevTestLabs reference](/powershell/module/az.devtestlabs)
124-
- [Define the startup order for DevTest Lab VMs](start-machines-use-automation-runbooks.md)
118+
- [Define the startup order for DevTest Labs VMs](start-machines-use-automation-runbooks.md)

0 commit comments

Comments
 (0)
Please sign in to comment.