How to Configure Hyper-V Replica in Windows Server 2022

Posted on 20th June 2023

Introduction

Hyper-V Replica is a feature in Windows Server 2022 that allows you to replicate virtual machines from one Hyper-V host to another. This can be useful in a number of scenarios, such as Disaster Recovery, where you want to ensure that you have a copy of your virtual machines in another location in case of a problem with the primary Hyper-V host.

In this article, we will show you how to configure Hyper-V Replica in Windows Server 2022. We will cover the following topics:

– Planning for Hyper-V Replica
– Configuring Hyper-V Replica
– Testing Hyper-V Replica

Planning for Hyper-V Replica

Before you configure Hyper-V Replica, there are a few things you need to consider.

The first is the bandwidth available between the primary and secondary Hyper-V hosts. Hyper-V Replica uses asynchronous replication, which means that it does not require a constant connection between the primary and secondary hosts. However, the initial replication of a virtual machine can be quite large, so you need to make sure that you have enough bandwidth to accommodate this.

The second thing to consider is the storage available on the secondary Hyper-V host. When you replicate a virtual machine, the replica is stored as a disk file on the secondary host. The size of this file will be the same as the size of the virtual machine’s disk on the primary host.

Finally, you need to decide how often you want to replicate the virtual machine. Hyper-V Replica supports three replication frequencies:

– Every 5 minutes
– Every 15 minutes
– Every 30 minutes

The replication frequency you choose will depend on your bandwidth and storage constraints, as well as the amount of data you are willing to lose in the event of a failure.

Configuring Hyper-V Replica

Now that you have planned for Hyper-V Replica, you are ready to configure it.

The first thing you need to do is open the Hyper-V Manager and select the primary Hyper-V host. In the Actions pane, select Replication > Configure Replication.

This will open the Replication Configuration Wizard. On the Before You Begin page, click Next.

On the Specify Replication Partner page, enter the name of the secondary Hyper-V host. If the secondary host is in a different domain, you will need to enter the fully qualified domain name. Click Next.

On the Specify Replication Frequency page, select the replication frequency you want to use. As we mentioned earlier, you can choose to replicate every 5 minutes, every 15 minutes, or every 30 minutes. Click Next.

On the Enable Compression page, you can choose to compress the replication traffic. This can help to reduce the amount of bandwidth required for replication. Click Next.

On the Choose Replication Method page, you have two options for replicating the virtual machine:

– Use Volume Shadow Copy Service (VSS): This option will use VSS to take a snapshot of the virtual machine before replicating it. This snapshot will be taken on the primary host, so you will need to have enough storage to accommodate it.

– Do not use VSS: This option will not take a snapshot of the virtual machine before replicating it. This means that the replica may not be an exact copy of the primary virtual machine, but it will be close.

Which option you choose will depend on your requirements. If you need an exact copy of the primary virtual machine, you should choose the VSS option. If you only need a close copy, you can choose the non-VSS option.

Click Next.

On the Configure Certificate Authentication page, you have the option to use certificate authentication to secure the replication traffic. If you choose this option, you will need to generate a certificate on the primary host and install it on the secondary host.

If you do not want to use certificate authentication, you can choose the non-certificate option. This option is less secure, but it is easier to set up.

Click Next.

On the Ready to Enable Replication page, review the settings you have chosen. If you are happy with them, click Enable Replication.

Testing Hyper-V Replica

Once you have configured Hyper-V Replica, you should test it to ensure that it is working as expected.

To test Hyper-V Replica, you will need to create a test virtual machine on the primary host. This virtual machine can be a simple machine with just a few files.

Once the virtual machine has been created, you need to replicate it to the secondary host. To do this, open the Hyper-V Manager and select the primary host. In the Actions pane, select Replication > Replicate Now.

This will open the Replication Wizard. On the Before You Begin page, click Next.

On the Specify Replication Partner page, select the secondary host and click Next.

On the Choose Virtual Machines page, select the virtual machine you want to replicate and click Next.

On the Ready to Replicate page, review the settings and click Replicate.

The replication process will now start. This can take some time, depending on the size of the virtual machine and the replication frequency you have chosen.

Once the replication process has completed, you can test the replica on the secondary host. To do this, open the Hyper-V Manager and select the secondary host. In the Actions pane, select Start > All Programs > Microsoft Hyper-V > Hyper-V Manager.

This will open the Hyper-V Manager. In the left pane, you should see the replica virtual machine. You can now start the replica virtual machine and test that it is working as expected.

Conclusion

In this article, we have shown you how to configure Hyper-V Replica in Windows Server 2022. We have also shown you how to test the replica to ensure that it is working as expected.

Configuring Hyper-V Replica in Windows Server 2022

To configure Hyper-V Replica in Windows Server 2022, you’ll need to first set up a Hyper-V Replica Broker in the Failover Cluster Manager. Then, you can enable replication for one or more virtual machines.

1. Set up a Hyper-V Replica Broker

Open the Failover Cluster Manager and click on the Cluster name. In the Actions pane, click on “Configure Hyper-V Replica Broker”.

In the “Configure Hyper-V Replica Broker” window, select the node that you want to be the primary server. This is the server that will initially host the replicated virtual machines.

Click on “Enable this server as a Replica server”. In the “Replica server mode” drop-down, select “Primary”.

Click on “Enable certificate authentication (HTTPS)”. This will use SSL to encrypt replication traffic.

Click on “Enable compression”. This will compress the replication traffic to save on bandwidth.

Click on “Configure Cluster Shared Volume for Replica”. This will ensure that the replicated virtual machines are stored on a Cluster Shared Volume.

Click on “OK” to close the “Configure Hyper-V Replica Broker” window.

2. Enable Replication for a Virtual Machine

In the Failover Cluster Manager, click on the Cluster name. In the Actions pane, click on “Enable Replication”.

In the “Enable Replication” window, select the node that you want to be the primary server. This is the server that will initially host the replicated virtual machine.

Click on the “Replica server” drop-down and select the node that you want to be the replica server. This is the server that will receive the replicated virtual machine.

In the “Replication frequency” drop-down, select the frequency with which replication will occur. The options are “30 seconds”, “5 minutes”, “15 minutes”, and “30 minutes”.

In the “Recovery point objective” drop-down, select the maximum amount of time that you’re willing to lose data in the event of a failure. The options are “30 seconds”, “5 minutes”, “15 minutes”, and “30 minutes”.

Click on “Enable this replication relationship”.

Click on “OK” to close the “Enable Replication” window.