NTPD howto?

This is a discussion on NTPD howto? within the Linux Networking forums, part of the Linux Forums category; I can't figure ntpd out. I've got it configured ( using the defaults ) on a fedora 8 box. It ...


Go Back   Usenet Forums > Linux Forums > Linux Networking

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 6 Days Ago
Jack Snodgrass
 
Posts: n/a
Default NTPD howto?


I can't figure ntpd out.

I've got it configured ( using the defaults ) on a fedora 8 box.

It starts and runs... it just doesn't keep my non-stable-clock system up
to date. If I let my vmware guest run for 24 hours, the time on the
vmware guest gets off by about 2 hours.

Currently, I have ntpd disabled and I have a cron job that runs every
minute and runs ntpdate to keep the time accurate...

I thought that ntpd was supposed to be able to do this....

If ntpd can't keep the time on the local box accurate... what's the
purpose of it? I've had this issue with ntpd for years... I've always
had to resort to disableing it and running ntpdate from cron.

Thanks - jack


--
D.A.M. - Mothers Against Dyslexia

see http://www.jacksnodgrass.com for my contact info.

jack - Grapevine/Richardson
Reply With Quote
  #2 (permalink)  
Old 6 Days Ago
Chris Davies
 
Posts: n/a
Default Re: NTPD howto?

Jack Snodgrass <jacks_temp_id_blue62@verizon.net> wrote:
> I can't figure ntpd out.
> I've got it configured ( using the defaults ) on a fedora 8 box.


> It starts and runs... it just doesn't keep my non-stable-clock system up
> to date. If I let my vmware guest run for 24 hours, the time on the
> vmware guest gets off by about 2 hours.


OK. Stop there.

You cannot use ntp reliably within a vmware environment and expect it
to work [1]. Separate the two problem spaces and get NTP working on your
real box, first.


> Currently, I have ntpd disabled and I have a cron job that runs every
> minute and runs ntpdate to keep the time accurate...


That will never train your kernel to keep time reliably. Go back to
running NTP and we'll work through the issues with you. For a start,
after NTP has been running for several minutes (more than five), what
does the output of "ntpq -p" give you?

Chris

[1] Actually you can, but you have to set the appropriate kernel flags
and I strongly suggest you don't even think about going there until
you've proven NTP works on your underlying hardware
Reply With Quote
  #3 (permalink)  
Old 6 Days Ago
Unruh
 
Posts: n/a
Default Re: NTPD howto?

Jack Snodgrass <jacks_temp_id_blue62@verizon.net> writes:


>I can't figure ntpd out.


>I've got it configured ( using the defaults ) on a fedora 8 box.


>It starts and runs... it just doesn't keep my non-stable-clock system up
>to date. If I let my vmware guest run for 24 hours, the time on the
>vmware guest gets off by about 2 hours.


>Currently, I have ntpd disabled and I have a cron job that runs every
>minute and runs ntpdate to keep the time accurate...


>I thought that ntpd was supposed to be able to do this....


>If ntpd can't keep the time on the local box accurate... what's the
>purpose of it? I've had this issue with ntpd for years... I've always
>had to resort to disableing it and running ntpdate from cron.


ntp has limitations. If your boxes clock has a huge drift ( above 500PPM)
it cannot fix it. You have a drift of 100000PPM. ntp cannot fix it. You
need new hardware. You simply have very very bad hardware.
I have no idea what you mean "my vmware guest". ntp disciplines the harware
clock on your physical system. It cannot do anything about a virtual
system. The virtual system has no clock. You must run ntp on your physical
system.



>Thanks - jack



>--
>D.A.M. - Mothers Against Dyslexia


>see http://www.jacksnodgrass.com for my contact info.


>jack - Grapevine/Richardson

Reply With Quote
  #4 (permalink)  
Old 6 Days Ago
David Schwartz
 
Posts: n/a
Default Re: NTPD howto?

On May 6, 2:05 am, Jack Snodgrass <jacks_temp_id_blu...@verizon.net>
wrote:

> It starts and runs... it just doesn't keep my non-stable-clock system up
> to date. If I let my vmware guest run for 24 hours, the time on the
> vmware guest gets off by about 2 hours.


This is a vmware-specific issue and has to be fixed with the
appropriate vmware-specific solutions. This has nothing to do with the
stability of any actual clock the ntpd could fix.

> Currently, I have ntpd disabled and I have a cron job that runs every
> minute and runs ntpdate to keep the time accurate...
>
> I thought that ntpd was supposed to be able to do this....


It is, for an actual physical system with a hardware clock of some
kind.

> If ntpd can't keep the time on the local box accurate... what's the
> purpose of it? I've had this issue with ntpd for years... I've always
> had to resort to disableing it and running ntpdate from cron.


You have two conflicting requirements. In general, 'vmware' tries to
make itself invisible, such that the system works the same with or
without vmware. It also tries to present a 'virtual CPU' to the
virtual machine that works the same as a physical CPU.

The problem is this -- sometimes the physical CPU is busy, and vmware
can't give the virtual CPU as many clock cycles in a second as it
normally does. When this happens, it has two choices:

1) Make it seem like the correct amount of actual time has passed, in
which case the virtual machine will know something's wrong -- it
didn't get as many clock cycles per second as it should have.

or

2) Make it seems like less actual time has passed, in which case the
virtual machine will be okay, but its clock will be off.

In many cases, 2 is the better solution. Suppose your physical CPU is
very busy with high-priority tasks and the virtual machine gets no CPU
time at all. What will the effect on that machine be if it's suddenly
5 seconds later in wall clock time and none of the things the virtual
machine expected to do in those past 4 seconds have gotten done?
(Vmware has no idea what the consequences of that might be, so it
doesn't force you to live with them without knowing for sure that
that's a good idea.)

This is a fundamental issue with vm software, and there are many many
ways to deal with it. The one you have chosen is not one of them. ;)

DS
Reply With Quote
  #5 (permalink)  
Old 6 Days Ago
Moe Trin
 
Posts: n/a
Default Re: NTPD howto?

On Tue, 06 May 2008, in the Usenet newsgroup comp.os.linux.networking, in
article <QbVTj.7000$zw.4525@trnddc04>, Jack Snodgrass wrote:

>I can't figure ntpd out.


Well, your subject is slightly wrong - you want to be looking for

-rw-rw-r-- 1 gferg ldp 43295 Nov 18 2005 TimePrecision-HOWTO

but the NTP package should have a lot of documentation in it. What does
'rpm -qd ntp' show you?

>It starts and runs... it just doesn't keep my non-stable-clock system up
>to date.


2030 Simple Network Time Protocol (SNTP) Version 4 for IPv4, IPv6 and
OSI. D. Mills. October 1996. (Format: TXT=48620 bytes) (Obsoletes
RFC1769) (Obsoleted by RFC4330) (Status: INFORMATIONAL)

4330 Simple Network Time Protocol (SNTP) Version 4 for IPv4, IPv6 and
OSI. D. Mills. January 2006. (Format: TXT=67930 bytes) (Obsoletes
RFC2030, RFC1769) (Status: INFORMATIONAL)

There's the basic RFCs. However, the client isn't meant to handle
time errors greater than 500 ppm (about 44 seconds a day). The common
piece of crap oscillator used in computers has a _typical_ worst case
specification of 200 ppm.

>If I let my vmware guest run for 24 hours, the time on the vmware
>guest gets off by about 2 hours.


And there's your problem. You're not running it on real hardware. A
modern operating system keeps track of time in a PC type of system by
using the IRQ 0 interrupt (a divider is programmed to cause a set
number of interrupts per second). In Linux, it depends on how your
kernel was compiled, but this can be 100, 500, or 1000 interrupts
per second. (Run the command 'cat /proc/interrupts' ten seconds apart
to see which yours is running at.) You're running a fake computer
using vmware - so which O/S is supposed to get the IRQ0?

>Currently, I have ntpd disabled and I have a cron job that runs every
>minute and runs ntpdate to keep the time accurate...


You might have better luck running 'hwclock' to set the clock from the
hardware (CMOS) clock, but what-ever.

>I thought that ntpd was supposed to be able to do this....


ntp can handle 500 ppm (0.05%) - not 2/24 (8.33%).

>If ntpd can't keep the time on the local box accurate... what's the
>purpose of it? I've had this issue with ntpd for years... I've always
>had to resort to disableing it and running ntpdate from cron.


Loose the fake computer. What you are seeing is that the kernel is
unable to keep even an approximation of time, mainly because the
mechanism to measure time (those interrupts) are being blocked or
ignored. You _MIGHT_ have better luck using a kernel compiled for
a 100 Hz interrupt, but I really doubt it.

Old guy
Reply With Quote
  #6 (permalink)  
Old 5 Days Ago
Vince Coen
 
Posts: n/a
Default Re: NTPD howto?

Hello Jack!

06 May 08 10:05, Jack Snodgrass wrote to All:


JS> I can't figure ntpd out.

JS> I've got it configured ( using the defaults ) on a fedora 8 box.

JS> It starts and runs... it just doesn't keep my non-stable-clock system
JS> up to date. If I let my vmware guest run for 24 hours, the time on the
JS> vmware guest gets off by about 2 hours.

What happens if you enable ntpd and do not run vmware for 24 hours?
It works fine here but there again I don't run vmware which could be the
problem. Try it without and advise.

Vince


Reply With Quote
  #7 (permalink)  
Old 3 Days Ago
Markus Rehbach
 
Posts: n/a
Default Re: NTPD howto?

Jack Snodgrass wrote:

>
> I can't figure ntpd out.
>
> I've got it configured ( using the defaults ) on a fedora 8 box.
>
> It starts and runs... it just doesn't keep my non-stable-clock system up
> to date. If I let my vmware guest run for 24 hours, the time on the
> vmware guest gets off by about 2 hours.
>


Try to set host.useFastClock = FALSE in /etc/vmware/config. NTPD could
work then.....
Reply With Quote
  #8 (permalink)  
Old 3 Days Ago
Unruh
 
Posts: n/a
Default Re: NTPD howto?

Markus Rehbach <markus.rehbach@gmx.de> writes:

>Jack Snodgrass wrote:


>>
>> I can't figure ntpd out.
>>
>> I've got it configured ( using the defaults ) on a fedora 8 box.
>>
>> It starts and runs... it just doesn't keep my non-stable-clock system up
>> to date. If I let my vmware guest run for 24 hours, the time on the
>> vmware guest gets off by about 2 hours.
>>


>Try to set host.useFastClock = FALSE in /etc/vmware/config. NTPD could
>work then.....


Why in the world would you use ntp in a virtual machine. Use it in the
underlying operating system, and have the virtual machine get its time from
there. As has been pointed out the virtual machine's clock is virtual, and
could be stopped for arbitrarily long times, as the underlying system does
other things.


Reply With Quote
  #9 (permalink)  
Old 2 Days Ago
Markus Rehbach
 
Posts: n/a
Default Re: NTPD howto?

Unruh wrote:

> Why in the world would you use ntp in a virtual machine. Use it in the
> underlying operating system, and have the virtual machine get its time
> from there. As has been pointed out the virtual machine's clock is
> virtual, and could be stopped for arbitrarily long times, as the
> underlying system does other things.


Why? E.g. development of an ISO installation image in a VM with the
requirement to have a functional ntpd after installing the ISO.

Why in the world should it be evil to have a working ntpd in a virtual
machine? I have some with stability=0.000 and a very low offset and I'm
happy with it.

You are right, the clock could be stopped for longer times but it is not
happening here. And you can miss interrupts on real hardware which should
have nearly the same effect for ntpd.

Cheers

Markus
Reply With Quote
  #10 (permalink)  
Old 2 Days Ago
Unruh
 
Posts: n/a
Default Re: NTPD howto?

Markus Rehbach <markus.rehbach@gmx.de> writes:

>Unruh wrote:


>> Why in the world would you use ntp in a virtual machine. Use it in the
>> underlying operating system, and have the virtual machine get its time
>> from there. As has been pointed out the virtual machine's clock is
>> virtual, and could be stopped for arbitrarily long times, as the
>> underlying system does other things.


>Why? E.g. development of an ISO installation image in a VM with the
>requirement to have a functional ntpd after installing the ISO.


Don't expect ntp to work on the virtual machine.


>Why in the world should it be evil to have a working ntpd in a virtual
>machine? I have some with stability=0.000 and a very low offset and I'm
>happy with it.


Who said anything about evil. King Canute was not evil for ordering the
tide not to come in. Stupid perhaps, or incompetent had he then relied on
the tide not coming in in his other plans. Not evil.

That occasionally it works is great. Just do not rely on it.



>You are right, the clock could be stopped for longer times but it is not
>happening here. And you can miss interrupts on real hardware which should
>have nearly the same effect for ntpd.


Yes, and ntp will not work if you loose them too often.


>Cheers


>Markus

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 10:46 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0