Windows Server 2016 #HyperV DEMO02: Hyper-V Replica Support For Hot Add/Remove of VHDX

| ,

Published on | Updated on June 15, 2016

1 Min. Read

Hello folks,

Today I will demo another new big operational feature in Windows Server 2016 Hyper-V, Hyper-V Replica support for Hot Add and Remove of Virtual Hard Disk.

Microsoft added the ability to hot add and remove virtual hard drive to virtual machines that was being replicated. This is fantastic! Why? Because in Windows Server 2012 or 2012 R2, if we add a virtual hard disk to a virtual machine that was being replicated, then the replication would fail, and the replica will go into a critical state. Sad smile

In Windows Server 2016 that doesn’t happen anymore, when you add a virtual hard drive to a virtual machine it doesn’t get automatically added to the replications set, but the replication will continue to work just fine, and at any stage while the virtual machine is still running and replicated, you can actually go in and use a simple PowerShell cmdlet to add or remove virtual hard drive from the replication disks set, and then Hyper-V Replica will automatically re-synchronize and everything works as expected. Open-mouthed smile

Thank you Microsoft for making Hyper-V Replica experience a lot more seamless.

To add and update the new virtual hard disk to the replica disk set, you will run the following cmdlet:

Set-VMreplication VMName -ReplicatedDisks (Get-VMHardDiskDrive VMName)

To remove any virtual hard disk from the replica disk set, you actually use the same PowerShell cmdlet above, but instead of passing all the disks into ReplicatedDisks – you pass in just the disks that you want to replicate, and exclude the ones that you want to remove.

Set-VMreplication VMName -ReplicatedDisks (Get-VMHardDiskDrive VMName –ControllerLocation 0 –ControllerNumber 0)

Let’s look together at the Hyper-V Replica enhancement in action!


I hope you enjoyed the demo, and I would like to thank you for viewing.



Windows Server 2016 #HyperV DEMO01: Hot Add/Remove Memory and Virtual Network Adapters

Windows Server 2016 #HyperV DEMO03: Production Checkpoints


6 thoughts on “Windows Server 2016 #HyperV DEMO02: Hyper-V Replica Support For Hot Add/Remove of VHDX”

Leave a comment...

  1. Hi Charbel

    I am replicating a server to our disaster recovery site. I now have 2 additional huge VHDX-Files, which I want to replicate. I managed to add them to the existing replica, but it will replicate those two VHDX into the same CSV in our DR site. It will not fit into this CSV. I prepared 2 seperate CSVs, where only the replication of this two WHDX will reside. How can I change the destination folder of this VHDX files, if I include them into the existing replication? I tried to delete and re-create the replication and moved the empty VHDX files to the defined CSVs, but the initial replication will fail because the disks are not visible (as moved before initial replication). How could I manage this situation? (All Windows Server 2016)
    Thank you!
    Regards, Zafer

    • Hello Zafer,

      Thank you for the comment.

      You could leverage Hyper-V storage resource pools. Hyper-V storage resource pools allow you to remove path details from the virtual machine configurations.

      What you need to do is the following:

      1- Create a storage resource pool – with the same name on each node in the cluster (Primary Site).
      2- Configure the storage resource pool to point to the right storage path for each node (Primary and Secondary site).
      3- Configure the replicated virtual machines to utilize this storage resource pool.

      The storage Pool is created using PowerShell:

      On all nodes in the cluster on the PRIMARY site, you want to run this command:

      New-VMResourcePool -Name “VHDs” -ResourcePoolType VHD -Paths “C:\ClusterStorage\LUN-Name-A”

      Then on all nodes in the cluster on the SECONDARY site, you want to run this command:

      New-VMResourcePool -Name “VHDs” -ResourcePoolType VHD -Paths “ClusterStorage\LUN-Name-B”

      Once you have configured these storage resource pools – the Hyper-V UI will magically detect them.
      Now when you go to configure each virtual hard drives, you see a resource pool option named (i.e. VHDs).

      Once you have selected the appropriate resource pool on both sides, you can start the replication.

      Hope this helps and let me know how it works for you.


  2. Hi Charbel

    Thank you for your answer.
    I am not able to add another resource pool as there is no free space.
    We have 4 CSV (2 reserved for the 2 big disks) on both sides. On the primar site the VMs system disk is on CSV 2, the big Disks are on CSV 3 and CSV 4. The same CSVs do exist on the DR site. I need to be able to run the Replication to exactly these CSVs from the beginning. Is this possible?


    • Hello Zafer,

      I did not understand that you cannot add another resource pool as there is no free space.
      You don’t need free space to add a Storage Resource Pool. You can add a Storage Resource Pool to an exiting LUN/Storage/Volume.

      In you example above, you can do the following:

      On all nodes in the cluster on the PRIMARY site, you want to run this command:

      New-VMResourcePool -Name “SystemDisk” -ResourcePoolType VHD -Paths “C:\ClusterStorage\CSV2\”
      New-VMResourcePool -Name “BigDisk01” -ResourcePoolType VHD -Paths “C:\ClusterStorage\CSV3\”
      New-VMResourcePool -Name “BigDisk02” -ResourcePoolType VHD -Paths “C:\ClusterStorage\CSV4\”

      And then for that particular VM, you need to specify the storage resource pool for each and every virtual hard disk (VHDX).

      On the second DR site, you need to do the same (run the same cmdlets).

      Hope this helps and let me know how it works for you.


  3. Just a question:
    After configuring the same type of storage resource pools pointing one to one csv and one to another, what king of replication i need to enable in a stretch cluster configuration?
    Does not the system retrieve the same name storage resource pools and enable replication automatically?

    • Hello Enrico,
      The system will not enable automatic replication for the storage, you have to configure Hyper-V replication and include all the disks set that you want to be part of the replication.
      Microsoft addressed Stretch cluster configuration in Azure Stack HCI OS, but if you are using an older OS (Windows Server 2016 or 2019), you have to configure Hyper-V replication asynchronous every (30 seconds, 5 or 15 minutes) as shown in the demo above. The VM could have multiple VHDX disks which can reside on multiple CSV(s) as well.
      Hope that helps.


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Subscribe to Charbel Nemnom’s Blog

Get the latest posts delivered right to your inbox

The content of this website is copyrighted... please contact the author first. Thank you for visiting!