I have certificate-based replication working between two Server 2012 R2 workgroup servers. Through Hyper-V Manager I can resolve any issues with replication, particularly in the scenario where I failover and wish to reverse replication. Take a DR scenario where I the primary goes offline, I initiate failover, start the replica VM, and wish to reverse replication after the primary has come back online following the power simulated power loss, but via powershell. I'm missing a key step, but I don't know what.
1. PRIHOST goes down and the VM REPME1 is now offline.
2. On REPHOST, I initiate start-vmfailover and start-vm REPME1.
3. Power is restored to PRIHOST and is back up. VM REPME1 is in the inventory but powered off. PRIHOST remains the Primary for replication. REPHOST is still the Replica. Replication has failed, which is expected.
4. I try to reverse replication with set-vmreplication -reverse, but I get an error "Could not reverse replication for virtual machine 'REPME1'. (Virtual machine ID ...) The operation cannot be performed while the virtual machine is in its current state. The name of virtual machine is REPME1 and its ID is ...
5. When I reverse replication in the Hyper-V Manager immediately following it synchronizes back the changes successfully and replication returns to normal.
I suspect that I'm missing a step.
-Michael Kelsey