Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Incorrect time after reboot of VM

We have run into a weird issue on our VMs. We are using the latest ubuntu 22.04 images and the default NTP settings (chrony & internal Google NTP servers).

After creating a new VM my small test application gets the correct response when asking the system time as well as TAI.
Fri Mar 24 07:56:08 2023
Now: 1679644568
TAI: 1679644605

However after a reboot the response I get is the same for both:

Fri Mar 24 08:35:59 2023
Now: 1679646959
TAI: 1679646959

I have not had any luck in figuring out what could be causing this behavior and was hoping that someone here might have some idea?

Solved Solved
0 2 466
1 ACCEPTED SOLUTION

@siegfredv Thanks for your response! 

How did you install the `ntptime` command? If I try to install it through the `ntp` package it completely replaces chrony with ntpd which uses the Ubuntu NTP servers instead of Google's internal NTP servers. So that would explain why your server reverts back to the correct TAI offset after a while.
It did help me find the reason for it being set correct at first boot for me though. Apparently the chrony configuration is set to default (Ubuntu NTP servers) on first boot and after a few seconds changed to use Google's NTP servers.

View solution in original post

2 REPLIES 2

 

CLOCK_REALTIME and CLOCK_TAI return the same because the kernel parameter tai_offset is zero after t...

rebooted instance-1 and got TAI offset 0, and newly created instance-2 is at TAI offset 37

Screenshot 2023-03-25 5.46.18 AM.png

After sometime my instance-1 reverted back to TAI offset 37

@siegfredv Thanks for your response! 

How did you install the `ntptime` command? If I try to install it through the `ntp` package it completely replaces chrony with ntpd which uses the Ubuntu NTP servers instead of Google's internal NTP servers. So that would explain why your server reverts back to the correct TAI offset after a while.
It did help me find the reason for it being set correct at first boot for me though. Apparently the chrony configuration is set to default (Ubuntu NTP servers) on first boot and after a few seconds changed to use Google's NTP servers.