GitHub user SviridoffA created a discussion: Need help! Time synchronization 
issue.

Dear CloudStack Community,

I would be very grateful if someone could help me investigate a problem I’m 
currently facing.

It is difficult to pinpoint exactly when this started, but I’ve noticed that 
CloudStack has stopped updating the state of virtual machines promptly when 
they are shut down from within the guest OS. Usually, it takes about 3 minutes 
for CloudStack to reflect the power state change. However, in my current 
infrastructure, this update now takes roughly 3 hours.

To clarify: from the moment I execute halt -p inside the guest system until the 
state actually changes in the UI, 3 hours pass. I found the following entries 
in the management server logs:
```
DEBUG [c.c.v.VirtualMachinePowerStateSyncImpl] (AgentManager-Handler-5:[]) 
(logid:) vm id: 1328 - time since last state update(-10739085 ms) has not 
passed graceful period yet
```
As seen in the message, the management server received a state update from the 
future, and the time difference is approximately 3 hours. All my 
servers—management, KVM nodes, and database servers—are synchronized to the 
same time in the Europe/Moscow zone, which is UTC +3 hours. I have verified 
this using timedatectl. DB time settings is:

```
SELECT @@global.time_zone, @@session.time_zone;
+--------------------+---------------------+
| @@global.time_zone | @@session.time_zone |
+--------------------+---------------------+
| SYSTEM             | SYSTEM              |
+--------------------+---------------------+
```
But if I understand correctly, the timestamps should still be in UTC.
In my db.properties, I have two parameters:

```
db.cloud.url.params=prepStmtCacheSize=517&cachePrepStmts=true&sessionVariables=sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'&serN'&serverTimezone=UTC

db.usage.url.params=serverTimezone=UTC
```
It would be great if someone could point out the error in my configuration or 
explain where this time offset might be coming from, as well as the correct way 
to fix it without causing any issues.

I'm using:
Ubuntu 24.04.3 on all hosts
ACS 4.20.2
NTP servers outer and internal - chrony and chrony as clients
mysql 8.0.39

GitHub link: https://github.com/apache/cloudstack/discussions/12514

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]

Reply via email to