How to Clone an Azure VM Instance to Another Region
Learn how to clone Azure VM instances across regions to have backup instances ready in the event of regional outages.
Learn how to clone Azure VM instances across regions to have backup instances ready in the event of regional outages.
For your organization to have an effective failover process, it means that you are able to quickly and easily switch over to backup resources when primary resources fail.
If you want to have backup instances for your virtual machines, you can create copies from one source region to a target region. By using this copying method, you can ensure that you have backup resources to use if an instance fails in a certain region.
In this guide, we’ll show you how to copy instances from one region to another so that you can be prepared for regional outages.
You can’t just directly copy an instance to another region. Instead, you must create a snapshot of the instance first, copy that snapshot to a target region, and then create an instance from that snapshot.
In this first step, we’ll show you how to create a snapshot of your Azure VM instance.
It may take a few minutes for the snapshot to be created.
In an Azure ecosystem, just as in similar cloud services, some restrictions should be noted when copying instances across regions. This is particularly important to consider if the needs of your organization exceed your set subscription plans per region.
Next, you’ll want to copy your new snapshot over to your target region so you can use it to create an instance in that target region. We’ll show that using the recommended “Managed copy” method.
You can use the following command to copy your new snapshot over to your target region:
Now, you have the snapshot you need in the target region.
Before we move on, it’s a good practice to delete the snapshot in the other region if you no longer need it. You can find the portal and CLI steps for deleting unneeded Azure snapshots in one of our other how-to guides on that topic.
Finally, let’s use our copied snapshot as the source for creating our new instance, or managed virtual disk, in our target region.
You can run this command to create a new instance based on your new snapshot and specify your target region:
Here’s an example:
Now, you’ve successfully created a copy of your original instance in another region!
Preparing for regional outages is something you can do manually by following the three basic steps we’ve outlined. It is time-intensive and difficult to scale, but for rare use cases, this approach might be all you need to respond to an outage.
If you want to be able to react faster and take these actions when certain events take place, you need to leverage automation.
With Blink, you can run all of these steps by just inputting basic details into this self-service automation. Specify which instance you want to copy and this automation will execute the following steps:
You can also set up event-based triggers. For example, if VM performance dips below a certain threshold, you could use that event to kick off mitigation actions.
Use any of the 5K automations in the Blink library right away, or build your own custom automation to fit your exact use case.
Get started with Blink to create a world-class failover system today.
Blink is secure, decentralized, and cloud-native. Get modern cloud and security operations today.