Skip to contentSkip to conversation

system time

DISCUSSION Farkas Levente 5 participants 12 messages Sep 26, 2007 – Sep 27, 2007 9 messages not in the archive KVM

lore
Share & tools
lore
#0 lore raw

hi,
there is a strange thing which is just noticed. on our kvm host there is a ntpd running and synchronize to some time server and it's time is valid. so i decided that i won't run ntpd on the guest vms since if the host has the right time probably the guest see the same time. but that's not the case! there is almost a minute difference between the host and the guests (all guest has different time). shouldn't the guest see the host as it's base/bios time? or how it's working? it'd be better to run ntpd on all guest? why?

Signature · 6 lines
  Levente                               "Si vis pacem para bellum!"

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw

Frakas, I just noticed the same thing. This never used to be the case though as usually they would be exactly the same time.

Quoted 14 lines · Farkas Levente

hi,
there is a strange thing which is just noticed. on our kvm host there is a ntpd running and synchronize to some time server and it's time is valid. so i decided that i won't run ntpd on the guest vms since if the host has the right time probably the guest see the same time. but that's not the case! there is almost a minute difference between the host and the guests (all guest has different time). shouldn't the guest see the host as it's base/bios time? or how it's working? it'd be better to run ntpd on all guest? why?

--
Levente "Si vis pacem para bellum!"

Quoted 9 lines

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
kvm-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

_______________________________________________
kvm-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel

A message that is not in the archive (sent off-list or not yet received): b75785ba0709260640v5ef01ca7tff94ec7c8dad44cf-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#4 lore raw

I know I'm not crazy.. now my host and guest clocks are in sync. I'll leave the guest running for a while and see if it eventually goes ahead of host.

Quoted 33 lines · Haydn Solomon

Frakas, I just noticed the same thing. This never used to be the case though as usually they would be exactly the same time.

Quoted 26 lines · Farkas Levente

hi,
there is a strange thing which is just noticed. on our kvm host there is

a ntpd running and synchronize to some time server and it's time is valid. so i decided that i won't run ntpd on the guest vms since if the host has the right time probably the guest see the same time. but that's

not the case! there is almost a minute difference between the host and the guests (all guest has different time). shouldn't the guest see the host as it's base/bios time? or how it's working? it'd be better to run ntpd on all guest? why?

--
Levente "Si vis pacem para bellum!"

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
kvm-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

_______________________________________________
kvm-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel

A message that is not in the archive (sent off-list or not yet received): b75785ba0709260702rb69ab8bldaba9793332223e7-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#6 lore raw
Quoted 4 lines · Haydn Solomon

I know I'm not crazy.. now my host and guest clocks are in sync. I'll leave the guest running for a while and see if it eventually goes ahead of host.

Please do this both with and without -no-kvm-irqchip. The code paths are very different.

Signature · 7 lines
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

A message that is not in the archive (sent off-list or not yet received): 46FB7B0B.5050907-atKUWr5tajBWk0Htik3J/[email protected]

#8 lore raw
Quoted 8 lines · Avi Kivity
Quoted 4 lines · Haydn Solomon

I know I'm not crazy.. now my host and guest clocks are in sync. I'll leave the guest running for a while and see if it eventually goes ahead of host.

Please do this both with and without -no-kvm-irqchip. The code paths are very different.

the simple question does all the guest must be the same system time as the host? and if it's not the case then it's a bug? or it can happened with reason?

Signature · 6 lines
  Levente                               "Si vis pacem para bellum!"

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

A message that is not in the archive (sent off-list or not yet received): [email protected]

#10 lore raw
Quoted 9 lines · Farkas Levente
Quoted 7 lines · Avi Kivity
Quoted 5 lines · Haydn Solomon

I know I'm not crazy.. now my host and guest clocks are in sync. I'll leave the guest running for a while and see if it eventually goes ahead of host.

Quoted 8 lines
Quoted 3 lines

Please do this both with and without -no-kvm-irqchip. The code paths are very different.

the simple question does all the guest must be the same system time as the host? and if it's not the case then it's a bug? or it can happened with reason?

Difficult to say. I think that some drift is inevitable as the guest and host will calibrate differently.

Signature · 7 lines
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

A message that is not in the archive (sent off-list or not yet received): 46FB7DFF.6020102-atKUWr5tajBWk0Htik3J/[email protected]

#12 lore raw
Quoted 13 lines · Avi Kivity
Quoted 12 lines · Farkas Levente
Quoted 10 lines · Avi Kivity
Quoted 5 lines · Haydn Solomon

I know I'm not crazy.. now my host and guest clocks are in sync. I'll leave the guest running for a while and see if it eventually goes ahead of host.

Please do this both with and without -no-kvm-irqchip. The code paths are very different.

Quoted 7 lines
Quoted 4 lines

the simple question does all the guest must be the same system time as the host? and if it's not the case then it's a bug? or it can happened with reason?

Difficult to say. I think that some drift is inevitable as the guest and host will calibrate differently.

in the current version or even in long term?
this means it's better to run ntpd on all guests even if it's running on the host:-((

Signature · 6 lines
  Levente                               "Si vis pacem para bellum!"

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

A message that is not in the archive (sent off-list or not yet received): [email protected]

#14 lore raw

2007/9/27, Farkas Levente <[email protected]>:

Quoted 19 lines
Quoted 18 lines · Avi Kivity
Quoted 16 lines · Farkas Levente
Quoted 10 lines · Avi Kivity
Quoted 5 lines · Haydn Solomon

I know I'm not crazy.. now my host and guest clocks are in sync. I'll leave the guest running for a while and see if it eventually goes ahead of host.

Please do this both with and without -no-kvm-irqchip. The code paths are very different.

the simple question does all the guest must be the same system time as the host? and if it's not the case then it's a bug? or it can happened with reason?

Quoted 6 lines
Quoted 2 lines

Difficult to say. I think that some drift is inevitable as the guest and host will calibrate differently.

in the current version or even in long term?
this means it's better to run ntpd on all guests even if it's running on the host:-((

To be fair, this problem is not kvm related but also exists on other solutions, such as vmware esx (check their knowledge base article ID1420).

HTH,
Gildas

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

#15 lore raw
In reply to a message not in the archive
Quoted 25 lines · Farkas Levente
Quoted 23 lines · Avi Kivity
Quoted 21 lines · Farkas Levente
Quoted 13 lines · Avi Kivity
Quoted 6 lines · Haydn Solomon

I know I'm not crazy.. now my host and guest clocks are in sync. I'll leave the guest running for a while and see if it eventually goes ahead of host.

Please do this both with and without -no-kvm-irqchip. The code paths are very different.

the simple question does all the guest must be the same system time as the host? and if it's not the case then it's a bug? or it can happened with reason?

Quoted 6 lines
Quoted 3 lines

Difficult to say. I think that some drift is inevitable as the guest and host will calibrate differently.

in the current version or even in long term?

It's a fundamental issue due to how PCs do time. They run a calibration look during bootup, and if that's not 100% accurate, dirft will occur.

For the long term the solution is paravirtualized time.

Quoted 3 lines

this means it's better to run ntpd on all guests even if it's running on the host:-((

I think there are issues with running ntp on the guest due to tsc being very inaccurate on virtualized guests.

Signature · 7 lines
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

A message that is not in the archive (sent off-list or not yet received): 46FB80D8.7060308-atKUWr5tajBWk0Htik3J/[email protected]

#17 lore raw
Quoted 6 lines · Avi Kivity
Quoted 3 lines

this means it's better to run ntpd on all guests even if it's running on the host:-((

I think there are issues with running ntp on the guest due to tsc being very inaccurate on virtualized guests.

does this means itás not possible to run a guest with accurate time?

Signature · 6 lines
  Levente                               "Si vis pacem para bellum!"

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

A message that is not in the archive (sent off-list or not yet received): [email protected]

#19 lore raw
Quoted 6 lines · Farkas Levente
Quoted 4 lines · Avi Kivity
Quoted 4 lines

this means it's better to run ntpd on all guests even if it's running on the host:-((

Quoted 7 lines
Quoted 3 lines

I think there are issues with running ntp on the guest due to tsc being very inaccurate on virtualized guests.

does this means itás not possible to run a guest with accurate time?

Time should be mostly accurate. Running ntpdate every hour or so should make it even better. For exact timekeeping a paravirtualized device (or a mainframe) is necessary.

Signature · 7 lines
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
#20 lore raw
In reply to a message not in the archive
Quoted 6 lines · Farkas Levente
Quoted 4 lines · Avi Kivity
Quoted 4 lines

this means it's better to run ntpd on all guests even if it's running on the host:-((

Quoted 7 lines
Quoted 3 lines

I think there are issues with running ntp on the guest due to tsc being very inaccurate on virtualized guests.

does this means itás not possible to run a guest with accurate time?

You can try cron job like this:

15,30,45 * * * * ntpdate 'some time server' > /dev/null 2>&1

To use ntpdate, ntpd must not run. Adjust frequency of time sync accordingly

Of course, it would be nice to implement something in kvm to help guest sync up with host.

Simon

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/