Hyper-V Backup and Recovery: Protect your Hyper-V VMs with BDRSuite. Start 30-day Free Trial today!

Table of Contents

  1. What is Backup?
  2. What is Replication?
  3. Difference between Backup and Replication
  4. What is Hyper-V Replica?
  5. Getting Started
  6. Setting up Windows Server 2016 Hyper-V VM Replication
  7. Why Hyper-V Replicas are not replacement for backups

Protect Your Data with BDRSuite

Cost-Effective Backup Solution for VMs, Servers, Endpoints, Cloud VMs & SaaS applications. Supports On-Premise, Remote, Hybrid and Cloud Backup, including Disaster Recovery, Ransomware Defense & more!

What is Backup?

Backup is a process of copying and archiving data in order to protect against data loss. Backups are made in case of a system failure or loss of data. Backups can be used to restore data in the event of data loss or system failure. Backups can also be used to restore data to an earlier point in time.

What is Replication?

Replication is a process of copying and distributing data to multiple locations. The purpose of replication is to ensure data availability and data protection. Replication can also help improve performance by distributing data to multiple locations.

Download Banner

Difference between Backup and Replication

While replication and backup may seem similar, they serve distinct purposes in the realm of data protection. Replication is like creating a mirror image of your data, constantly updating in real-time. It’s akin to having an identical twin who experiences the same changes as you do. However, if an unintended alteration occurs, it’s immediately mirrored too. On the other hand, backup is like capturing snapshots of your data at different points in time. It’s more like taking a series of photographs, each freezing a moment in history. Unlike replication, backup allows you to go back in time and retrieve a specific snapshot, unaffected by recent changes or errors.

So, while replication ensures continuity, it may not safeguard you from data corruption, accidental deletions, or malicious attacks. It’s like having a synchronized dance partner who follows your every step, even if you make a mistake. Backup, however, provides a safety net, allowing you to gracefully rewind and correct a misstep. In essence, while replication is a marvelous choreographed routine, backup is your reliable safety harness that ensures your performance is flawless, no matter what the stage throws at you.

What is Hyper-V Replica?

Hyper-V Replication is a feature of Microsoft’s Hyper-V virtualization platform which enables you to replicate virtual machines (VMs) running on one Hyper-V host to another Hyper-V host. This helps provide protection against various issues such as hardware failure, data corruption, or natural disasters by enabling you to quickly recover from any such occurrences.

Hyper-V Replica is a free in-built feature from Hyper-V 3.0 for disaster recovery.

Let’s imagine that your primary host hardware fails, then you will be able to instantly switch on your VM on your secondary host. If you work in a small environment, then you probably do not deploy Hyper-V Clusters, and may be working with Hyper-V Host in a standalone mode. Hyper-V replication enables you to set up a Virtual Machine to replicate from one Hyper-V host to another Hyper-V Host which you can recover easily within minutes in case of a disaster. However, Hyper-V replication is not an alternative to backup.

Also, Hyper-V Replication can be used to replicate VMs from one Hyper-V host to another, either on-premises or in the cloud. The process of replication is a scheduled, asynchronous, and secure copy of the VM’s data. You can use Hyper-V Replication to replicate VMs between two Hyper-V hosts over any network connection, including the internet.

Hyper-V Replication is a cost-effective and efficient way to protect your data and applications against potential disasters. It provides a high level of availability and reliability, as well as continuous data protection. It also helps you to recover quickly from any unforeseen events or outages.

Hyper-V Replication also provides you with the capability to replicate VMs between different versions of Hyper-V hosts. This is known as ‘version-flexible replication’ and allows you to replicate VMs between different versions of Hyper-V hosts, while maintaining the same configuration.

Getting Started

