Setting up Hyper-V Replica on Windows 2012 in Workgroup Mode Using SSL Certificates
This guide is specifically for setting up Hyper-V Replica between two Windows 2012 (not Windows 2012 R2) servers in Workgroup mode (not joined to a domain) using SSL/HTTPS over port 443 (not PLAIN/HTTP over port 80) and focuses on the configuration of the SSL certificates.
Note: PrimaryServer is the server with the VM that we want to replicate. SecondaryServer is the server that will host the replica of the VM.
- Disable Windows Firewall on both servers (or at least allow port 80 and port 443 inbound on both servers)
- Make sure the user account you are setting up Hyper-V replica as, exists as member of the Administrators group on both servers, with the same password!
- For simplicity sake, you could use the Administrator account, with the same password on both servers.
- Add entries to the c:windowssystem32driversetchosts file as follows
- IP-Address Hostname. For example:
- 192.168.1.1 PrimaryServer
- 192.168.1.2 SecondaryServer
- Do this step on both servers. You should be able to ping both hostnames from both servers without using an IP Address (using the hostname instead).
- IP-Address Hostname. For example:
- Download MakeCert on to both machines. You can download it here.
- Open a command prompt on the PrimaryServer (not powershell) and run the following commands in the makecert directory
-
makecert -pe -n "CN=PrimaryServerRootCA" -ss root -sr LocalMachine -sky signature -r "PrimaryServerRootCA.cer"
-
makecert -pe -n "CN=PrimaryServerHostName" -ss my -sr LocalMachine -sky exchange -eku 1.3.6.1.5.5.7.3.1,1.3.6.1.5.5.7.3.2 -in "PrimaryServerRootCA" -is root -ir LocalMachine -sp "Microsoft RSA SChannel Cryptographic Provider" -sy 12 PrimaryServer.cer
-
- Open a command prompt on the SecondaryServer (not powershell) and run the following commands in the makecert directory
-
makecert -pe -n "CN=SecondaryServerRootCA" -ss root -sr LocalMachine -sky signature -r "SecondaryServerRootCA.cer"
-
makecert -pe -n "CN=SecondaryServerHostName" -ss my -sr LocalMachine -sky exchange -eku 1.3.6.1.5.5.7.3.1,1.3.6.1.5.5.7.3.2 -in "SecondaryServerRootCA" -is root -ir LocalMachine -sp "Microsoft RSA SChannel Cryptographic Provider" -sy 12 SecondaryServer.cer
-
- Copy the PrimaryServerRootCA.cer file from the makecert directory on the PrimaryServer to the makecert directory on the SecondaryServer
- Copy the SecondaryServerRootCA.cer file from the makecert directory on the SecondaryServer to the makecert directory on the PrimaryServer
- Open a command prompt on the PrimaryServer (not powershell) and run the following commands in the makecert directory
-
certutil -addstore -f Root "SecondaryServerRootCA.cer"
-
reg add "HKLMSOFTWAREMicrosoftWindows NTCurrentVersionVirtualizationReplication" /v DisableCertRevocationCheck /d 1 /t REG_DWORD /f
-
reg add "HKLMSOFTWAREMicrosoftWindows NTCurrentVersionVirtualizationFailoverReplication" /v DisableCertRevocationCheck /d 1 /t REG_DWORD /f
-
- Open a command prompt on the SecondaryServer (not powershell) and run the following commands in the makecert directory
-
certutil -addstore -f Root "PrimaryServerRootCA.cer"
-
reg add "HKLMSOFTWAREMicrosoftWindows NTCurrentVersionVirtualizationReplication" /v DisableCertRevocationCheck /d 1 /t REG_DWORD /f
-
reg add "HKLMSOFTWAREMicrosoftWindows NTCurrentVersionVirtualizationFailoverReplication" /v DisableCertRevocationCheck /d 1 /t REG_DWORD /f
-
- You can now follow the steps here: http://technet.microsoft.com/en-us/library/jj134207.aspx to set up Hyper-V Replica on Windows Server 2012 (skip over the SSL certificate stuff, you just did that). Ignore the Hyper-V Replica Broker detail. If you’re clever enough to be setting up a Hyper-V Replica Cluster with a Broker, you don’t need to be reading this guide 😉
- For the rest of us, proceed as follows:
- http://technet.microsoft.com/en-us/library/jj134153.aspx – Prepare to Deploy Hyper-V Replica (skip sections 1.4 and 1.5).
- http://technet.microsoft.com/en-us/library/jj134240.aspx – Enable Replication (skip section 2.2)
- http://technet.microsoft.com/en-us/library/jj134165.aspx – Test the Replication Deployment
- http://technet.microsoft.com/en-us/library/jj134194.aspx – Perform a Planned Failover
- http://technet.microsoft.com/en-us/library/jj134169.aspx – Respond to an Unplanned Failover
- For the rest of us, proceed as follows: