public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Athanasius <kvm@miggy.org>
To: John Buswell <buswellj@carbonmountain.com>
Cc: Alex Hermann <alex@speakup.nl>, kvm@vger.kernel.org
Subject: Re: Synchronized time with kvm_clock
Date: Mon, 26 Apr 2010 17:43:27 +0100	[thread overview]
Message-ID: <20100426164327.GC25799@miggy.org> (raw)
In-Reply-To: <4BD5A413.50709@carbonmountain.com>

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

On Mon, Apr 26, 2010 at 10:32:51AM -0400, John Buswell wrote:
> You don't need to run ntp on each guest. You can enable rtc support in  
> the guest kernel and on the hypervisor. Run ntp client on the hypervisor  
> via cron, and use hwclock -w on the hypervisor after you run ntp, to  
> sync the hardware clock to the system clock (which is now updated by  
> ntpdate). On the guests, periodically run hwclock -s to set the system  
> clock from the hw clock.

  What a *horribly* hacky way to do it, meaning you'll get time warps
all over the place, admittedly of short intervals if you run those cron
jobs often enough.  It seems much simpler to me to simply run ntpd in
all the guests.  It's not like the extra CPU or bandwidth is going to be
a problem.  At the very least you want to run ntpd, not ntpdate out of
cron, in the hypervisor, and only use cron for those hwclock -w's.

> This seems to work extremely well, the clocksource on the guests as  
> kvm_clock, and as long as you have the clocksource as hpet or acpi_pm on  
> the hypervisor, there doesn't seem to be any problems with keeping time.
>
> The only thing I've noticed is that when you reboot, the very first  
> guest will have the wrong time on boot, so the uptime is messed up.

  And I think many people would find this unacceptable.

  Really, I appreciate that "keep the time sync'd via ntpd on the
hypervisor and have it passed accurately to the guests" has a certain
elegant simplicity about it.  But if you achieve the latter by
periodically resyncing against what the guest sees as its hardware clock
you've lost that elegance again.  It really needs to 'just work' via KVM
code in the guest kernel using the exact same time as the hypervisor
kernel is supplying.

-- 
- Athanasius = Athanasius(at)miggy.org / http://www.miggy.org/
                  Finger athan(at)fysh.org for PGP key
	   "And it's me who is my enemy. Me who beats me up.
Me who makes the monsters. Me who strips my confidence." Paula Cole - ME

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

  reply	other threads:[~2010-04-26 16:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-26  9:33 Synchronized time with kvm_clock Alex Hermann
2010-04-26 10:01 ` Alex Hermann
2010-04-26 14:32   ` John Buswell
2010-04-26 16:43     ` Athanasius [this message]
2010-04-26 17:07       ` John Buswell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100426164327.GC25799@miggy.org \
    --to=kvm@miggy.org \
    --cc=alex@speakup.nl \
    --cc=buswellj@carbonmountain.com \
    --cc=kvm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox