[ntp:questions] Flash 400 on all peers; can't get ntpd to be happy
cswiger at mac.com
Tue Mar 8 19:25:12 UTC 2011
On Mar 8, 2011, at 9:13 AM, Ralph wrote:
> Well along those lines, what about creating a driver or deamon (for
> lack of something better to call it) that provides time to ntpd that
> gets that time from the host machine?
I still haven't been able to figure out which virtualization system you are using, but normally it is better to run ntpd only in the "host ESX" for VMware, Dom0 for Xen, etc. The strong recommendation is to only run ntpd in Dom0 using independent_wallclock set to 0, *unless* your DomU's then fail to keep sane time. See:
"Q: Where does a domain get its time from?
A: Briefly, Xen reads the RTC at start of day and by default will track that with the precision of the periodic timer crystal. Xen's estimate of the wall-clock time can only be updated by domain 0. If domain 0 runs ntpdate, ntpd, etc. then the synchronised time will automatically be pushed down to Xen every minute (and written to the RTC every 11 minutes, just as normal x86 Linux does). All other domains always track Xen's wall-clock time: setting the date, or running ntpd, on these domains will not affect their wall-clock time. Note that the wall-clock time exported by Xen is UTC --- all domains must have appropriate timezone handling (i.e. a correct /etc/localtime file)."
The same thing applies to VMWare, as discussed in:
...except it is controlled by a .vmx config option called "tools.syncTime = true", or possibly "vmware-guestd --cmd 'vmx.set_option synctime 1 1'" in the guest VM. VMWare sometimes seems to encourage people to run ntpd in guest VMs, but I think that is badly flawed advice.
Seriously, each physical machine only has one RTC and crystal oscillator. It's useful to run one instance of ntpd in the Dom0 (or host ESX) context where it can actually work and keep this real hardware clock in sync. Running ntpd's in the other DomUs/guest VMs is almost entirely pointless; it might be useful only if Dom0->DomU time is busted, and even in that case, ntpd is unlikely to ever obtain good time synchronization running in a DomU. You are better off running ntpdate (or sntp) periodically via cron in the DomUs.
More information about the questions