Fixing broken replication after changing a Hyper-V host’s name

Changed the host name of a Hyper-V server and now all of your VM’s replication status is Critical?  In the past you’d have to break replication and then rebuild it for every single VM letting them resynchronize which is just an absolute pain and resource/time consuming.  Now we can use the PowerShell Set-VMReplication to fix the Replica Server’s changed name.  You might not notice this right away if the old DNS was left to linger in DNS for some time.  If it gets cleaned out automatically or someone deletes the old name your VMs might stop replicating.  Right clicking a VM and viewing the replication health look at the Current Replica Server to see if the name there is the old name.

https://docs.microsoft.com/en-us/powershell/module/hyper-v/set-vmreplication

Set-VMReplication VM-Name Replica-Server-Name

Luckily this takes * as a wildcard for the VM-Name letting you alter all of your VMs.  Examples;

Set-VMReplication VM01 server01.domain01.contoso.com

Set-VMReplication * server01.domain01.contoso.com

Once the value is changed I reset the replication history and reset the Hyper-V Manager service.  I’m not 100% sure you have to restart the service but I did during testing because I missed one of the gotchas below before resolving it.

There are a couple of gotchas to watch out for.

  1. The system’s new name needs to be in DNS
  2. If you use SSL verification you need to make sure the SSL certificate has been updated to the new name
  3. If you use “Allow replication from the specified servers” option in the Hyper-V Settings of the host system you have to put the new system’s name in the allow list

Comments or questions?

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

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