Let’s take a look at how native Hyper-V replication is configured. Before going deeper, you must build two Hyper-V hosts (at least):

  • Build two Physical or Virtual Host servers. In this guide, both Virtual Hyper-V hosts will run the same version of Windows Server, say Windows server 2016, thanks to the Nested Virtualization. Nested Virtualization refers to virtualization that runs inside an already virtualized environment. In other words, it is the ability to run a hypervisor inside of a virtual machine (VM), which itself runs on a hypervisor
  • You must install the Hyper-V role on both
  • Make sure both servers are fully patched through Windows update

Hyper-V Replica is a feature of Hyper-V, so you must enable the Hyper-V server role if you are not already using it. This feature is included in Windows Server 2012, 2012R2, and in Windows Server 2016.

Open a PowerShell console, and type the following command:

PS > Install-WindowsFeature Hyper-V

With Windows Server 2016, Microsoft provides the ability to run a Hyper-V inside of a Hyper-V, which is called Nested Virtualization. If you wish to install another Hyper-V Server for testing purposes, you need to run this command on the Hyper-V server:

PS > Set-VMProcessor -VMName “HYPV01” -ExposeVirtualizationExtensions $true

Note that your Hyper-V Virtual Machine must be powered off.

Please note the following information:

  • You do not need Failover Clustering in order to implement Hyper-V Replica. You just need two servers with the Hyper-V role installed
  • Your Hyper-V hosts can be in a workgroup or Active Directory Domain
  • Hyper-V Replica feature is not a High Availability solution

To allow the replication between the Hyper-V hosts, we need to provide correct permissions first. To do so, let’s run these commands in the PowerShell on both Hyper-V Hosts:

PS > Enable-Netfirewallrule -displayname “Hyper-V Replica HTTP Listener (TCP-In)”

You also can check the Hyper-V rules by running the following command:

PS > netsh advfirewall firewall show rule name=all dir=in | find “Hyper-V”

You can also see the Hyper-V rules from the GUI:

  • Control Panel
  • Windows Firewall
  • Advanced settings
  • Inbound Rules

Enable these rules by right clicking and selecting “Enable Rule”

Hyper-V-replication

This should be done on both servers.

You can backup your Hyper-V VMs for free with no feature restrictions. Try a 30-days full-featured free trial now

Setting up Windows Server 2016 Hyper-V VM Replication

In this lab, I deployed two Hyper-V Hosts:

  • Hypv-Europe with the following IP Address 10.0.0.4. This host will be the primary host
  • Hypv-France with the following IP Address 10.200.200.4. This host will be the secondary host

Let’s confirm that both Hyper-V hosts can communicate. If the ping does not work, then you must check your network settings or configure your Windows Firewall to allow the icmp request.

Hyper-V-replication

It is nice to work with hostname, so you can create a host file with IP address and hostname of the server. Make sure you can ping the hostname.

Hyper-V-replication

Hyper-V-replication

Now, we need to enable both Hyper-V hosts as Replica Server. Start the Hyper-V Manager console by going to:

  • Server Manager
  • Tools
  • Hyper-V Manager

and when the console opens, Right Click on your Hyper-V Host and choose Hyper-V Settings.

Hyper-V-replication

From left side of the menu choose Replication Configuration

Hyper-V-replication

Repeat this step on both Hyper-V hosts.

For those of you who want to use a certificate to allow replication, then the first step to do is to create a root CA certificate:

PS > New-SelfSignedCertificate -Type “Custom” -KeyExportPolicy “Exportable” -Subject “CN=rootca” -CertStoreLocation “Cert:\LocalMachine\My” -KeySpec “Signature” -KeyUsage “CertSign”

Next, we must create two server certificates for both Hyper-V hosts. We will use the previous Thumbprint and run the following command:

PS > New-SelfSignedCertificate -type “Custom” -KeyExportPolicy “Exportable” -Subject “CN=hypv-europe” -CertStoreLocation “Cert:\LocalMachine\My” -KeySpec “KeyExchange” -TextExtension @(“2.5.29.37={text}1.3.6.1.5.5.7.3.1,1.3.6.1.5.5.7.3.2”) -Signer “Cert:LocalMachine\My\6A7196D9759FC2F7C49D62E08FA7195310DE5EB7” -Provider “Microsoft Enhanced RSA and AES Cryptographic Provider”
PS > New-SelfSignedCertificate -type “Custom” -KeyExportPolicy “Exportable” -Subject “CN=hypv-france” -CertStoreLocation “Cert:\LocalMachine\My” -KeySpec “KeyExchange” -TextExtension @(“2.5.29.37={text}1.3.6.1.5.5.7.3.1,1.3.6.1.5.5.7.3.2”) -Signer “Cert:LocalMachine\My\6A7196D9759FC2F7C49D62E08FA7195310DE5EB7” -Provider “Microsoft Enhanced RSA and AES Cryptographic Provider”

Import these certificates on both Hyper-V Hosts.

The configuration is done. You can now right-click on a Virtual Machine and click on “Enable Replication”

Hyper-V-replication

Replication wizard starts and now click on Next.

Hyper-V-replication

In my case, I want to replicate the Virtual Machine from Hypv-Europe to Hypv-France. Click on Browse and select the replica server. Click next.

Hyper-V-replication

Specify the connection between the two host servers. In my case, I will use port 443 using a certificate based encryption between host servers.

You can enable “Make sure Compress the data that is transmitted over the network”

Hyper-V-replication

Select the VHDx file

Hyper-V-replication

Configure the replication frequency. By design, 5 minutes is the recommended frequency but you can select 10 or 15 minutes based on your required RPO.

Hyper-V-replication

Select if any additional recovery points must be created. By default, only the latest recovery point will be maintained.

Hyper-V-replication

Choose how to send the initial copy. Here, I will use the network to send the copy. If you work with a branch office, it could be useful to send the initial copy using external media, depending on the bandwidth.

Hyper-V-replication

Click Finish to validate the wizard. The replication process will start in a few moments.

Hyper-V-replication

Depending on the size of the Virtual Machine, a replica VM will appear on the secondary host.

Hyper-V-replication

Changes will be sent every 5 minutes.

You can also use PowerShell to enable and initiate the replication.

PS > Enable-VMReplication

PS > Start-VMInitialReplication

If you want to configure Hyper-V replica with Hyper-V cluster, I advise you to read the following article written by Brandon Lee: Hyper-V Basic Replication Configuration

Why? Because the cluster will need to have the Replication Broker role installed.

Why Hyper-V Replicas are not replacement for backups

The main purpose of Hyper-V replica is to ensure business continuity at the time of a minor system crash or minor disaster. Since, replica needs a short period of time to start, it’s optimal in situations where long periods of outages are inconvenient. This does not change the purpose of Hyper-V Backup or qualify it as a replacement for virtual machine backups.

Backups are still crucial for protecting your business-critical data from ransomware, disaster, etc.

Backups also now provide immediate data recovery within the site for various data loss scenarios. Backup supports more recovery points than VM replication for your VMs that help you to perform any point-in-time recovery and also help to comply with all major compliances.

To have an efficient backup and disaster recovery strategy, both backup and replication is necessary to protect your business infrastructure from various data loss scenarios. By having VM replication and backup in your BC/DR strategy you will be able to implement the best version of 3-2-1 backup rule. In the 3-2-1 backup rule, it is recommended to have (3) copies of your data (one on local storage, one copied to an object storage on cloud and another an archival copy stored on tape drive), stored on at least (2) different types of media (Block storage and object storage media), with at least (1) copy stored in a different geographical region using the Offsite DR feature.

BDRSuite is a comprehensive backup solution which provides backup and replication features for your Hyper-V virtual machines and clusters and enables you to implement 3-2-1 backup methodology in your business environment.

Be sure to download a 30-day free trial of BDRSuite for testing out the powerful backup and replication options you get for Microsoft Hyper-V.

Related Posts:

How to Backup Hyper-V Virtual Machines
Perform Hyper-V VM Live Migration without Failover Clustering

Follow our Twitter and Facebook feeds for new releases, updates, insightful posts and more.

3/5 - (7 votes)