feat(running-backups): what a restart of a PVE node, a guest or a PBS would abort #62

Merged
christianmanivong merged 1 commits from feature/running-backups-2318 into main 2026-11-11 07:40:53 +00:00
Owner

Summary

  • get_running_backups() on both drivers (napalm-device-types 4.34.0, RunningBackupsMixin).
  • PVE: the node's active vzdump tasks (/nodes/<node>/tasks?source=active&typefilter=vzdump), each with the guests it is taking now -- its own guest, or for a job the guests locked for their backup (/cluster/resources?type=vm, lock: backup) -- and a guest locked without a task on its own.
  • PBS: the running backup, sync, verify, gc, prune and tape tasks (/nodes/localhost/tasks?running=1); a restore or housekeeping is no backup.
  • A failed read raises.

Related Issue

NetOrk/netork#2318

Testing

  • tests/test_running_backups.py (11), full suite 621 passed, ruff, napalm-standard check and ratchet locally (against the device-types branch).

Depends on

NAPALM/napalm-device-types#102 (4.34.0, RunningBackupsMixin). CI installs napalm-device-types from PyPI, so the install jobs fail until 4.34.0 is tagged and published there; rerun them then.

## Summary - `get_running_backups()` on both drivers (napalm-device-types 4.34.0, `RunningBackupsMixin`). - PVE: the node's active vzdump tasks (`/nodes/<node>/tasks?source=active&typefilter=vzdump`), each with the guests it is taking now -- its own guest, or for a job the guests locked for their backup (`/cluster/resources?type=vm`, `lock: backup`) -- and a guest locked without a task on its own. - PBS: the running backup, sync, verify, gc, prune and tape tasks (`/nodes/localhost/tasks?running=1`); a restore or housekeeping is no backup. - A failed read raises. ## Related Issue NetOrk/netork#2318 ## Testing - `tests/test_running_backups.py` (11), full suite 621 passed, ruff, `napalm-standard check` and `ratchet` locally (against the device-types branch). ## Depends on NAPALM/napalm-device-types#102 (4.34.0, `RunningBackupsMixin`). CI installs napalm-device-types from PyPI, so the install jobs fail until 4.34.0 is tagged and published there; rerun them then.
christianmanivong added 1 commit 2026-11-10 22:46:01 +00:00
feat(running-backups): what a restart of a PVE node, a guest or a PBS would abort
driver / lint (pull_request) Successful in 13s
driver / standard (pull_request) Successful in 14s
driver / types (pull_request) Successful in 54s
driver / test (3.13) (pull_request) Successful in 1m2s
driver / test (3.12) (pull_request) Successful in 1m5s
driver / lowest (pull_request) Successful in 31s
driver / build (pull_request) Successful in 26s
driver / security (pull_request) Successful in 54s
CI / driver (pull_request) Successful in 2m10s
driver / publish (pull_request) Skipped
3877a5425a
netOrk holds a host's restart after patching while a backup runs on it, and
a guest's restart while its hypervisor is backing it up (NetOrk/netork#2318).
It asks right before the restart, so both drivers answer
get_running_backups() from napalm-device-types 4.34.0:

- PVE: the node's active vzdump tasks, each with the guests it is taking now
  (its own guest, or for a job the guests locked for their backup), and a
  guest locked without a task on its own, since the task list can lag and a
  lock can outlive its task.
- PBS: the running backup, sync, verify, gc, prune and tape tasks; a restore
  or housekeeping is no backup.

A failed read raises, so netOrk reads it as "not checked", never as "none".
christianmanivong merged commit aeb12eae00 into main 2026-11-11 07:40:53 +00:00
christianmanivong deleted branch feature/running-backups-2318 2026-11-11 07:40:53 +00:00
Sign in to join this conversation.