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 the virtual hard drive to virtual machines that were 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.
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 the virtual hard drive from the replication disks set, and then Hyper-V Replica will automatically re-synchronize and everything works as expected.
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 it.