I've been seeing a bunch of these log messages
Jan 3 00: 58: 57 foo kernel: set_rtc_mmss: can't update from 0 to 58
They occur on CentOS 6.4 VMs running on VMware. I understand it's something to do with the hardware clock not being set properly on the guest OS. I found this command which sets the hardware clock to the current system time:
sudo hwclock --systohc
Is this the correct setting for a virtual machine? Also, where can this be set so it's persistent? In the kernel boot parameters? I'd like for newly provisioned VMs to not have this problem.
me@foo:~> ntpq -p remote refid st t when poll reach delay offset jitter ============================================================================== LOCAL(0) .LOCL. 10 l 43 64 377 0.000 0.000 0.000 +dtc-nist01.ntp. .ACTS. 1 u 174 1024 377 3.311 -8.554 0.497 *nist1-nj.ustimi .ACTS. 1 u 205 1024 377 6.737 3.775 0.433 +nist1-pa.ustimi .ACTS. 1 u 55 1024 377 8.610 4.688 0.337
I see vmwaretools is out of date on this VM. Perhaps the puppet module I have for managing the vmwaretools install did not install it properly. I'll take a look and get back to you.
Yes, vmware tools is installed and at the latest version.
me@foo:~> ps aux | grep vmtools root 56021 0.0 0.1 59508 4156 ? S Jan09 3:29 /usr/sbin/vmtoolsd
I tried enabling the "Synchronize guest time with host" on the VM:
me@foo:~> vmware-toolbox-cmd timesync status Disabled me@foo:~> vmware-toolbox-cmd timesync enable me@foo:~> vmware-toolbox-cmd timesync status Enabled
but I'm still getting those messages. In fact,
hwclock --show are several minutes apart now, whereas they used to be pretty tight.
In the past, older SLES 9 VMs benefited from settings in the VMware article Timekeeping best practices for Linux guests, but it states that CentOS/RHEL 6 guests do not need any additional kernel parameters set.
Upgrading to CentOS 6.5 did not help. The kernel is:
Linux foo 2.6.32-422.214.171.124.1.el6.x86_64 #1 SMP Fri Dec 13 13:06:13 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux