Správná synchronizace času v PVE (nejen v PVE:-) je spolu se správným nastavením IP protokolu a DNS základem úspěchu. Synchronizace času je kromě jiného důležitá pro funkčnost PVE clusteru (při „rozhození“ času mezi nody možná ani cluster nevytvoříte).
Pro synchronizace systémového času s NTP servery slouží služba systemd-timesyncd. Jak na to?
Ověřte, že systemd-timesyncd je instalován:
root@sr650-ext1:~# systemctl status systemd-timesyncd
Unit systemd-timesyncd.service could not be found.
Pokud jste dostali výše uvedený výstup, musíte službu doinstalovat:
root@sr650-ext1:~# apt install systemd-timesyncd
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
The following packages were automatically installed and are no longer required:
proxmox-kernel-6.8.12-6-pve-signed proxmox-kernel-6.8.12-8-pve-signed
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
chrony
The following NEW packages will be installed:
systemd-timesyncd
0 upgraded, 1 newly installed, 1 to remove and 7 not upgraded.
Need to get 63.8 kB of archives.
After this operation, 503 kB disk space will be freed.
Do you want to continue? [Y/n] y
Get:1 http://ftp.cz.debian.org/debian bookworm/main amd64 systemd-timesyncd amd64 252.39-1~deb12u1 [63.8 kB]
Fetched 63.8 kB in 1s (83.7 kB/s)
(Reading database … 86414 files and directories currently installed.)
Removing chrony (4.3-2+deb12u1) …
Selecting previously unselected package systemd-timesyncd.
(Reading database … 86382 files and directories currently installed.)
Preparing to unpack …/systemd-timesyncd_252.39-1~deb12u1_amd64.deb …
Unpacking systemd-timesyncd (252.39-1~deb12u1) …
Setting up systemd-timesyncd (252.39-1~deb12u1) …
Creating group 'systemd-timesync' with GID 997.
Creating user 'systemd-timesync' (systemd Time Synchronization) with UID 997 and GID 997.
Created symlink /etc/systemd/system/dbus-org.freedesktop.timesync1.service → /lib/systemd/system/systemd-timesyncd.service.
Created symlink /etc/systemd/system/sysinit.target.wants/systemd-timesyncd.service → /lib/systemd/system/systemd-timesyncd.service.
Processing triggers for dbus (1.14.10-1~deb12u1) …
Processing triggers for man-db (2.11.2-2) …
Upravte soubor /etc/systemd/timesyncd.conf
[Time]
NTP=tik.cesnet.cz
FallbackNTP=tak.cesnet.cz
Povolte službu a restartujte ji.
root@sr650-ext1:~# systemctl enable –now systemd-timesyncd
root@sr650-ext1:~# systemctl restart –now systemd-timesyncd
Zkontrolujte log služby, zdali vše běží:
root@sr650-ext1:~# journalctl -u systemd-timesyncd -f
Dec 31 12:07:06 sr650-ext1 systemd[1]: Started systemd-timesyncd.service - Network Time Synchronization.
Dec 31 12:07:07 sr650-ext1 systemd-timesyncd[2311145]: Contacted time server 195.133.18.24:123 (0.debian.pool.ntp.org).
Dec 31 12:07:07 sr650-ext1 systemd-timesyncd[2311145]: Initial clock synchronization to Wed 2025-12-31 12:07:07.066152 CET.
Dec 31 12:10:36 sr650-ext1 systemd[1]: Stopping systemd-timesyncd.service - Network Time Synchronization…
Dec 31 12:10:36 sr650-ext1 systemd[1]: systemd-timesyncd.service: Deactivated successfully.
Dec 31 12:10:36 sr650-ext1 systemd[1]: Stopped systemd-timesyncd.service - Network Time Synchronization.
Dec 31 12:10:36 sr650-ext1 systemd[1]: Starting systemd-timesyncd.service - Network Time Synchronization…
Dec 31 12:10:36 sr650-ext1 systemd[1]: Started systemd-timesyncd.service - Network Time Synchronization.
Dec 31 12:10:36 sr650-ext1 systemd-timesyncd[2312599]: Contacted time server 195.113.144.201:123 (tik.cesnet.cz).
Dec 31 12:10:36 sr650-ext1 systemd-timesyncd[2312599]: Initial clock synchronization to Wed 2025-12-31 12:10:36.598196 CET.
Jako alternativu můžete použít službu Chrony. Slovy klasika „jak který soudruh dle chuti“:-)