feat(hypervisor): resume_vm, and a paused guest is never running (NetOrk/netork#2658) #129

Closed
christianmanivong wants to merge 0 commits from fix/vm-resume-2658 into main
pull from: fix/vm-resume-2658
Owner

netOrk could suspend a VM but never bring it back (NetOrk/netork#2658): the contract's suspend_vm pointed at start_vm, which Proxmox refuses for a paused guest because PVE still lists it as running.

What changes

  • HypervisorDriver.resume_vm(name) is declared beside suspend_vm, under TYPE_CHECKING like every other role method (STRUCTURE.md: a role base declares only). Optional like every power action: a driver without it is refused by the caller before anything connects (netOrk's implements probe), so the refusal stays generic and no driver has to override anything to say no. A driver that can resume some guests but not others refuses the others with RuntimeError.
  • get_vms()'s status contract: a guest that is not executing is never "running"; "paused" while its process holds its memory, "suspended" once its state was saved away. suspend_vm names resume_vm as the way back.

Tests

  • tests/test_role_contracts.py: resume_vm is declared with (self, name) beside suspend_vm, and absent at runtime (so the capability probe stays truthful). 64 passed locally.

CHANGELOG entry under Unreleased; no version bump.

Companion PRs: NAPALM/napalm-proxmox and NAPALM/napalm-vmware (same branch name), and the netOrk PR for NetOrk/netork#2658.

netOrk could suspend a VM but never bring it back (NetOrk/netork#2658): the contract's `suspend_vm` pointed at `start_vm`, which Proxmox refuses for a paused guest because PVE still lists it as running. ## What changes - `HypervisorDriver.resume_vm(name)` is declared beside `suspend_vm`, under `TYPE_CHECKING` like every other role method (STRUCTURE.md: a role base declares only). Optional like every power action: a driver without it is refused by the caller before anything connects (netOrk's `implements` probe), so the refusal stays generic and no driver has to override anything to say no. A driver that can resume some guests but not others refuses the others with `RuntimeError`. - `get_vms()`'s `status` contract: a guest that is not executing is never `"running"`; `"paused"` while its process holds its memory, `"suspended"` once its state was saved away. `suspend_vm` names `resume_vm` as the way back. ## Tests - `tests/test_role_contracts.py`: `resume_vm` is declared with `(self, name)` beside `suspend_vm`, and absent at runtime (so the capability probe stays truthful). 64 passed locally. CHANGELOG entry under Unreleased; no version bump. Companion PRs: NAPALM/napalm-proxmox and NAPALM/napalm-vmware (same branch name), and the netOrk PR for NetOrk/netork#2658.
christianmanivong added 1 commit 2026-11-25 20:52:02 +00:00
feat(hypervisor): resume_vm, and a paused guest is never running (NetOrk/netork#2658)
driver / lint (pull_request) Successful in 12s
driver / standard (pull_request) Successful in 15s
driver / types (pull_request) Successful in 50s
driver / test (3.12) (pull_request) Successful in 1m8s
driver / lowest (pull_request) Successful in 36s
driver / test (3.13) (pull_request) Successful in 1m0s
driver / build (pull_request) Successful in 27s
driver / security (pull_request) Successful in 59s
CI / driver (pull_request) Successful in 2m24s
driver / publish (pull_request) Skipped
cd47587e80
The contract could suspend a VM but not bring it back: suspend_vm pointed
at start_vm, which Proxmox refuses for a paused guest because it is still
running. resume_vm is declared beside suspend_vm, optional like every power
action, and get_vms() says a guest that is not executing is paused or
suspended, never running.
Author
Owner

Merged as part of the release PR #130 (4.42.0, merge commit fb927e7, tag v4.42.0).

Merged as part of the release PR #130 (4.42.0, merge commit fb927e7, tag v4.42.0).

Pull request closed

This pull request cannot be reopened because the branch was deleted.
Sign in to join this conversation.