-1

We have VM which is using ntp client for syncing time. Following is my config. My question is do i need server 127.127.1.0 # local clock line in client ntp.conf file? if yes then why?

# Permit time synchronization with our time source, but do not
# permit the source to query or modify the service on this system.
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
# Permit all access over the loopback interface.
restrict 127.0.0.1
restrict -6 ::1
server ntp1.example.com
server ntp2.example.com
# Undisciplined Local Clock. This is a fake driver intended for backup
# and when no outside source of synchronized time is available.
server  127.127.1.0     # local clock
fudge   127.127.1.0 stratum 10
driftfile /var/lib/ntp/drift
Satish
  • 16,544
  • 29
  • 93
  • 149
  • It is all in the comments: it is intended as a fallback source (the stratum = 10 means: low-quality, not-preferred) You can check your actual clock sources with `ntpdc -p` , which also has a fine manual page. – wildplasser Jan 31 '13 at 19:31
  • Do i really need that in my Client side? – Satish Jan 31 '13 at 20:17
  • I don't know the peculiarities of VMs; on normal machines, having a bad-stratum local clock as a fallback device is not that bad, especially once the drift has been settled. But maybe on VMs the writes to the HW-clock(about avery 20 minutes)are not persistent or just plain wrong. In any case : network clock sources will always be needed (and preferred once they are present) – wildplasser Jan 31 '13 at 23:20

1 Answers1

7

NTP Recommendations

Note: VMware recommends you to use NTP instead of VMware Tools periodic time synchronization. NTP is an industry standard and ensures accurate time keeping in your guest. You may have to open the firewall (UDP 123) to allow NTP traffic.

This is a sample /etc/ntp.conf

tinker panic 0
restrict 127.0.0.1
restrict default kod nomodify notrap
server 0.vmware.pool.ntp.org
server 1.vmware.pool.ntp.org
server 2.vmware.pool.ntp.org
driftfile /var/lib/ntp/drift

This is a sample (RedHat specific) /etc/ntp/step-tickers:

0.vmware.pool.ntp.org
1.vmware.pool.ntp.org

The configuration directive tinker panic 0 instructs NTP not to give up if it sees a large jump in time. This is important for coping with large time drifts and also resuming virtual machines from their suspended state.

Note: The directive tinker panic 0 must be at the top of the ntp.conf file.

It is also important not to use the local clock as a time source, often referred to as the Undisciplined Local Clock. NTP has a tendency to fall back to this in preference to the remote servers when there is a large amount of time drift.

An example of such a configuration is:

server 127.127.1.0
fudge 127.127.1.0 stratum 10

Comment out both lines.

After making changes to NTP configuration, the NTP daemon must be restarted. Refer to your operating system vendor’s documentation.

Source: VMWare Knowledge Base

Koen.
  • 25,449
  • 7
  • 83
  • 78
Satish
  • 16,544
  • 29
  • 93
  • 149
  • Maybe you could mention `tos orphan 10` as a fallback to the old local (undisciplined) setup... Newer versions of NTP all support that option. – Alexis Wilke Jun 21 '21 at 05:29