#HyperV Replica–Virtual size of one or more virtual hard disks are different between Primary and Replica servers

Introduction

In Windows Server 2012 R2, the Hyper-V team added the ability to resize virtual hard disks attached to a vSCSI controller while the virtual machine is running.

For more information about resizing virtual hard disks, see Configure Online Virtual Hard Disk Resize.

With Online Virtual Hard Disk Resize, Hyper-V Replica took the benefit of this feature as well, so you can resize a virtual disk while the VM is running and been enabled for replication. There is no need to resync the VM after modifying the disk, and no need to delete and re-enable the replication!

Fix Error Event 29260, Hyper-V-VMMS

A classic example of this error is shown in the following screenshot, you resize the virtual disks for a VM on the Primary site without resizing the Replica site virtual disks as well.

HVR-VHDX-Size01

As you can see, the error message in the event viewer is a bit misleading.

[Cannot perform operation for virtual machine <VMName> as virtual size of one ore more virtual hard disks are different between primary and Replica servers. Delete and re-enable replication.]

In fact, we don’t need to delete and re-enable the replication as mentioned earlier in order to have the Primary and Replica VM back in Synch. The resync operation will not proceed as the two disks have different sizes.

The workflow to fix this error is the following:

Step 1.

On the primary site, select the virtual disk that you resized and use the Inspect option to check the current the size of the disk.

image

You can also use the Get-VHD PowerShell commandlet.

Step 2.

On the replica site, select the corresponding virtual disk and resize it using the Edit disk wizard or the Resize-VHD PowerShell commandlet to match the current size at the Primary site.

HVR-VHDX-Size07

Step 3.

Once you edit the disk at the replica site, you can resume the replication on the VM from the Primary site using Hyper-V Manager or the Resume-VMReplication PowerShell commandlet.

HVR-VHDX-Size08

Step 4.

Once the replication is resumed, Event ID 29266 is logged under Hyper-V-VMMS logs as shown in the next screenshot.

image

Followed by “Resynchronization was successfully initiated for the primary virtual machine”. Event ID 32325.

image

Ensuring that the Replica disk is resized according to the Primary disk and resuming replication will be sufficient for resynchronization to continue.

Voilà! That’s all there is to it… You can also automate above steps using PowerShell. For this reason, I created the following nifty tool to help you can tackle and fix above error instantly.

This tool will help you to get the VM information from the primary and replica site, then find the right disk which is out of Synch and resize it to match the primary VM virtual disk(s).

HVR-VHDX-Size16

Hope this post has been useful and thank you for reading!

Cheers,
-Ch@rbel

About Charbel Nemnom 294 Articles
Charbel Nemnom is a Microsoft Cloud Consultant and Technical Evangelist, totally fan of the latest's IT platform solutions, accomplished hands-on technical professional with over 15 years of broad IT Infrastructure experience serving on and guiding technical teams to optimize performance of mission-critical enterprise systems. Excellent communicator adept at identifying business needs and bridging the gap between functional groups and technology to foster targeted and innovative IT project development. Well respected by peers through demonstrating passion for technology and performance improvement. Extensive practical knowledge of complex systems builds, network design and virtualization.

1 Comment

Leave a Reply