On vSphere ESXi 7.0 U3 and later, configuring NTP via text file shows "NTP not synchronized"
search cancel

On vSphere ESXi 7.0 U3 and later, configuring NTP via text file shows "NTP not synchronized"

book

Article ID: 313810

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

  • Error "NTP not synchronized"
  • /etc/ntp.conf file is manually modified on the ESXi Host

Environment

  • VMware vSphere ESXi 7.x
  • VMware vSphere ESXi 8.x

Cause

Starting with ESXI 7.0 Update 3, the /etc/ntp.conf file must not be edited manually when configuring NTP on an ESXi host. Key parameters can be configured through the UI and/or command line.
For more information, see vSphere ESXi 7.0 U3 and later versions configuration files for NTP and PTP can no longer be edited

Resolution

To configure specific parameters for NTP on ESXi 7.0 U3 and later versions, the ESXi NTP configuration file must be loaded using the esxcli command rather than editing /etc/ntp.conf directly.

Example:

  1. Create an ntpconfig file using vi editor.

    [root@<esxi_host>:~] vi /scratch/ntpconfig.txt

  2. Press i to insert.
  3. Enter the below information in the file:

    server <ntpserver.yourdomain.com>
    tos maxdist 30

  4. Press the esc key and type :wq! to exit vi editor.
  5. To verify the file has been updated correctly, use the below command.

    [root@<esxi_host>:~] cat /scratch/ntpconfig.txt


    The output of the command above should look like below:

    server ntpserver.yourdomain.com

    tos maxdist 30

  6. Enter the below command to update the NTP configuration using the file created above.

    [root@<esxi_host>:~] esxcli system ntp set -f /scratch/ntpconfig.txt

  7. Run the below command to enable the NTP service.

    [root@<esxi_host>:~] esxcli system ntp set -e 1