feat(scheduled-jobs): scheduled jobs on Proxmox VE and Backup Server (#56) #59

Merged
christianmanivong merged 3 commits from feature/scheduled-jobs into main 2026-11-03 15:05:16 +00:00
Owner

Summary

Scheduled jobs on both drivers of the package, proxmox (ProxmoxDriver) and proxmox_backup (ProxmoxBackupDriver), through napalm-device-types' PosixScheduledJobsMixin over the node's root SSH session (run_command).

Changes

  • napalm_proxmox/scheduled_jobs.py: ProxmoxScheduledJobsMixin (the POSIX mixin plus RUN_ONLY_SOURCES), PVE_PLATFORM_SOURCES, PBS_PLATFORM_SOURCES.
  • platform on Proxmox VE: /usr/lib/systemd/system/pve-*, /lib/systemd/system/pve-* (pve-daily-update.timer), pvesr.timer (replication before PVE 7), /etc/cron.d/vzdump. On a backup server: proxmox-backup* units (proxmox-backup-daily-update.timer). Everything else stays package / admin as the mixin reads it.
  • A line in /etc/cron.d/vzdump only takes run: the file is a link to /etc/pve/vzdump.cron on the cluster file system (pmxcfs), where installing a file with a mode and owner is not safe.
  • Not scheduled jobs here: /cluster/backup jobs, replication, and PBS verify/prune/sync/GC jobs. Proxmox runs them in its own daemons; get_clusters() / get_backup_jobs() keep them.
  • napalm_device_types>=4.26.0; CHANGELOG, README.

Related Issue

Closes #56
Part of NetOrk/netork#1933 (needs NAPALM/napalm-device-types#87 released as 4.26.0).

Testing

  • tests/test_scheduled_jobs.py: each driver offers the four verbs and reads once through run_command as root; platform classification per driver (PVE names are not platform on PBS); a vzdump line refuses disable and writes nothing.
  • Full suite 608 passed, coverage 82 % (floor 68); ruff, mypy strict, napalm-standard check and ratchet, bandit clean.
  • Not tried on a real node.
## Summary Scheduled jobs on both drivers of the package, `proxmox` (`ProxmoxDriver`) and `proxmox_backup` (`ProxmoxBackupDriver`), through napalm-device-types' `PosixScheduledJobsMixin` over the node's root SSH session (`run_command`). ## Changes - `napalm_proxmox/scheduled_jobs.py`: `ProxmoxScheduledJobsMixin` (the POSIX mixin plus `RUN_ONLY_SOURCES`), `PVE_PLATFORM_SOURCES`, `PBS_PLATFORM_SOURCES`. - `platform` on Proxmox VE: `/usr/lib/systemd/system/pve-*`, `/lib/systemd/system/pve-*` (`pve-daily-update.timer`), `pvesr.timer` (replication before PVE 7), `/etc/cron.d/vzdump`. On a backup server: `proxmox-backup*` units (`proxmox-backup-daily-update.timer`). Everything else stays `package` / `admin` as the mixin reads it. - A line in `/etc/cron.d/vzdump` only takes `run`: the file is a link to `/etc/pve/vzdump.cron` on the cluster file system (pmxcfs), where installing a file with a mode and owner is not safe. - Not scheduled jobs here: `/cluster/backup` jobs, replication, and PBS verify/prune/sync/GC jobs. Proxmox runs them in its own daemons; `get_clusters()` / `get_backup_jobs()` keep them. - `napalm_device_types>=4.26.0`; CHANGELOG, README. ## Related Issue Closes #56 Part of NetOrk/netork#1933 (needs NAPALM/napalm-device-types#87 released as 4.26.0). ## Testing - `tests/test_scheduled_jobs.py`: each driver offers the four verbs and reads once through `run_command` as root; platform classification per driver (PVE names are not platform on PBS); a vzdump line refuses `disable` and writes nothing. - Full suite 608 passed, coverage 82 % (floor 68); ruff, mypy strict, napalm-standard check and ratchet, bandit clean. - Not tried on a real node.
christianmanivong added 1 commit 2026-11-03 04:39:16 +00:00
feat(scheduled-jobs): scheduled jobs on Proxmox VE and Backup Server (#56)
driver / lint (pull_request) Successful in 15s
driver / standard (pull_request) Successful in 19s
driver / types (pull_request) Failing after 28s
driver / test (3.13) (pull_request) Failing after 15s
driver / test (3.12) (pull_request) Failing after 17s
driver / lowest (pull_request) Failing after 19s
driver / build (pull_request) Successful in 33s
driver / security (pull_request) Failing after 37s
CI / driver (pull_request) Failing after 1m12s
driver / publish (pull_request) Skipped
dce794644c
Both drivers mix in napalm-device-types' PosixScheduledJobsMixin over the
node's root SSH session: get_scheduled_jobs reads cron, run-parts, anacron
and every systemd timer in one round trip; manage_scheduled_job enables,
disables or runs one now; put_ and delete_scheduled_job write and remove an
application's own job.

What Proxmox ships is platform, so it is only switched and run: pve-*
units, pvesr.timer and /etc/cron.d/vzdump on Proxmox VE, proxmox-backup*
units on a backup server. A vzdump cron line is only run, because the file
is a link into /etc/pve and rewriting it would replace the link with a
plain file.

Backup jobs (/cluster/backup), replication and a backup server's verify,
prune, sync and GC jobs run in Proxmox's own daemons and stay with the
backup features.

Requires napalm-device-types 4.26.0.

Closes #56
christianmanivong added 1 commit 2026-11-03 04:40:27 +00:00
docs(scheduled-jobs): a vzdump line only runs because of pmxcfs (#56)
driver / standard (pull_request) Successful in 18s
driver / lint (pull_request) Successful in 15s
driver / test (3.12) (pull_request) Failing after 17s
driver / types (pull_request) Failing after 30s
driver / test (3.13) (pull_request) Failing after 15s
driver / lowest (pull_request) Failing after 19s
driver / security (pull_request) Failing after 43s
driver / build (pull_request) Successful in 35s
CI / driver (pull_request) Failing after 1m35s
driver / publish (pull_request) Skipped
4e7e29b598
The guard is not about the link: napalm-device-types now writes the file a
link names. /etc/cron.d/vzdump points into /etc/pve, the cluster file
system, where installing a file with a mode and owner is not safe.

Refs #56
christianmanivong added 1 commit 2026-11-03 07:35:42 +00:00
chore(scheduled-jobs): require napalm-device-types 4.27.0
driver / lint (pull_request) Successful in 12s
driver / standard (pull_request) Successful in 15s
driver / types (pull_request) Successful in 53s
driver / test (3.13) (pull_request) Successful in 1m1s
driver / test (3.12) (pull_request) Successful in 1m6s
driver / lowest (pull_request) Successful in 33s
driver / build (pull_request) Successful in 25s
driver / security (pull_request) Successful in 55s
CI / driver (pull_request) Successful in 2m12s
driver / publish (pull_request) Skipped
25363ac7b0
4.26.0 went out with the sshd drop-in change; the scheduled-jobs
contract is in 4.27.0.
christianmanivong merged commit 1f88f50f15 into main 2026-11-03 15:05:16 +00:00
christianmanivong deleted branch feature/scheduled-jobs 2026-11-03 15:05:16 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Blocks
You do not have permission to read 1 dependency
Reference: NAPALM/napalm-proxmox#59