Accurate time synchronization is critical in VMware environments for tasks like logging, auditing, cluster synchronization, and troubleshooting. VMware ESXi uses NTP to synchronize time with external servers. In this guide, we’ll walk through the steps to configure, test, and troubleshoot NTP on ESXi.
Configuring NTP on ESXi Using vSphere Client
Steps to Configure NTP:
- Log in to the vSphere Client:
Open the vSphere Client and connect to your vCenter Server. - Navigate to the Host Settings:
- Select the ESXi host from the inventory.
- Go to Host > Configure > System > Time Configuration.
- Edit Time Configuration:
- Click Edit in the Time Configuration section.
- Select Use Network Time Protocol (Enable NTP).
- Add the NTP server addresses (e.g.,
time.google.com
,pool.ntp.org
). - Ensure the NTP service is set to Start and Stop with Host.
- Start the NTP Service:
- Go to Services under the Host settings.
- Locate the NTP Daemon (ntpd) service and click Start.
Tips:
- Use at least two NTP servers for redundancy.
- Ensure the ESXi host can reach the NTP servers over the network.
Configuring NTP via the ESXi Host Client
If you’re managing a standalone ESXi host:
- Log in to the ESXi Host Client.
- Navigate to Manage > System > Time & Date.
- Click Edit Settings and enter the NTP servers.
- Enable the Start and Stop with Host option for the NTP service.
- Save the settings and manually start the NTP service.
esting NTP Configuration
1. Verify NTP Status:
Use the vSphere Client or Host Client to check the NTP service status under the Services section.
2. Test NTP via CLI:
SSH into the ESXi host and run:
ntpq -p
This command shows the NTP peer list and synchronization status. Look for:
- Remote: The NTP server.
- Offset: Time difference between the host and the NTP server.
- Reach: Indicates whether the server is reachable.
3. Check System Time:
Run the following command to verify the host’s current time:
date
Troubleshooting NTP Issues
1. Verify Network Connectivity:
Ensure the ESXi host can reach the NTP server.
- Use
ping
ornc
to test connectivity:
ping <ntp_server>
nc -zv <ntp_server> 1232. Check Firewall Rules:
- Ensure port 123/UDP is open on the host and between the ESXi host and the NTP server.
3. Review NTP Logs:
- Check the NTP service logs on the ESXi host:
cat /var/log/ntp.log
4. Restart NTP Service:
If synchronization issues persist, restart the NTP service:
/etc/init.d/ntpd restart
5. Verify Time Drift:
- Check if the host’s hardware clock is out of sync using:
hwclock --show
- Check if the host’s hardware clock is out of sync using: