Configure Time Sync by NTP for the vCenter

Reading Time: 3 minutes

Configure Time Sync by NTP for the vCenter it is a simple article to configure the vCenter Server to acquire date and time settings by an NTP server.

For all systems and network administrators, a very important task is to maintain all devices with the date and time configurations correct. For some vCenter services to work fine, the date and time need to be OK, in other cases, we can problems with that. Additionally, the log creation can be affected if the date and time are incorrect.

So, definitely, is a very important task to maintain the date and time more accurately as possible!

Configure the Time synchronization on VAMI

As I said in the title of this article “Configure Time Sync by NTP for the vCenter”, open the VAMI console. In this lab, for instance, the VAMI console is:

https://vcenter7.lab.local:5480

Click on the Time menu and then, click on EDIT on the Time synchronization:

On “Mode”, select “NTP”.
On “Time servers”, type the IP of the NTP Server. In this lab, we are using IP 192.168.199.3 as the NTP Server.
After it, click on SAVE:

Now, it is possible to see that the configuration is OK:

To check if the NTP service is working fine, we can open an SSH session to the vCenter Server and run the commands below:

ntpq -p –> Print a list of the NTP peers
ntpq -c assoc –> Print the associations status for each peer

In this lab, the command “ntpq -c assoc” show a lot of interesting information that we will explain below:

reach = yes –> Basically, indicate that the NTP is reachable
condition = sys.peer –> Basically, “sys.peer” is a good signal that the time synchronization it’s OK
last_event = sys_peer –> Basically, The last event of the time synchronization is OK

Configure the Time synchronization on CLI

Open an SSH session to the vCenter Server. For the NTP configuration on CLI, is not necessary to access the bash shell at the moment.

The commands that we will use to configure the NTP on CLI are:

ntp.get –> Used to get if the vCenter server has NTP servers configured
timesync.get –> Used to get the type configuration mode
ntp.set –server 192.168.199.3 –> Used to configure the vCenter Server to get the time information from IP 192.168.199.3

The picture below shows these commands applied in our lab environment:

After it, the vCenter Server has been configured to sync the date and time from NTP 🙂 .

To see more details, you can see the link below:

https://kb.vmware.com/s/article/57146