How To Configure NTP Server for vSphere Lab

Today while working in my lab I was facing an issue where my vSphere Replication appliance was not getting registered to my vCenter server and while troubleshooting I came to find out this is happening because of time difference on my vCenter Server and Replication appliance.

We all know how critical is NTP in vSphere infrastructure as it keep time on all pieces of infrastructure in sync with each other and saves us from common problems that can occur due to time difference on servers.

So I decided to setup NTP server in my home lab. I have read a blog somewhere in past that primary domain controller (PDC) can be configured as NTP server. I have a domain controller in my lab so I followed the following steps to force my PDC to sync its time from internet and later point all my infrastructure servers (vCenter, esxi, replication appliance) to sync its time from my PDC.

By changing the PDC’s time to an external source, the changes will be replicated from the PDC to other clients in your domain; limiting the amount of bandwidth needed to synchronize with an external source.

Follow the below steps to configure external time source on your Primary Domain Controller:

1: Login to your Domain controller and launch Windows PowerShell as administrator

2: Execute below command to configure the domain controller to look at an external time source

# w32tm.exe /config /manualpeerlist:”0.asia.pool.ntp.org 1.asia.pool.ntp.org 2.asia.pool.ntp.org 3.asia.pool.ntp.org” /syncfromflags:manual /reliable:YES /update

ntp-2

Note: The closest time server near you can be located by browsing this page and clicking on the nearest zone:

3: Execute the following command to perform actual time synchronization with the external source

# w32tm.exe /config /update

ntp-3

4: Restart the time service by executing below command

# Restart-Service w32time

ntp-4

5: If you need to view the NTP configuration, execute the following command:

# w32tm /query /configuration

ntp-5

6: For info and debug logging below command can be used which lists the current source, when it last sync’ed etc.

# w32tm /query /status

ntp-6

That’s it. Now you can point all your infrastructure servers to sync their time from your PDC.

Title of this post can be a bit misleading but this is one of the way in which you can keep time on all pieces of your infrastructure in sync.

I hope you enjoyed reading this post. Feel free to share this on social media if it is worth sharing. Be sociable 🙂

One thought on “How To Configure NTP Server for vSphere Lab

Leave a Reply