Sometimes you want to separate the replication traffic from your regular LAN NIC so it won’t eat that precious bandwidth.
So if you want to enable replication between two Windows 2012 R2 hyper-v host servers using a dedicated separate NIC and a self signed SSL certificate, read on!
The reason we are using SSL certificates is because kerberos (domain auth) would not work on our dedicated NIC because it is not present in our domain network (LAN).
In short, these are the steps necessary to accomplish this:
- Configure your two NIC’s and connect them directly to each other with a crossed or straight UTP cable.
- If you are using this to replicate your servers over a WAN link or another site, it is the same principle but they need to be able to reach each-other.
- Create self signed certificates on each host server
- Import the self signed certificates from one host server into the other
- Make modifications to your hosts file so the servername.fqdn are resolved to the IP’s you configure in step 1.
- Enable replication in the Hyper-V server using a certificate instead of kerberos
- Test
1): In this example I have two hyper-v servers, HV01.fqdn and HV02.fqdn, both domain joined. HV01 is using 172.16.0.1/24 as IP address and HV is using 172.16.0.2/24 for their dedicated replication NIC. Both are directly connected with a crossed cable.
2): To create the SSL cert you need to install the Windows Software Development Kit (SDK) for Windows 8, that includes the makecert.exe utilty. Install this on both hyper-v host servers.
You can download it here: https://msdn.microsoft.com/en-us/windows/desktop/hh852363.aspx You only need the Windows Software Developtment Kit (about 80Mb):
![[image%255B3%255D.png]](https://i2.wp.com/lh3.googleusercontent.com/-g6zNS7QtrHw/UbmT4Fe_J1I/AAAAAAAAA4E/ziI5Ltd3PSs/s1600/image%25255B3%25255D.png)
On HV01 open an elevated command prompt and navigate to C:\Program Files (x86)\Windows Kits\8.0\bin\x64 and run the following commands:
- makecert -pe -n “CN=HV01RootCA” -ss root -sr LocalMachine -sky signature -r “HV01RootCA.cer”
- makecert -pe -n “CN=HV01.yourFQDN” -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 “HV01RootCA” -is root -ir LocalMachine -sp “Microsoft RSA SChannel Cryptographic Provider” -sy 12 HV01-replication.cer
- both certificates will be in C:\Program Files (x86)\Windows Kits\8.0\bin\x64 and are also imported in the appropiate certifica stores on the local computer
On HV02 open an elevated command prompt and navigate to C:\Program Files (x86)\Windows Kits\8.0\bin\x64 and run the following commands:
- makecert -pe -n “CN=HV02RootCA” -ss root -sr LocalMachine -sky signature -r “HV02RootCA.cer”
- makecert -pe -n “CN=HV02.yourFQDN” -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 “HV01RootCA” -is root -ir LocalMachine -sp “Microsoft RSA SChannel Cryptographic Provider” -sy 12 HV02-replication.cer
- both certificates will be in C:\Program Files (x86)\Windows Kits\8.0\bin\x64 and are also imported in the appropiate certifica stores on the local computer
Copy HV01RootCA.cer into C:\Program Files (x86)\Windows Kits\8.0\bin\x64 on HV02 and HV02RootCA.cer into HV01.
3): Import of the certificates:
ON HV01, still in the same elevated prompt, issue the following command:
- certutil -addstore -f Root “HV02RootCA.cer”
- reg add “HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Virtualization\Replication” /v DisableCertRevocationCheck /d 1 /t REG_DWORD /f
- if you get an error: invalid key name, just change it manually via regedit, the value should be 1
- reg add “HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Virtualization\FailoverReplication” /v DisableCertRevocationCheck /d 1 /t REG_DWORD /f
ON HV02, still in the same elevated prompt, issue the following command:
- certutil -addstore -f Root “HV01RootCA.cer”
- reg add “HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Virtualization\Replication” /v DisableCertRevocationCheck /d 1 /t REG_DWORD /f
- if you get an error: invalid key name, just change it manually via regedit, the value should be 1
- reg add “HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Virtualization\FailoverReplication” /v DisableCertRevocationCheck /d 1 /t REG_DWORD /f
4): Modify your host files (c:\windows\system32\drivers\etc\hosts) on both servers:
On HV01 this should be:
172.16.0.2 HV02.yourfqdn
172.16.0.2 HV02
On HV02 this should be:
172.16.0.1 HV01.yourfqdn
172.16.0.1 HV01
5): Setup Hyper-v replication between the two servers:
Go to you Hyper-V setiings on HV01, under the replication configuration do the following config:
- Enable this computer as a replica server
- use cert
- click on select cert, and now you will be prompted with the following, click OK:
.jpg)
Do the same on HV02.
Now you can enable replication for a particular VM, right click VM -> replication -> follow the wizard and watch the traffic flow over your dedicated NIC instead of you LAN NIC.
