Both drivers implement napalm-device-types' TimeSyncMixin (4.35.0); time_sync_writes = {"ntp_servers", "timezone"}.
Neither API keeps time servers (/nodes/{node}/time knows only the zone; both products run chrony on Debian), so the servers are PosixTimeSyncMixin's over the driver's existing SSH session (run_command, root): read from chrony's configuration, written to /etc/chrony/sources.d/netork.sources with every other source commented out (Debian's vendor pool, the DHCP sourcedir), then a reload or a restart of chrony.
The zone is read from the host with them (timedatectl, the zone the clock really runs in), and from GET /nodes/{node}/time only where the host names none. It is written through PUT /nodes/{node}/time (PBS: /nodes/localhost/time) rather than timedatectl set-timezone: Proxmox's own call validates the name and keeps /etc/timezone, which its web UI and API show, in step with /etc/localtime. Writing it needs Sys.Modify (PVE on /nodes/{node}, PBS on /system/time); a refusal fails the step with the API's message.
One device is one node: in a PVE cluster only the node this connection resolved is read and written.
Fix: get_ntp_servers() read GET /nodes/{node}/ntp, a path Proxmox VE does not have, so it always reported no servers. It now reports what get_time_sync() reads, on the backup server too.
Dependency floor napalm_device_types>=4.35.0; changelog under Unreleased (the version is bumped in the release PR, as before).
tests/test_time_sync.py (21): reading on both drivers, the API fallback for the zone, the zone write per node (cluster: only pve2 addressed), a 403 and a 400 from the API, verify failing on a zone not taken, the chrony write (sources file, lines 8 and 11 of Debian's chrony.conf commented out, restart) and its no-churn repeat (same file, nothing commented, chronyc reload sources), the template's refusals.
Full suite 640 passed, ruff, mypy, bandit, napalm-standard check and ratchet locally.
## Summary
- Both drivers implement napalm-device-types' `TimeSyncMixin` (4.35.0); `time_sync_writes = {"ntp_servers", "timezone"}`.
- Neither API keeps time servers (`/nodes/{node}/time` knows only the zone; both products run chrony on Debian), so the servers are `PosixTimeSyncMixin`'s over the driver's existing SSH session (`run_command`, root): read from chrony's configuration, written to `/etc/chrony/sources.d/netork.sources` with every other source commented out (Debian's vendor pool, the DHCP `sourcedir`), then a reload or a restart of chrony.
- The zone is read from the host with them (`timedatectl`, the zone the clock really runs in), and from `GET /nodes/{node}/time` only where the host names none. It is written through `PUT /nodes/{node}/time` (PBS: `/nodes/localhost/time`) rather than `timedatectl set-timezone`: Proxmox's own call validates the name and keeps `/etc/timezone`, which its web UI and API show, in step with `/etc/localtime`. Writing it needs `Sys.Modify` (PVE on `/nodes/{node}`, PBS on `/system/time`); a refusal fails the step with the API's message.
- One device is one node: in a PVE cluster only the node this connection resolved is read and written.
- Fix: `get_ntp_servers()` read `GET /nodes/{node}/ntp`, a path Proxmox VE does not have, so it always reported no servers. It now reports what `get_time_sync()` reads, on the backup server too.
- Dependency floor `napalm_device_types>=4.35.0`; changelog under Unreleased (the version is bumped in the release PR, as before).
## Related Issue
NetOrk/netork#2365 (part of NetOrk/netork#2360)
## Testing
- `tests/test_time_sync.py` (21): reading on both drivers, the API fallback for the zone, the zone write per node (cluster: only `pve2` addressed), a 403 and a 400 from the API, verify failing on a zone not taken, the chrony write (sources file, lines 8 and 11 of Debian's `chrony.conf` commented out, restart) and its no-churn repeat (same file, nothing commented, `chronyc reload sources`), the template's refusals.
- Full suite 640 passed, ruff, mypy, bandit, `napalm-standard check` and `ratchet` locally.
netOrk keeps one list of NTP servers and a time zone per site and aligns
a device that differs (NetOrk/netork#2360, #2365). Both drivers now
implement napalm-device-types' TimeSyncMixin (4.35.0) and write both
values.
Neither API keeps time servers: /nodes/{node}/time knows only the zone,
and both products run chrony on Debian. The servers are therefore
PosixTimeSyncMixin's, over the driver's existing SSH session
(run_command, root): read from chrony's configuration, written to
/etc/chrony/sources.d/netork.sources with every other source commented
out, then a reload or a restart of chrony.
The zone is read with them from the host (timedatectl: the zone the
clock really runs in), and from GET /nodes/{node}/time only where the
host names none. It is written through PUT /nodes/{node}/time rather
than timedatectl set-timezone: Proxmox's own call validates the name and
keeps /etc/timezone, which its web UI and API show, in step with
/etc/localtime.
One device is one node: in a PVE cluster every node has its own clock,
and only the node this connection resolved is read and written.
get_ntp_servers() read GET /nodes/{node}/ntp, a path Proxmox VE does not
have, so it always reported no servers. It now reports what
get_time_sync() reads, on the backup server too.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
TimeSyncMixin(4.35.0);time_sync_writes = {"ntp_servers", "timezone"}./nodes/{node}/timeknows only the zone; both products run chrony on Debian), so the servers arePosixTimeSyncMixin's over the driver's existing SSH session (run_command, root): read from chrony's configuration, written to/etc/chrony/sources.d/netork.sourceswith every other source commented out (Debian's vendor pool, the DHCPsourcedir), then a reload or a restart of chrony.timedatectl, the zone the clock really runs in), and fromGET /nodes/{node}/timeonly where the host names none. It is written throughPUT /nodes/{node}/time(PBS:/nodes/localhost/time) rather thantimedatectl set-timezone: Proxmox's own call validates the name and keeps/etc/timezone, which its web UI and API show, in step with/etc/localtime. Writing it needsSys.Modify(PVE on/nodes/{node}, PBS on/system/time); a refusal fails the step with the API's message.get_ntp_servers()readGET /nodes/{node}/ntp, a path Proxmox VE does not have, so it always reported no servers. It now reports whatget_time_sync()reads, on the backup server too.napalm_device_types>=4.35.0; changelog under Unreleased (the version is bumped in the release PR, as before).Related Issue
NetOrk/netork#2365 (part of NetOrk/netork#2360)
Testing
tests/test_time_sync.py(21): reading on both drivers, the API fallback for the zone, the zone write per node (cluster: onlypve2addressed), a 403 and a 400 from the API, verify failing on a zone not taken, the chrony write (sources file, lines 8 and 11 of Debian'schrony.confcommented out, restart) and its no-churn repeat (same file, nothing commented,chronyc reload sources), the template's refusals.napalm-standard checkandratchetlocally.