dinsdag 13 januari 2009

Fixing Timedrift In debian VM-Ware Virtual machines

Hi All

I had debian server who had 30 sec+ timedrift per minute
As a consequence certain cron jobs where passed over. (cron job scheduled at 17:00 and server jumps from instance from 16:59:47 to 17:00:29, missing the 17:00 slot)

Fixing it ended up being not that hard to actually do. figuring out how to was. Note that You do need a recent kernel that supports clocksource in order to do this.

First off set the ntp for both the host and the vm to the same source by editing the /etp/ntp.conf file

Stop the Virtual Machine
on the host machine search for your VM's .vmx file. Open it in an editor (i use nano)

search for the tools.SyncTime string, it should be set to FALSE, change it to TRUE

Next start up the Virtual Machine again and look for the file /boot/grub/menu.lst

and edit the line for the kernel you boot into
kernel /boot/vmlinuz-2.6.18-5-686 root=/dev/sda1 ro clocksource=pit nosmp noapic nolapic nohz=off

reboot the machine and the time offset should be greatly reduced (a couple of microseconds for me)

Geen opmerkingen: