Unplanned Hyper-V Replication how to correct

ngsysadm 1 Reputation point
2021-10-26T09:49:15.26+00:00

Unplanned Hyper-V Replication

I have 2 Nodes, Node1 Primary, Node2 is Replica.
How to do Reverse? What is the best practice?
To do Cancel Replication and return back to Node1 or do Reverse and stay in Node2?

Let’s say that Node1 is unplanned fell, I have replication each other 30 seconds, run PS commands to start VMS on Node2
Start-VMFailover * -Confirm:$false
Start-VM *

After Node1 is up, try to return Replication between Node1 and Node2, at reverse mode.
Node1 = Replica, Node2 = Primary
Run this PS script(maybe mistake at script) at Node2:

Start-VMFailover -VMName * -Confirm:$false
$snaps = Get-VMSnapshot * -SnapshotType Replica
ForEach ($item in $snaps){
Start-VMFailover -VMRecoverySnapshot $item -Confirm:$false
$item
}
Complete-VMFailover -VMName * -Confirm:$false

Set-VMReplication -VMName * -AsReplica

Set-VMReplication -Reverse -VMName *

Start-VMInitialReplication -VMName *

Its error

Hyper-V
Hyper-V
A Windows technology providing a hypervisor-based virtualization solution enabling customers to consolidate workloads onto a single server.
2,530 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Limitless Technology 39,336 Reputation points
    2021-10-27T07:56:56.933+00:00

    Hello @ngsysadm ,

    Thank you for your question.

    Hyper-V Replica is an integral part of the Hyper-V role. It contributes to your disaster recovery strategy by replicating virtual machines from one Hyper-V host server to another to keep your workloads available.

    See the link below that shows how to "Configure Hyper-V Replica" as it's always a good idea to refer to this to review what we need to do:

    https://learn.microsoft.com/en-us/windows-server/virtualization/hyper-v/manage/set-up-hyper-v-replica

    Also, see the topic below that will address a problem similar to yours:

    https://social.technet.microsoft.com/Forums/en-US/91f23c6a-3448-4146-b2b2-0f6f5c0e9181/unplanned-recovery-steps-unknown-in-hyperv?forum=winserverhyperv

    ------------------------------------------------------------------------------------------------------------------------------------------------

    If the answer is helpful, please vote positively and accept as an answer.

    0 comments No comments

  2. ngsysadm 1 Reputation point
    2021-10-28T12:04:56.677+00:00

    Thank you for links but I know how to setup replication, it's worked! But PS script can not do automatically reverse replication

    0 comments No comments