Monday, November 13, 2006

Slow running Linux VM on VMWare ESX?

If your VMWare ESX implementation of a Linux guest OS is running slow... a stop-gap solution may be the following...

Create a script that connects to a reliable time server and retrieves the time:
#!/bin/bash
# Sync HWClock to timeserver.mynetwork.local
/bin/date
/sbin/service ntpd stop
/usr/sbin/ntpdate 192.168.0.50
/sbin/hwclock --systohc
/sbin/service ntpd start
/bin/date
Now, add two entries to crontab:
1 */1 * * * /var/scripts/scheduled/synctime >> /var/log/synctime.log
*/2 * * * * /sbin/hwclock --hctosys


You can certainly adjust the times, this is set to get the real time once an "hour" at the 1. Then sync the OS from the VM hardware clock every 2 minutes.

Sample output of synctime:
Mon Nov 13 16:01:01 EST 2006
Shutting down ntpd: [ OK ]
13 Nov 16:04:46 ntpdate[19413]: step time server 192.168.0.50 offset 223.590418 sec
ntpd: Synchronizing with time server: [FAILED]
Starting ntpd: [ OK ]
Mon Nov 13 16:04:49 EST 2006

There is no individual ownership when you are part of a team, it's the sum of the parts that makes you the RESILIENT team you need to be.