How To Add Or Remove any specific disk from Hyper-V replication (hot add/remove)

Starting from windows 2016 the same command to create replication is the one to remove disks, when running the command the replication will hot add/remove any disk you specified, if you add specific disk, the other will be excluded ! here some example (execute Powershell on the host):

To add/update all the disk on the VM to the replication :

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

To add specific disk ,only this disk will be add to the replication, the other will be excluded :

Set-VMreplication "VMname" -ReplicatedDisks (Get-VMHardDiskDrive "VMname" -ControllerType SCSI -ControllerNumber 0 -ControllerLocation 0)

To add/update mote then one disk, just add additional location with comma to separate :

Set-VMreplication "VMname" -ReplicatedDisks (Get-VMHardDiskDrive "VMname" -ControllerType SCSI -ControllerNumber 0 -ControllerLocation 0), (Get-VMHardDiskDrive "VMname" -ControllerType SCSI -ControllerNumber 0 -ControllerLocation 2)

When changing disks on the replication disk list you should concider some time to let the disk re-replicate and merging (shown in the hyper-v manager)

Good Luck

Leave a Reply

Your email address will not be published.