Share via


Azure Site Recovery: Replicate Hyper-V virtual machines to Azure

Introduction

Site Recovery is an Azure service that contributes to your business continuity and disaster recovery (BCDR) strategy. Site Recovery orchestrates replication of on-premises physical servers and virtual machines to the cloud (Azure), or to a secondary datacenter. When outages occur in your primary location, you fail over to the secondary location to keep apps and workloads available. You fail back to your primary location when it returns to normal operations.  Using ASR can be directly from the Azure Portal or Using OMS.

https://i0.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image.png

Prerequisite version

One or more Hyper-V server, running at least Windows Server 2012 R2 with the latest updates and the Hyper-V role enabled, or running Microsoft Hyper-V Server 2012 R2, with the latest updates. Hyper-V hosts need internet access, and need to be able to access specific URLs directly, or via a proxy.

Individual disk capacity on protected machines shouldn’t be more than 1023 GB. A VM can have up to 64 disks (thus up to 64 TB).

In this case I build a replica between a Hyper-v server and Azure.

In the Azure portal we search for backup.

https://i2.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb.png         https://i1.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_3.png

Picked the Backup and Site Recovery (OMS) and create a Recovery vault. That’s it.. well .. close.

Opening this vault or if you don’t know where it is select the resource group and go from there to the ASR.

https://i0.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_4.png

Selecting our ASR vault brings us to the backup and ASR.

https://i2.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_5.png

It is a very busy menu and a lot of options are there and still new options may appear. And there are several ways to start with ASR.

 

https://i2.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_6.pnghttps://i0.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_7.png

Selecting the Site Recovery Infrastructure a new menu opens and already there are 3 configs. Hyper-v , vmware or VMM

We do the Hyper-v option.

https://i0.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_8.png

https://i2.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_9.pnghttps://i0.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_10.png

It is all step by step and seams all very easy but you need to take care of some steps before you can complete the steps.

Hyper-v Settings

Register your Hyper-V host(s)

On-premises

  1. Make sure the host is running Windows Server 2012 R2 or above.

  2. Download the Agent

  3. the installer for the Microsoft Azure Site Recovery Provider.

  4. Download the vault registration key to register the host in a Hyper-V site

https://i2.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_11.png

This download is replication agent to Azure and need to be installed on the Hyper-v Server

https://i0.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_12.pnghttps://i0.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_13.png

Selecting the Site Recovery and start with Step 1

https://i2.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_14.png

In this step We select our Protection goal select To Azure, and select Yes, with Hyper-V. Select No to confirm you’re not using VMM.

https://i0.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_15.png

We need to create a Site of this hyper-v server. this is a Cosmetic name and points to the Hyper-v server or servers, if this is a Test server then this should be HVtest etc.

https://i1.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_16.png

My site is Single Hyper-v server and already there a a few steps I need to install the Agent downloaded earlier and use the vault keys to connect to Azure.Also downloaded here

https://i0.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_17.png

Installing the Hyper-v Agent

Use the Exe just downloaded and follow the steps.

https://i1.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_18.png

https://i0.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_19.png

Use a location be careful  if not installing on the C drive and not replication the other drive there can be miscommunication in the VM. Better leave this default.

https://i2.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_20.png

But in case You already played with this or want different naming and started all over the may be an issue “ the server is already registered”

https://i1.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_21.png

To fix this error and enable the ASR Provider and agent setup to complete successfully, follow these steps:

  1. Go to the Register

  2. Make a backup of the following registry key:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Azure Site Recovery

https://i2.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_22.png

  1. Delete the registry key that you backed up in step 2.
  2. Restart the Provider and agent setup.

https://i1.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_23.png

Use the downloaded Keys and import them.

https://i2.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_24.png

https://i2.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_25.png

Checking the Register you can see that the key is valid and all the info is there.

https://i2.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_26.png

https://i2.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_27.png

And the installation is done. It can take some time to add the server to Azure maybe several hops back and forth to the menu

https://i2.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_28.png

 

https://i0.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_29.png

You can see the process running in the Task manager.

 

https://i2.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_30.png

