Skip to content

Commit 46df0e6

Browse files
Merge pull request #249588 from RoseHJM/dtl-cruft-regions
DTL - reduce number of articles
2 parents 5b5878b + 0e5e364 commit 46df0e6

File tree

7 files changed

+90
-109
lines changed

7 files changed

+90
-109
lines changed

.openpublishing.redirection.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23387,6 +23387,11 @@
2338723387
"redirect_url": "/azure/devtest-labs/samples-cli",
2338823388
"redirect_document_id": false
2338923389
},
23390+
{
23391+
"source_path_from_root": "/articles/devtest-labs/how-to-move-schedule-to-new-region.md",
23392+
"redirect_url": "/azure/devtest-labs/how-to-move-labs",
23393+
"redirect_document_id": false
23394+
},
2339023395
{
2339123396
"source_path_from_root": "/articles/azure/virtual-desktop/azure-advisor.md",
2339223397
"redirect_url": "/azure/advisor/advisor-overview",

articles/devtest-labs/TOC.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,6 @@
263263
href: create-alerts.md
264264
- name: Move to new region
265265
href: how-to-move-labs.md
266-
- name: Move schedules to another region
267-
href: how-to-move-schedule-to-new-region.md
268266
- name: Reference
269267
items:
270268
- name: CLI

articles/devtest-labs/how-to-move-labs.md

Lines changed: 85 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ ms.topic: how-to
55
ms.custom: devx-track-azurepowershell, UpdateFrequency2
66
ms.author: rosemalcolm
77
author: RoseHJM
8-
ms.date: 03/03/2022
8+
ms.date: 08/28/2023
99
---
1010

11-
# Move DevTest Labs to another region
11+
# Move DevTest Labs and schedules to another region
1212

13-
To move a lab, create a copy of an existing lab in another region.
13+
You can move DevTest Labs and their associated schedules to another reason. To move a lab, create a copy of an existing lab in another region. When you've moved your lab, and you have a virtual machine (VM) in the target region, you can move your lab schedules.
1414

1515
In this article, you learn how to:
1616
> [!div class="checklist"]
@@ -20,6 +20,7 @@ In this article, you learn how to:
2020
> - Deploy the template to create the new lab in the target region.
2121
> - Configure the new lab.
2222
> - Move data to the new lab.
23+
> - Move schedules to the new lab.
2324
> - Delete the resources in the source region.
2425
2526
## Prerequisites
@@ -34,23 +35,41 @@ In this article, you learn how to:
3435
- the Stored Secrets
3536
- PAT tokens of the private Artifact Repos to move the private repos together with the lab.
3637

37-
## Prepare to move
38+
- When moving a lab schedule, ensure a Compute VM exists in the target region.
3839

39-
To get started, export and modify a Resource Manager template.
40+
## Move a lab
41+
42+
The following section describes how to create and customize an ARM template to move a lab from one region to another.
43+
44+
You can move a schedule without moving a lab, if you have a VM in the target region. If you want to move a schedule without moving a lab, see [Move a schedule](#move-a-schedule).
45+
46+
### Prepare to move a lab
4047

41-
### Prepare your Virtual Network
48+
When you move a lab, there are some steps you must take to prepare for the move. You need to:
49+
50+
- Prepare the virtual network
51+
- Export an ARM template of the lab
52+
- Modify the template
53+
- Deploy the template to move the lab
54+
- Configure the new lab
55+
- Swap the OS disks of the Compute VMs under the new VMs
56+
- Clean up the original lab
57+
58+
#### Prepare the Virtual Network
59+
60+
To get started, export and modify a Resource Manager template.
4261

4362
1. Sign in to the [Azure portal](https://portal.azure.com).
4463

4564
1. If you don't have [Resource Group](../azure-resource-manager/management/manage-resource-groups-portal.md#create-resource-groups) under the target region, create one now.
4665

47-
1. Move your current Virtual Network to the new region and resource group using the steps included in the article, "[Move an Azure virtual network to another region](../virtual-network/move-across-regions-vnet-portal.md)".
66+
1. Move the current Virtual Network to the new region and resource group using the steps included in the article, "[Move an Azure virtual network to another region](../virtual-network/move-across-regions-vnet-portal.md)".
4867

4968
Alternately, you can create a new virtual network, if you don't have to keep the original one.
5069

51-
### Export an ARM template of your lab.
70+
#### Export an ARM template of the lab
5271

53-
Next, you export a JSON template contains settings that describe your lab.
72+
Next, you export a JSON template contains settings that describe the lab.
5473

5574
To export a template by using Azure portal:
5675

@@ -64,7 +83,7 @@ To export a template by using Azure portal:
6483

6584
This zip file contains the .json files that comprise the template and scripts to deploy the template. It contains all the resources under your lab listed in ARM template format, except for the Shared Image Gallery resources.
6685

67-
### Modify the template
86+
#### Modify the template
6887

6988
In order for the ARM template to deploy correctly in the new region, you must change a few parts of the template.
7089

@@ -75,8 +94,8 @@ To update the template by using Azure portal:
7594
1. In **Search the Marketplace**, type **template deployment**, and then press **ENTER**.
7695

7796
1. Select **Template deployment**.
78-
79-
![Azure Resource Manager templates library](../storage/common/media/storage-account-move/azure-resource-manager-template-library.png)
97+
98+
:::image type="content" source="./media/how-to-move-labs/azure-resource-manager-template-library.png" alt-text="Screenshot that shows the Azure Marketplace with template deployment selected.":::
8099

81100
1. Select **Create**.
82101

@@ -123,7 +142,7 @@ To update the template by using Azure portal:
123142
}
124143
```
125144

126-
1. Find the `"type": "microsoft.devtestlab/labs/virtualnetworks"` resource. If you created a new virtual network earlier in these steps, you must add the actual subnet name in `/subnets/[SUBNET_NAME]`. If you chose to move the Vnet to a new region, you should skip this step.
145+
1. Find the `"type": "microsoft.devtestlab/labs/virtualnetworks"` resource. If you created a new virtual network earlier in these steps, you must add the actual subnet name in `/subnets/[SUBNET_NAME]`. If you chose to move the virtual network to a new region, you should skip this step.
127146

128147
1. Find the `"type": "microsoft.devtestlab/labs/virtualmachines"` resource.
129148

@@ -180,7 +199,7 @@ To update the template by using Azure portal:
180199

181200
1. In the editor, save the template.
182201

183-
## Deploy to move
202+
### Deploy the template to move the lab
184203

185204
Deploy the template to create a new lab in the target region.
186205

@@ -203,14 +222,14 @@ Deploy the template to create a new lab in the target region.
203222

204223
1. Select the bell icon (notifications) from the top of the screen to see the deployment status. You shall see **Deployment in progress**. Wait until the deployment is completed.
205224

206-
### Configure the new lab
225+
#### Configure the new lab
207226

208227
While most Lab resources have been replicated under the new region using the ARM template, a few edits still need to be moved manually.
209228

210229
1. Add the Compute Gallery back to the lab if there are any in the original one.
211230
1. Add the policies "Virtual machines per user", "Virtual machines per lab" and "Allowed Virtual machine sizes" back to the moved lab
212231

213-
### Swap the OS disks of the Compute VMs under the new VMs.
232+
#### Swap the OS disks of the Compute VMs under the new VMs
214233

215234
Note the VMs under the new Lab have the same specs as the ones under the old Lab. The only difference is their OS Disks.
216235

@@ -247,9 +266,55 @@ Note the VMs under the new Lab have the same specs as the ones under the old Lab
247266

248267
1. Swap the OS disk of the Compute VM under the new lab with the new disk. To learn how, see the article, "[Change the OS disk used by an Azure VM using PowerShell](../virtual-machines/windows/os-disk-swap.md)".
249268

269+
## Move a schedule
270+
271+
There are two ways to move a schedule:
272+
273+
- Manually recreate the schedules on the moved VMs. This process can be time consuming and error prone. This approach is most useful when you have a few schedules and VMs.
274+
- Export and redeploy the schedules by using ARM templates.
275+
276+
Use the following steps to export and redeploy your schedule in another Azure region by using an ARM template:
277+
278+
1. Sign in to the [Azure portal](https://portal.azure.com).
279+
280+
2. Go to the source resource group that held your VMs.
281+
282+
3. On the **Resource Group Overview** page, under **Resources**, select **Show hidden types**.
283+
284+
4. Select all resources with the type **microsoft.devtestlab/schedules**.
285+
286+
5. Select **Export template**.
287+
288+
:::image type="content" source="./media/how-to-move-labs/move-compute-schedule.png" alt-text="Screenshot that shows the hidden resources in a resource group, with schedules selected.":::
289+
290+
6. On the **Export resource group template** page, select **Deploy**.
291+
292+
7. On the **Custom deployment** page, select **Edit template**.
293+
294+
8. In the template code, change all instances of `"location": "<old location>"` to `"location": "<new location>"` and then select **Save**.
295+
296+
9. On the **Custom deployment** page, enter values that match the target VM:
297+
298+
|Name|Value|
299+
|----|----|
300+
|**Subscription**|Select an Azure subscription.|
301+
|**Resource group**|Select the resource group name. |
302+
|**Region**|Select a location for the lab schedule. For example, **Central US**. |
303+
|**Schedule Name**|Must be a globally unique name. |
304+
|**VirtualMachine_xxx_externalId**|Must be the target VM. |
305+
306+
:::image type="content" source="./media/how-to-move-labs/move-schedule-custom-deployment.png" alt-text="Screenshot that shows the custom deployment page, with new location values for the relevant settings.":::
307+
308+
>[!IMPORTANT]
309+
>Each schedule must have a globally unique name; you will need to change the schedule name for the new location.
310+
311+
10. Select **Review and create** to create the deployment.
312+
313+
11. When the deployment is complete, verify that the new schedule is configured correctly on the new VM.
314+
250315
## Discard or clean up
251316

252-
After the deployment, if you want to start over, you can delete the target lab, and repeat the steps described in the [Prepare](#prepare-to-move) and [Move](#deploy-to-move) sections of this article.
317+
After the deployment, if you want to start over, you can delete the target lab, and repeat the steps described in the [Prepare](#prepare-to-move-a-lab) and [Move](#deploy-the-template-to-move-the-lab) sections of this article.
253318

254319
To commit the changes and complete the move, you must delete the original lab.
255320

@@ -261,10 +326,11 @@ To remove a lab by using the Azure portal:
261326

262327
1. Select **Delete**, and confirm.
263328

329+
You can also choose to clean up the original schedules if they're no longer used. Go to the original schedule resource group (where you exported templates from in step 5 above) and delete the schedule resource.
330+
264331
## Next steps
265332

266333
In this article, you moved DevTest Labs from one region to another and cleaned up the source resources. To learn more about moving resources between regions and disaster recovery in Azure, refer to:
267334

268335
- [Move resources to a new resource group or subscription](../azure-resource-manager/management/move-resource-group-and-subscription.md)
269-
- [Move Azure VMs to another region](../site-recovery/azure-to-azure-tutorial-migrate.md)
270-
- [Move Microsoft.DevtestLab/schedules to another region](./how-to-move-schedule-to-new-region.md)
336+
- [Move Azure VMs to another region](../site-recovery/azure-to-azure-tutorial-migrate.md)

articles/devtest-labs/how-to-move-schedule-to-new-region.md

Lines changed: 0 additions & 88 deletions
This file was deleted.
33.8 KB
Loading

0 commit comments

Comments
 (0)