From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Buswell Subject: Re: Synchronized time with kvm_clock Date: Mon, 26 Apr 2010 10:32:51 -0400 Message-ID: <4BD5A413.50709@carbonmountain.com> References: <201004261133.06491.alex@speakup.nl> <201004261201.38221.alex@speakup.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Alex Hermann Return-path: Received: from smtp.carbonmountain.com ([74.207.244.159]:43610 "EHLO smtp.carbonmountain.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750822Ab0DZOcx (ORCPT ); Mon, 26 Apr 2010 10:32:53 -0400 In-Reply-To: <201004261201.38221.alex@speakup.nl> Sender: kvm-owner@vger.kernel.org List-ID: Alex, 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. 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. Regards Alex Hermann wrote: > On Monday 26 April 2010, I wrote: > >> host: >> cat /sys/devices/system/clocksource/clocksource0/current_clocksource >> tsc >> >> guest: >> cat /sys/devices/system/clocksource/clocksource0/current_clocksource >> kvm-clock >> > > Forgotten some info which might be essential: > > Kernel (host and guest): 2.6.32-trunk-amd64 > qemu-kvm: 0.12.3+dfsg-4 > > > Please keep me on the cc, I'm not on the list. > -- John Buswell CEO, Carbon Mountain LLC http://www.carbonmountain.com