Jumping back and to the step 2 you can see the Hyper-v server is added to the Vault.

https://i2.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_31.png

Added a storage account and a network. If this is not the storage account or network you want no worry you can change this befor the replication starts.

https://i2.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_32.png

Check this if you want a new account or different network.

https://i1.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_33.png

Next step would be creating a replication policy.

https://i2.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_34.png

  1. In Create and associate policy specify a policy name.

  2. In Copy frequency specify how often you want to replicate delta data after the initial replication (every 30 seconds, 5 or 15 minutes).

  3. In Recovery point retention, specify in hours how long the retention window will be for each recovery point. Protected machines can be recovered to any point within a window.

  4. In App-consistent snapshot frequency specify how frequently (1-12 hours) recovery points containing application-consistent snapshots will be created. Hyper-V uses two types of snapshots — a standard snapshot that provides an incremental snapshot of the entire virtual machine, and an application-consistent snapshot that takes a point-in-time snapshot of the application data inside the virtual machine. Application-consistent snapshots use Volume Shadow Copy Service (VSS) to ensure that applications are in a consistent state when the snapshot is taken. Note that if you enable application-consistent snapshots, it will affect the performance of applications running on source virtual machines. Ensure that the value you set is less than the number of additional recovery points you configure.

  5. In Initial replication start time specify when to start the initial replication. The replication occurs over your internet bandwidth so you might want to schedule it outside your busy hours.

https://i1.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_35.png

As you can see the policy’s are applied but you can create multiple but you can use only one at each site.

https://i2.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_36.png

Site Recovery performs optimally when sufficient network bandwidth and storage are provisioned. Allocating insufficient capacity can lead to replication issues. Site Recovery provides a capacity planner to help you allocate the right resources for your source environment, the site recovery components, networking and storage. You can run the planner in quick mode for estimations based on an average number of VMs, disks, and storage, or in detailed mode in which you’ll input figures at the workload level.

Get the Azure Site Recovery Capacity planner here : Download

 

https://i0.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_37.png

A quick overview of the Azure Site Recovery Capacity planner

If you skip this or thinking this will be fine I’ll show you later what can happen.

https://i2.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_38.pngNow that all steps are completed in the ASR infrastructure we can start with step 2.

https://i2.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_39.png

The replication can’t be Throttled only for backup operations you can Enable internet bandwidth usage throttling.

https://i0.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_40.png

Selecting the Right networks for the replicated VM’s and subnets and the correct Storage account.

 

https://i2.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_41.png

Next is selecting what VM’s I need to replicate. If there is no VM list then there is something wrong with your connection.

https://i1.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_42.png

As my DPM machine has a disk larger than 1023 GB this can’t be replicated.

https://i2.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_43.png

https://i0.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_44.png 

Selecting a few VM’s you can see even the names can be changed to the right Azure style or if there a characters in the name that are not supported.

https://i1.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_45.png

In the old days you could only replicated one disk but now 64 Disks are supported. and you can select what disk you want and what to skip.

https://i1.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_46.png

After these final steps we are ready to replicate

https://i2.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_47.pnghttps://i1.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_48.png

In a quick overview we can start the replication.

https://i2.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_49.png

the replication is started and as you can see here comes the ASR Capacity planner.

https://i0.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_50.pnghttps://i1.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_51.png

https://i1.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_52.pnghttps://i2.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_53.png

OK this seams to be an issue for my other running VM’s on this hyper-v server.

https://i2.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_54.png

Checking the Hyper-v server you can see the progress there or in Azure

https://i2.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_55.png

https://i1.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_56.png

https://i1.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_57.png

But As ASR is using ASR you can also drill down on the replica options.

https://i2.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_58.png

When the replica is done you can change the Azure VM in any way change the network , VM size the VM can be better than on prem.

https://i0.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_59.png

As ASR stands for recovery you can do a test failover or planned. As you are not using VMM the Azure portal is the Orchestrator for the Failover.

https://i1.wp.com/scom.aca-computers.nl/image/b1d630324633_D84B/image_thumb_60.png

Testing the VM is easy a you can run the VM Side by Side and you can change all the settings. A great option to get started with Azure.