Replica: Unplanned failover can't perform reverse replication

Todd Nelson 21 Reputation points
2023-03-31T20:37:01.2433333+00:00

I have a working 2-node Hyper-V replica set up and functioning. Server 2022 Stnd. These nodes are NOT domain joined, I'm doing HTTPS authentication with self-signed certs. If I do a planned failover it works properly and the VM moves to the replica node, I can operate the VM, enable reverse replication and shift the VM back to the primary node as you'd expect.

If I do an unplanned failover the VM shifts to the replica node just fine and I can operate the VM, but when I go to enable reverse replication once the primary node comes back online I get an error that says "Hyper-V is not in a state to accept replication". Both nodes are enabled as replicas and open to accepting new connections. I've tried this with 2 VMs. One was just created fresh from scratch today.

Does anyone know why I'm getting this error? I found this thread and followed the suggestions but it didn't help: https://social.technet.microsoft.com/Forums/ie/en-US/02abecd9-a299-4807-b958-050b89a6cd11/reverse-replication-fails-after-failover?forum=winserverhyperv

I've attached a screenshot of the error.hvreplcaerror

Windows for business | Windows Client for IT Pros | Storage high availability | Virtualization and Hyper-V
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Limitless Technology 44,776 Reputation points
    2023-04-03T12:55:49.36+00:00

    Hello

    Thank you for your question and reaching out. I can understand you are having query\issues related to Hyper-V replication.

    This virtual computer might still be present in the replica server if you previously replicated it. Remove it from the replica computer, then turn on replication once more. Only on a private network or domain network is Kerberos usable.

    Please refer to following steps :

    1. Shutdown the VM.
    2. right click the VM select "replication" and then choose "remove replication"(both "primary" and "replica server")

    3.in "replica server" site delete the replica VM in hyper-v manager

    4.in "replica server" site delete the "replica files"

    5.enable the replica again and start the VM in "Primary" site

    Then please retry the powershell for planned failover :

    1. Stop (shut down) contoso2.

    Stop-VM –VMName contoso2 –ComputerName primaryvmhost

    1. Prepare contoso2 for failover on vmhost2 (Primary Server).

    Start-VMFailover –VMName contoso2 –ComputerName primaryvmhost –Prepare

    1. Prepare contoso2 for failover on vmhost1 (Replica Server).

    Start-VMFailover –VMName contoso2 –ComputerName replicavmhost

    1. Reverse the replication from primaryserver to replica server.

    Set-VMReplication -VMName contoso2 -ComputerName replicavmhost –Reverse

    1. Start the VM

    Start-VM –VMName contoso2 –ComputerName replicavmhost

    Reference :

    https://social.technet.microsoft.com/Forums/en-US/8c56c3b0-452d-49e2-8bb4-2339733cc181/hyperv-failed-to-perform-reverse-replication-for-vmname-by-using-powershell-command?forum=winserverhyperv

    --If the reply is helpful, please Upvote and Accept as answer--


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.