LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Time Sync Issues - Clock Drift Way Off - CentOS 5.2, VMware 1.0.8, Plesk CP 8.6.0 (https://www.linuxquestions.org/questions/linux-server-73/time-sync-issues-clock-drift-way-off-centos-5-2-vmware-1-0-8-plesk-cp-8-6-0-a-708399/)

bskrakes 03-01-2009 12:11 PM

Time Sync Issues - Clock Drift Way Off - CentOS 5.2, VMware 1.0.8, Plesk CP 8.6.0
 
Good morning all, or afternoon depending on where you are!

I have a very strange issue and I have searched Google many, many times now to try and find a solution but I have had little success. I have learned a few things but not how to solve my problem.

So I am running a host machine with CentOS 5.2 and it currently is running VMware Server 1.0.8. My Virtual Machine is running CentOS 5.2 as well with Parallels Plesk Control Panel 8.6.0. My VM-Guest server time is way out of whack. I have tired using the ntpd server option in the Plesk Control Panel and have had zero luck. I have also tried configuring my NTPD service but the drift time is way, way out (I don't really want to do this anyway as Plesk seems to have all of its own modules). I cannot post the data as I did not save it how ever I am willing to go through all of the process again if someone should need me to. I also have made the entry in my VM-Guest .vmx config file for VMware-Tools to set the time sync to true:

Quote:

tools.syncTime = "TRUE"
At this point I am thinking about creating a new Virtual Machine and seeing what happens. I really rather not do this but I have searched high and low but cannot figure out why my VM-CentOS-5.2 time is so far out. I don't think is has to do with VMware so much as it seems to be the actual server itself, maybe a Kernel issue?

Any help would be greatly appreciated, thank you in advance!

acid_kewpie 03-01-2009 12:26 PM

I've had plenty of issues with clocks under vmware. One thing you should avoid is ntpd as you've found, so stay clear of that and trust the host clock. The main thing I play with is the clock type under the guest, using clock=pit on the kernel line, as well as often wanting to disable acpi (acpi=off), add noapic and also possibly nosmp.

TBC Cosmo 03-01-2009 12:26 PM

In grub.conf add to kernel line: 'clock=pit'
At command prompt, type: 'hwclock=systohc '

Whoops, beaten to the punch

bskrakes 03-01-2009 01:28 PM

Right on, I will check into that ASAP - just finished a late breakfast and now I have to hit the shower... Once I have tired I will post back... Probably within the next couple of hours, thank you both!

bskrakes 03-01-2009 02:12 PM

So my grub.conf looks like this:

Quote:

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol01
# initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-92.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-92.el5 ro root=/dev/VolGroup00/LogVol01 rhgb quiet
initrd /initrd-2.6.18-92.el5.img
Where and how should I add the:
Quote:

clock=pit
I don't want to mess up this machine as its my production server...

TBC Cosmo 03-01-2009 02:39 PM

Change
Code:

kernel /vmlinuz-2.6.18-92.el5 ro root=/dev/VolGroup00/LogVol01 rhgb quiet
to
Code:

kernel /vmlinuz-2.6.18-92.el5 ro root=/dev/VolGroup00/LogVol01 rhgb quiet clock=pit

bskrakes 03-01-2009 03:42 PM

Yes! Thank you both, your solution seems to have fixed my problem.

I probably should have looked first but what exactly does the "clock=pit" do to your kernel/system?

TBC Cosmo 03-01-2009 04:50 PM

My understanding is that this causes the kernel to use a different timer than the default, which tries to compensate for lagging behind the hardware clock. In a VM, this seems to cause a wild advance in system time compared to actual time. So the pit timer seems to be a less aggressive reference.

bskrakes 03-01-2009 07:06 PM

Bad news, that didn't actually help... My server is still jumping into the future... So what else should I try, "acpi=off" ???

Currently:
Quote:

kernel /vmlinuz-2.6.18-92.el5 ro root=/dev/VolGroup00/LogVol01 rhgb quiet clock=pit
Suggested:
Quote:

kernel /vmlinuz-2.6.18-92.el5 ro root=/dev/VolGroup00/LogVol01 rhgb quiet clock=pit acpi=off
Just to confirm that is all I should have to add and hope that it helps...

bskrakes 03-01-2009 07:30 PM

Okay so this is what I tried and the time is still drifting into the future:

Quote:

kernel /vmlinuz-2.6.18-92.el5 ro root=/dev/VolGroup00/LogVol01 rhgb quiet clock=pit acpi=off noacpi
Anything else I can try?

bskrakes 03-01-2009 08:54 PM

VMware Server Time Drift - Host CPUSPEED
 
Alright so here is what I found after a full day of searching, reading and learning... I found the following site http://drakkhen.net/posts/2009/01/20...vmware_guests/ and it appears to have the fix I needed for my situation. Thanks to a service called "cpuspeed" I spent my day trying to fix the kernel of the VM-Guest rather than looking at the host, maybe I should have been trying all of the above in the host and not the guest??

So what I did: (on the host machine)
Quote:

[root@server ~]# service cpuspeed status
cpuspeed is running
[root@server ~]# service cpuspeed stop
cpuspeed is stopped
[root@server ~]# chkconfig cpuspeed off
[root@server ~]# shutdown -r now
The guest VM now seems to be keeping time. I still have set the value of time sync in the .vmx file to the following:

Quote:

tools.syncTime = "TRUE"
I think that did it, I will post back if the situation should change. Thank you all for you help!

Cheers

PS: this program/service "cpuspeed" is designed to save energy when the computer is idle, EXAMPLE why would you need 3.0GHz of processing power to read a PDF??? You don't need that much power to read... so that's where the program/service "cpuspeed" kicks in. As the poster said "I probably wasted more power and caused more pollution from using Google for 3 hours straight." On be half of him and my self I hope his post and mine helps a few more people!

acid_kewpie 03-02-2009 02:53 AM

cool, btw it was noapic, not noapci.

bskrakes 03-02-2009 01:21 PM

Ok, I might go back and try that as the cpuspeed does conserve power when its not needed, its kind of silly to disable it. The other issue is I was unclear where I should be making the changes, on the Host or the Guest? I tried all of the above minus the type O on the Guest machine, should I have been modifying the Hosts Kernel?

TBC Cosmo 03-02-2009 01:38 PM

I doubt the host kernel needs to be modified. Possibly try ntp in conjunction with the new timer setting.


All times are GMT -5. The time now is 01:20 AM.