How To Migrate Machines To Azure
In this “how do I ..?” article I will explain how you can use Azure Site Recovery (ASR) to migrate machines, VMware, physical, or Hyper-V, running Windows or Linux, to Azure with minimized downtime.
Back in 2014, I wrote an article that showed you 5 ways that you could use to move virtual machines from your computer room or data center to Azure. Back then, Microsoft had a different vision for Azure features such as Azure Site Recovery (focused just on large enterprises) and how they would support a migration to Azure. Things have moved on, so I thought I’d write an updated post on how to get your machines into Azure.
Azure Site Recovery
Microsoft’s DR site-in-the-cloud replication feature is the solution for getting machines into Azure. ASR can replicate the following types of Windows or Linux machine into Azure:
What is “Inside Microsoft Teams”?
“Inside Microsoft Teams” is a webcast series, now in Season 4 for IT pros hosted by Microsoft Product Manager, Stephen Rose. Stephen & his guests comprised of customers, partners, and real-world experts share best practices of planning, deploying, adopting, managing, and securing Teams. You can watch any episode at your convenience, find resources, blogs, reviews of accessories certified for Teams, bonus clips, and information regarding upcoming live broadcasts. Our next episode, “Polaris Inc., and Microsoft Teams- Reinventing how we work and play” will be airing on Oct. 28th from 10-11am PST.
- Windows Server 2012 R2 Hyper-V or Hyper-V Server 2012 R2, with or without System Center Virtual Machine Manager.
- Physical machines
Microsoft added support for VMware and physical machines thanks to the acquisition of InMage Scout. This was originally going to be used to power a solution called the Migration Accelerator, but Microsoft realized that they were wasting effort – a planned failover in ASR would do exactly the same thing that ASR would do.
A planned failover is when you decide to proactively move a machine from one location to another. In the case of ASR, a planned failover will:
- Stop the on-premises machine
- Flush the last piece of replication to Azure, ensuring that there is no data loss
- Start the machine in Azure
You might think of this as a “stretch quick migration” – there is a small amount of downtime, but it’s not much and it’s very manageable if planned for a maintenance window.
Migrating Machines to Azure using ASR
Using ASR is a supported, and recommended, scenario for migrating machines to Azure. ASR will allow you to seed the migration by performing a full synchronization followed by continuous asynchronous replication (every 30 seconds, or every 5 or 15 minutes) until you are ready to migrate a machine or service comprised of lots of machines.
ASR includes a failover automation feature called recovery plans. You can create a recovery plan to fail over machines in a desired order. Note that a recovery plan can use PowerShell scripts, in the form of Azure Automation, to perform additional steps and request manual intervention where automation is not possible. It is strongly recommended that you create a recovery plan for a machine migration:
- You can run a test failover on an isolated network to ensure that the migration will succeed. You can delete the test and make changes until you are happy, without impacting any production systems that are executing on-premises.
- When the time comes to migrate, all servers will switch over to Azure in the desired order and in a pre-planned and a fully rehearsed manner.
Note that a recovery plan scales differently for organizations:
- A smaller organization might have one recovery plan for all machines.
- A large enterprise might use a recovery plan for each service.
- A huge organization might use many recovery plans per service.
Hybrid networks can connect on-premises and in-Azure networks to allow services to span both locations.
The process that Microsoft recommends is depicted in the below diagram:
- Storage: You will require at least one GRS storage account and a Site Recovery Vault in your Azure subscription.
- Register the on-premises servers: Register all VMware & Hyper-V hosts and physical servers in ASR.
- Protect machines: Enable replication of the desired physical and virtual machines using ASR. Wait for those machines to replicate.
- Mapping: Create all of the required virtual networks/subnets in Azure, preconfigure Azure virtual machines specifications, and assign any required network settings (failover network, reserved IP addresses, and so on).
- Test recovery plan: Create a recovery plan and perform test failovers. Document everything that must be modified during a test and repeat this process until you are happy that a planned failover will succeed.
- Planned failover: Pay tribute to whatever deity/deities you worship (or start to that day), and start a planned failover of the recovery plan.
- Validation: Verify that everything is running successfully in Azure.
- Cleanup: Remove replication and recycle the old on-premises equipment.
How Much Will This Cost?
If you are relatively quick, then a migration using ASR will not cost you a penny, according to the ASR pricing page:
… it does not matter how long you have been using Azure Site Recovery. Every protected instance incurs no ASR charges for the first 31 days.
That means that, no matter how long you have used the ASR service, the first 31 days of replication for any machine is free. If you migrate a machine and remove replication within 31 days then an ASR-powered migration will not cost you a cent.