PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : KVM: Uhren nicht synchron



OliverH
02.02.10, 22:18
Hallo,

seit geraumer Zeit laufen bei mir einige virtuelle Maschinen mittels KVM, bei denen die Uhren leider nicht synchron sind mit dem Hostrechner.

Hostrechner:


host2:/home/xxx# date
Tue Feb 2 22:12:08 CET 2010

Gast:


webhost2:/home/xxxx# date
Tue Feb 2 22:25:20 CET 2010


In der LIbvirt-Config für den Gast steht folgendes:


<domain type='kvm'>
<name>webhost2</name>
<uuid>9253c3b6-2541-a905-6038-0bc95f6ab9c0</uuid>
<memory>1048576</memory>
<currentMemory>2097152</currentMemory>
<vcpu>2</vcpu>
<os>
<type arch='x86_64' machine='pc'>hvm</type>
<boot dev='hd'/>
</os>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>destroy</on_reboot>
<on_crash>destroy</on_crash>
<devices>
<emulator>/usr/bin/kvm</emulator>
<disk type='file' device='cdrom'>
<source file='/images/grml64-medium_2009.05.iso'/>
<target dev='hdc' bus='ide'/>
<readonly/>
</disk>
<disk type='block' device='disk'>
<source dev='/dev/vg0/webhost2'/>
<target dev='vda' bus='virtio'/>
</disk>
<interface type='network'>
<mac address='54:52:00:71:5d:40'/>
<source network='default'/>
<model type='virtio'/>
</interface>
<serial type='pty'>
<source path='/dev/pts/4'/>
<target port='0'/>
</serial>
<console type='pty' tty='/dev/pts/4'>
<source path='/dev/pts/4'/>
<target port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes' keymap='de'/>
</devices>
</domain>


Die Clocksource auf dem Gast:


webhost2:/sys/devices/system/clocksource/clocksource0# cat current_clocksource
kvm-clock


Wie kann ich die Uhren nun angleichen?
Ist der Einsatz von NTP im Gastsystem anzuraten?
Unter Xen reichte es, das Hostsystem per NTP aktuell zu halten (was hier auch passiert!).

lkwg82
02.02.10, 23:28
mir ging es genauso unter vmware.

Alle Tipps haben nicht wirklich geholfen. Deswegen habe ich auch ntp genutzt - was ja auch wenig Aufwand erfordert.

Bin auch an einer Antwort interessiert!

h4gb4rdc31in3
03.02.10, 09:25
Hi,

kvm/qemu bietet folgenden Parameter:


-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.


Da könnte driftfix interessant sein, dort steht zwar das es für Windows Gäste sei aber warum soll es nicht auch bei Linux Gästen gehen. Ich würde es mal probieren.

Gruß
Hagbard

OliverH
09.02.10, 13:14
Hat leider nichts gebracht. Ich fahre nun schon einige Tage den ntpd (nicht ntpdate!) auf einigen VMs ohne Probleme!