public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* Question on kvm_clock working ...
@ 2011-09-09 15:28 al pat
  2011-09-26 17:47 ` Ronen Hod
  0 siblings, 1 reply; 2+ messages in thread
From: al pat @ 2011-09-09 15:28 UTC (permalink / raw)
  To: qemu-devel, kvm

[-- Attachment #1: Type: text/plain, Size: 2955 bytes --]

We are doing an experiment with kvm-clock to validate its effectiveness,
particularly when running NTP on the host to make sure the host’s clock
stays properly sync.
Our observations leads us to a few unanswered questions, including the
possibility of a bug (our our misunderstanding of how kvm_clock should
work).

Our understanding is that kvm_clock will help sync the clock between the
host and the guest. We do not observe this to happen in reality and thus
this question.

We are using Ubuntu 11.04 on the host and the guest.

The command we issue to launch the VM is the following:

$ sudo kvm -m 500 -rtc clock=host guestos.img

We also arranged for Ubuntu to show the seconds on the clock displayed in
the menu.

Observation 1:
Upon launching the VM, we see a time difference between the 2 clock ranging
from 1 to 2 seconds.

Observation 2:
If we change the date on the host (with a command such as “date --set
10:00:00 AM Sep 9, 2011”), the time on the guest remains the same,
unaffected.

Observation 3:
After running for a while without NTP on the host, we run “ntpdate” to sync
up the host, but the guest stick with whatever previous time.


Another test we will run is to have ntpd on the host and wait for an
extended time to see if the guest drifts away from that original 1 or  2
second lag. In the meantime, we are asking you for some input in this
regards:
Questions
-What does the “–rtc clock” option is supposed to mean exactly?  According
to the man page, the guest should get its time from the host, but neither
date nor an “ntpdate” affected the clock on the guest.
-What are the other options that we should use?

       -rtc [base=utc|localtime|date][,clock=host|vm][,driftfix=none|slew]
          Specify base as "utc" or "localtime" to let the RTC start at the
          current UTC or local time, respectively. "localtime" is required
          for correct date in MS-DOS or Windows. To start at a specific
point
          in time, provide date in the format "2006-06-17T16:01:21" or
           "2006-06-17". The default base is UTC.

          By default the RTC is driven by the host system time. This allows
          to use the RTC as accurate reference clock inside the guest,
          specifically if the host time is smoothly following an accurate
          external reference clock, e.g. via NTP.  If you want to isolate
the
          guest time from the host, even prevent it from progressing during
          suspension, you can set clock to "vm" instead.

          Enable driftfix (i386 targets only) if you experience time drift
          problems, specifically with Windows' ACPI HAL. This option will
try
          to figure out how many timer interrupts were not processed by the
          Windows guest and will re-inject them.


Can someone shed light on what we are missing? Any pointers will be helpful.

Thanks
-a

[-- Attachment #2: Type: text/html, Size: 3494 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Question on kvm_clock working ...
  2011-09-09 15:28 Question on kvm_clock working al pat
@ 2011-09-26 17:47 ` Ronen Hod
  0 siblings, 0 replies; 2+ messages in thread
From: Ronen Hod @ 2011-09-26 17:47 UTC (permalink / raw)
  To: al pat; +Cc: qemu-devel, kvm

[-- Attachment #1: Type: text/plain, Size: 3197 bytes --]

On 09/09/2011 06:28 PM, al pat wrote:
>
> We are doing an experiment with kvm-clock to validate its 
> effectiveness, particularly when running NTP on the host to make sure 
> the host’s clock stays properly sync.
> Our observations leads us to a few unanswered questions, including the 
> possibility of a bug (our our misunderstanding of how kvm_clock should 
> work).
>
> Our understanding is that kvm_clock will help sync the clock between 
> the host and the guest. We do not observe this to happen in reality 
> and thus this question.
>
> We are using Ubuntu 11.04 on the host and the guest.
>
> The command we issue to launch the VM is the following:
>
> $ sudo kvm -m 500 -rtc clock=host guestos.img
>
> We also arranged for Ubuntu to show the seconds on the clock displayed 
> in the menu.
>
> Observation 1:
> Upon launching the VM, we see a time difference between the 2 clock 
> ranging from 1 to 2 seconds.
>
> Observation 2:
> If we change the date on the host (with a command such as “date --set 
> 10:00:00 AM Sep 9, 2011”), the time on the guest remains the same, 
> unaffected.
>
> Observation 3:
> After running for a while without NTP on the host, we run “ntpdate” to 
> sync up the host, but the guest stick with whatever previous time.

You probably meant "ntpd -q"

>
>
> Another test we will run is to have ntpd on the host and wait for an 
> extended time to see if the guest drifts away from that original 1 or 
>  2 second lag. In the meantime, we are asking you for some input in 
> this regards:
> Questions
> -What does the “–rtc clock” option is supposed to mean exactly? 
>  According to the man page, the guest should get its time from the 
> host, but neither date nor an “ntpdate” affected the clock on the guest.
> -What are the other options that we should use?
>
>        -rtc [base=utc|localtime|date][,clock=host|vm][,driftfix=none|slew]
>           Specify base as "utc" or "localtime" to let the RTC start at the
>           current UTC or local time, respectively. "localtime" is required
>           for correct date in MS-DOS or Windows. To start at a 
> specific point
>           in time, provide date in the format "2006-06-17T16:01:21" or
>            "2006-06-17". The default base is UTC.
>
>           By default the RTC is driven by the host system time. This 
> allows
>           to use the RTC as accurate reference clock inside the guest,
>           specifically if the host time is smoothly following an accurate
>           external reference clock, e.g. via NTP.  If you want to 
> isolate the
>           guest time from the host, even prevent it from progressing 
> during
>           suspension, you can set clock to "vm" instead.
>
>           Enable driftfix (i386 targets only) if you experience time drift
>           problems, specifically with Windows' ACPI HAL. This option 
> will try
>           to figure out how many timer interrupts were not processed 
> by the
>           Windows guest and will re-inject them.
>
>
> Can someone shed light on what we are missing? Any pointers will be 
> helpful.
>
> Thanks
> -a
>


[-- Attachment #2: Type: text/html, Size: 5083 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-09-26 17:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-09 15:28 Question on kvm_clock working al pat
2011-09-26 17:47 ` Ronen Hod

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox