3

in my kolla openstack env, using containerized chrony service to keep controller node and compute node time sync. and by default, the instance guest OS time would be synchronized once with host at instance boot time, but I donot know whether the guest OS system time could be always synchronized with the host. If the guest OS time would be slowed down or inconsistented with the host, how to fix such issue? use chrony or ntp?

Lufus
  • 31
  • 1
  • 1
    I don't think you can guarantee that a VM guest has automatically the same time as the host. Use NTP to keep clocks synchronized; chrony, systemd-timesyncd or other NTP implementations. – berndbausch Apr 02 '21 at 10:35
  • thanks @berndbausch,if we setup the new ntpserver for VM guest clock synchrionzie, maybe it would be conficted with HOST clock synchrionzie. – Lufus Apr 06 '21 at 01:49
  • 1
    Why? Guest and host are two different servers running different kernels. They even have different hardware clocks; the guest doesn't write the host's hardware clock and vice versa. Guest and host don't affect each other. – berndbausch Apr 06 '21 at 01:59

1 Answers1

0

According to https://ask.openstack.org/en/question/290/time-keeping-in-instances/, it should not be necessary to sync clocks on a guest instance if the host is syncing its clock. Apparently kvm defaults to the guest VMs using the host's RTC. So if the host is syncing its RTC, the guests should see the correct time.

On the other hand, if a guest VM does sync its clock to an external source, I would not expect it to affect the host, or other guest VMs running on the host1. So if the guest OS "doesn't know", there should be little harm2 in installing and running clock sync software anyway.

Given that you own the infrastructure, this is a case where it would not be harmful to do some experiments.


1 - That would be a security problem. Someone would have considered it.
2 - Just a few unnecessary network packets, CPU cycles, etc

Stephen C
  • 698,415
  • 94
  • 811
  • 1,216