Time synchronization in guest machine
Hi,
I have a question, Linux customers have the wrong time, with a lag of a few seconds over time.
The hypervisors have when properly configured.
Not if I activate NTP service customers, or whether the customer takes the time hypervisor.
I tested. I have a client without NTP and has a gap of 10 seconds and rising.
I have another client with the NTP service started, but with a lag of a few seconds.
As I read, would be enough to put this in the ntp.conf configuration and comment lines of "server"
server 127.127.1.0 # local clock
fudge 127.127.1.0 stratum 10
Linux clients are not synchronized with HOSTs? RHEV must be enabled in the NTP client pointing to a time server?
more info:
HOST: RHEV 3.1
Guest: RHEL 5.7 (machines migrated from xen)
Thanks!
Responses
hi .. i never use before rhev , but for physical hardware , just configure /etc/ntp.conf ,
i also configure /etc/ntp.conf at vmware guest , vmware guest able to sync the time to server .
the below option to let your server as ntp server .
server 127.127.1.0 # local clock
fudge 127.127.1.0 stratum 10
for diagnostic ntp client , maybe you can provide command output below :
ntpq -p
ntpdate -d ntp_server_ip
hope this can help you
We run NTP on VMs the same way that we do on physical machines. I.e. both hypervisors and VMs are configure to syncronize time against a set of external NTP servers. I don't think it's a good idea to syncronizing NTP against a local clock...
BTW: with XEN we used the kernel parameters "clocksource=pit nohpet nopmtimer" to get stable time, maybe you have these too, and need to remove them after migrating your guests to RHEV ?
Ref: https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Virtualization/3.2/html/Administration_Guide/KVM_virtual_machine_timing_management.html
There was an earlier discussion about clocksources in RHEL 6 guests (kvm-clock):
https://access.redhat.com/discussion/63415
Looking at a RHEL 5 guest on a RHEL 6 (libvirt managed) host, I see the following configurations about clocksources. I am not noticing any time lag.
[root@wyvern ~]# dmesg | grep -i clock
kvm-clock: cpu 0, msr 7eff:804ab401, boot clock
kvm-clock: cpu 0, msr 0:2535401, primary cpu clock
kvm-clock: cpu 1, msr 0:253da81, secondary cpu clock
Real Time Clock Driver v1.12ac
[root@wyvern ~]#
[root@wyvern ~]# cat /sys/devices/system/clocksource/clocksource0/current_clocksource
jiffies
[root@wyvern ~]#
[root@wyvern ~]# cat /sys/devices/system/clocksource/clocksource0/available_clocksource
jiffies
In a RHEL 6 guest running on the same host, the current_clocksource is kvm-clock:
[root@aragon ~]# dmesg | grep kvm-clock
kvm-clock: Using msrs 4b564d01 and 4b564d00
kvm-clock: cpu 0, msr 0:1c25681, boot clock
kvm-clock: cpu 0, msr 0:28216681, primary cpu clock
kvm-clock: cpu 1, msr 0:28296681, secondary cpu clock
kvm-clock: cpu 2, msr 0:28316681, secondary cpu clock
kvm-clock: cpu 3, msr 0:28396681, secondary cpu clock
Switching to clocksource kvm-clock
[root@aragon ~]# cat /sys/devices/system/clocksource/clocksource0/current_clocksource
kvm-clock
[root@aragon ~]# cat /sys/devices/system/clocksource/clocksource0/available_clocksource
kvm-clock tsc acpi_pm