Linux ntp time Offset on Xen VM incorrect



I noticed that one of our VM's clocks wasn't being updated correctly on Linux CentOS VM that we are running on a XenServer. I did a number of things to confirm that NTP was updating, but for whatever reason, the clock still came up with a high offset (18+ seconds). After a lot of searching I found that by default, the VM's clocks are synchronized to the HOST clock running on the control domain, and cannot be independently changed. This was surprising to me because NTP was still configured and appeared able to synchronize the clocks.

This makes sense from a CPU saving standpoint, as only one server really needs to be running the NTP service, so long as all VM's can update their clocks off of it. If you want to override this setting, just add the following line to your /etc/sysctl.conf file

# Allow the VM to update it's own clock, and do not use the DOM host clock.

and then restart networking
service networking restart

Good luck!

Members online