|
| 1 | +--- |
| 2 | +title: How to move a schedule to another region |
| 3 | +description: This article explains how to move schedules to another Azure region. |
| 4 | +ms.topic: how-to |
| 5 | +ms.author: rosemalcolm |
| 6 | +author: RoseHJM |
| 7 | +ms.date: 05/09/2022 |
| 8 | +--- |
| 9 | +# Move schedules to another region |
| 10 | + |
| 11 | +In this article, you'll learn how to move schedules by using an Azure Resource Manager (ARM) template. |
| 12 | + |
| 13 | +DevTest Labs supports two types of schedules. |
| 14 | + |
| 15 | +- Schedules apply only to compute virtual machines (VMs): schedules are stored as microsoft.devtestlab/schedules resources, and often referred to as top level schedules, or simply schedules. |
| 16 | + |
| 17 | +- Lab schedules apply only to DevTest Labs (DTL) VMs: lab schedules. They are stored as microsoft.devtestlab/labs/schedules resources. This type of schedule is not covered in this article. |
| 18 | + |
| 19 | +In this article, you'll learn how to: |
| 20 | +> [!div class="checklist"] |
| 21 | +> > |
| 22 | +> - Export an ARM template that contains your schedules. |
| 23 | +> - Modify the template by adding or updating the target region and other parameters. |
| 24 | +> - Delete the resources in the source region. |
| 25 | +
|
| 26 | +## Prerequisites |
| 27 | + |
| 28 | +- Ensure that the services and features that your account uses are supported in the target region. |
| 29 | +- For preview features, ensure that your subscription is allowlisted for the target region. |
| 30 | +- Ensure a Compute VM exists in the target region. |
| 31 | + |
| 32 | +## Move an existing schedule |
| 33 | +There are two ways to move a schedule: |
| 34 | + |
| 35 | + - 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. |
| 36 | + - Export and redeploy the schedules by using ARM templates. |
| 37 | + |
| 38 | +Use the following steps to export and redeploy your schedule in another Azure region by using an ARM template: |
| 39 | + |
| 40 | +1. Sign in to the [Azure portal](https://portal.azure.com). |
| 41 | + |
| 42 | +2. Go to the source resource group that held your VMs. |
| 43 | + |
| 44 | +3. On the **Resource Group Overview** page, under **Resources**, select **Show hidden types**. |
| 45 | + |
| 46 | +4. Select all resources with the type **microsoft.devtestlab/schedules**. |
| 47 | + |
| 48 | +5. Select **Export template**. |
| 49 | + |
| 50 | + :::image type="content" source="./media/how-to-move-schedule-to-new-region/move-compute-schedule.png" alt-text="Screenshot that shows the hidden resources in a resource group, with schedules selected."::: |
| 51 | + |
| 52 | +6. On the **Export resource group template** page, select **Deploy**. |
| 53 | + |
| 54 | +7. On the **Custom deployment** page, select **Edit template**. |
| 55 | + |
| 56 | +8. In the template code, change all instances of `"location": "<old location>"` to `"location": "<new location>"` and then select **Save**. |
| 57 | + |
| 58 | +9. On the **Custom deployment** page, enter values that match the target VM: |
| 59 | + |
| 60 | + |Name|Value| |
| 61 | + |----|----| |
| 62 | + |**Subscription**|Select an Azure subscription.| |
| 63 | + |**Resource group**|Select the resource group name. | |
| 64 | + |**Region**|Select a location for the lab schedule. For example, **Central US**. | |
| 65 | + |**Schedule Name**|Must be a globally unique name. | |
| 66 | + |**VirtualMachine_xxx_externalId**|Must be the target VM. | |
| 67 | + |
| 68 | + :::image type="content" source="./media/how-to-move-schedule-to-new-region/move-schedule-custom-deployment.png" alt-text="Screenshot that shows the custom deployment page, with new location values for the relevant settings."::: |
| 69 | + |
| 70 | + >[!IMPORTANT] |
| 71 | + >Each schedule must have a globally unique name; you will need to change the schedule name for the new location. |
| 72 | +
|
| 73 | +10. Select **Review and create** to create the deployment. |
| 74 | + |
| 75 | +11. When the deployment is complete, verify that the new schedule is configured correctly on the new VM. |
| 76 | + |
| 77 | +## Discard or clean up |
| 78 | + |
| 79 | +Now you can 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. |
| 80 | + |
| 81 | +## Next steps |
| 82 | + |
| 83 | +In this article, you moved a schedule 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: |
| 84 | + |
| 85 | +- [Move a DevTest Labs to another region](./how-to-move-labs.md). |
| 86 | +- [Move resources to a new resource group or subscription](../azure-resource-manager/management/move-resource-group-and-subscription.md). |
| 87 | +- [Move Azure VMs to another region](../site-recovery/azure-to-azure-tutorial-migrate.md). |
0 commit comments