We have server1 and server2 with Windows Server Core. One of them is with the virtual machines(server1), the other(server2) will be the replica server.
For creating certificates and importing them I followed this guide and it worked like a charm(check Step 3):
Next, I followed this guide to configure Hyper-V Certificate based Replication under PowerShell (no GUI), but I was unable to start the replication :
I found an error in this documentation. For configuring replica server it says that you need to use the thumbprint of the CA which issued the certificates for both servers, but actually I had to use the thumbprint of the certificate for server2(replica server).
Next, I had to enable replication for VM regarding the guide, but when I run :
Set-VMReplication -VMName “ProjectVM” -ReplicaServerName “server2” -ReplicaServerPort 5000 -AuthenticationType Certificate -CertificateThumbprint “4BFFF00509B97C782603F1DF3AF8C0399778FD70” -CompressionEnabled $true
It says :
Set-VMReplication : Replication is not enabled for virtual machine with name ‘ProjectVM’.
At line:1 char:1
- Set-VMReplication -VMName “ProjectVM” -ReplicaServerName “replicaNode” -R …
+ CategoryInfo : InvalidOperation: (:) [Set-VMReplication], VirtualizationException + FullyQualifiedErrorId : InvalidState,Microsoft.HyperV.PowerShell.Commands.SetVMReplication
I tried both: 5000 and 443, but still I get the same error.
And I tried with both - CA certificate thumbprint and server2 certificate thumbprint, but still I get the same error.