Categories
linux Microsoft

How to setup time synchronization on servers

In Hyper-V virtualization, a guest virtual machine has something called “Integration Services.” By default, all of these services are pretty much enabled, including time synchronization. However, this can cause big issues if you have virtual Domain Controllers, and your physical host servers are not getting their time from a common, reliable source, such as an external NTP server like 0.us.pool.ntp.org1.nl.pool.ntp.org, etc.

In particular, if a virtual host is running a guest Domain Controller (DC), then the DC will be getting its time from the clock of the physical Hyper-V server at start-up.

Keep only one time authority

There should be only one time authority on the network, which in turn should be synchronized with a reliable NTP server. Hencem, we up our virtual Domain Controller (DC01) to sync with an outside NTP server, and then set other DC02 to refer to the primary DC only.

To see what our server (DC01/DC02) is using as it’s time authority use:

C:\>w32tm /query /source

Disable time synchronization for both Domain Controller VM’s

Hyper-V Manager > Virtual Machine > Settings > Integration Services:

Integration Services
Integration Services Time Synchronization

Set time sync for your Domain Controllers

Next, on your DC01, reset the time authority. Microsoft offers a fix that helps you set an external time source such as “0.us.pool.ntp.org” .

C:\>w32tm /config /syncfromflags:manual /manualpeerlist:"0.us.pool.ntp.org 1.nl.pool.ntp.org" /reliable:yes /update

C:\>Net stop w32time

C:\>Net start w32time

C:\>w32tm /resync /force

Set Hyper-V physical servers to sync time to domain controllers (DC01/DC02)

Take Remote desktop connection to Hyper-V serves (HV01/HV02)

C:\>w32tm /config /syncfromflags:manual /manualpeerlist:"DC01.swatantra.info DC02.swatantra.info" /reliable:yes /update
The command completed successfully.  

C:\>Net stop w32time
The Windows Time service is stopping.
The Windows Time service was stopped successfully. 

C:\>Net start w32time
The Windows Time service is starting.The Windows Time service was started successfully. 

C:\>w32tm /resync /force
Sending resync command to local computerThe command completed successfully.
'Coz sharing is caring
Categories
Apache linux

openssl create cert

Openssl is a handy utility to create self-signed certificates. You can use OpenSSL on all the operating systems such as Windows, MAC, and Linux flavors.

openssl req -new > cert.csr  openssl rsa -in privkey.pem -out key.pem  openssl x509 -in cert.csr -out cert.pem -req -signkey key.pem -days 1001  echo key.pem>>cert.pem
'Coz sharing is caring