Relocate Azure Virtual Machine Scale Sets to another region
This article covers the recommended approach, guidelines, and practices for relocating Virtual Machine Scale Sets to another region.
Prerequisites
Before you begin, ensure that you have the following prerequisites:
If the source VM supports availability zones, then the target region must also support availability zones. To see which regions support availability zones, see Azure regions with availability zone support.
The subscription in the destination region needs enough quota to create the resources. If you exceeded the quota, request an increase. For more information, see Azure subscription and service limits, quotas, and constraints.
Consolidate all the associated extensions from source Virtual Machine Scale Set, as some need to be reconfigured after relocation.
Confirm if the VM image is a part of VM image gallery. Gallery resources need to be replicated to the target region.
Capture the list of resources that are being configured, such as capturing diagnostic logs. This is important with respect to prioritization and sequencing.
Ensure that the following services are available and deployed in the target region:
- Log Analytics Workspace
- Diagnostic Virtual Machine Scale Set
- Key Vault
- Proximity Placement Group
- Public IP address
- Load Balancer
- Virtual Network
Ensure that you have a Network Contributor role or higher in order to configure and deploy a Load Balancer template in another region.
Identify the networking layout of the solution in the source region, such as NSGs, Public IPs, VNet address spaces, and more.
Prepare
In this section, follow the instructions to prepare for relocating a Virtual Machine Scale Set to another region.
Locate the image reference used by the source Virtual Machine Scale Set and replicate it to the Image Gallery in the target region.
Relocate the Load Balancer, along with the public IP by doing one of the following methods:
- Resource Mover. Associate Load Balancer with public IP in the source region to the target region. For more information, see Move resources across regions (from resource group) with Azure Resource Mover.
- Export Template. Relocate the Load Balancer along with public IP to the target region using the export template option. For information on how to do this, see Move an external load balancer to another region using the Azure portal.
Important
Because public IPs are a regional resource, Azure Resource Mover re-creates Load Balancer at the target region with a new public IP address.
Manually set the source Virtual Machine Scale Set instance count to 0.
Export the source Virtual Machine Scale Set template from Azure portal:
- In the Azure portal, navigate to your source Virtual Machine Scale Set.
- In the menu, under Automation, select Export template > Download.
- Locate the .zip file that you downloaded from the portal, and unzip that file to a folder of your choice. This zip file contains the .json files that include the template and scripts to deploy the template.
Edit the template:
Remove associated resources if they’re present in the template, such as Log Analytics Workspace in the Monitoring section.
Make any necessary changes to the template, such as updating all occurrences of the name and the location for the relocated source Virtual Machine Scale Set.
Update the parameter file with these inputs:
- Source Virtual Machine Scale set
name
. - Image Gallery
Resource id
. - Virtual network
subnet Id
. Also, make the necessary ARM code changes to the subnet section so that it can call the Virtual Networksubnet Id
. - Load Balancers
resource id
,Address id
, andvirtual network id
. Change thevalue
property underparameters
.
- Source Virtual Machine Scale set
Relocate
In this section, follow the steps below to relocate a Virtual Machine Scale Set across geographies.
In the target region, recreate the Virtual Machine Scale Set with the exported template by using IAC (Infrastructure as Code) tools such as Azure Resource Manager templates, Azure CLI, or PowerShell.
Associate the dependent resources to the target Virtual Machine Scale Set, such as Log Analytics Workspace in Monitoring section. Also, configure all the extensions that were consolidated in the Prerequisites section.
Validate
When the relocation is complete, validate the Virtual Machine Scale Set in the target region by performing the following steps:
Virtual Machine Scale Set doesn't keep the same IP after relocation to new target location. However, make sure to validate the private IP configuration.
Run a scripted or manual smoke test and integration test to validate that all configurations and dependent resources have been properly linked and all configured data are accessible.
Validate Virtual Machine Scale Set components and integration.
Related content
- To move registry resources to a new resource group either in the same subscription or a new subscription, see Move Azure resources to a new resource group or subscription.