Q:Why does replication of the virtual hard disk stop when I expand or compact a VHD or VHDX file on Windows Server 2012 Hyper-V Replica?
Replication issues with Hyper-V Replica? Here's how to solve them.
August 6, 2012
A: Hyper-V Replica works by replicating write operations that are stored in transaction log files every five minutes to the replica server. An expand or compact action on a virtual hard disk (VHD) isn't a write operation and therefore doesn't replicate and will break the replication of the VHD.
The only solution is to stop replication, then restart replication. In most organizations, compacting and expanding WHDs isn't a common operation, especially if dynamic VHDs are used; however, it's important to understand that if using Hyper-V Replica for a VM, any compact or expand operations will break the replication.
Below are some steps to "ease the pain":
If Recovery History is off, which means when setting up Hyper-V Replica you did not enable the option to keep additional point in time replica snapshots, do the following:
On the same VHD on recovery, do same operation to get the identical geometry.
Now do Resynchronization of the replica.
Replication should now work again (no Remove Replication is needed in this case).
If Recovery History is on, do the following:
Remove Replication on Primary.
Remove Replication on Recovery as well to let the merge happen for the snapshots.
On the same VHD on recovery, do same operation to get the identical geometry.
Re-setup Replication – use “Smart IR” (“Backup based IR”) – this will do an efficient synchronization of the VHDs and avoid copying over all the content again.
The process above (the Recovery History on scenario) would also be used to add a new VHD to a VM that needs to be replicated:
Copy over the VHD to the replica host and add it to the replica VM on correct IDE/SCSI Controller.
Remove Replication on both sides.
Re-setup Replication and do Smart IR (“Backup based IR”) – this will do an efficient synchronization of the VHDs.
About the Author
You May Also Like