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.
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.
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.
netOrk could suspend a VM but never bring it back (NetOrk/netork#2658): the contract's
suspend_vmpointed atstart_vm, which Proxmox refuses for a paused guest because PVE still lists it as running.What changes
HypervisorDriver.resume_vm(name)is declared besidesuspend_vm, underTYPE_CHECKINGlike 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'simplementsprobe), 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 withRuntimeError.get_vms()'sstatuscontract: a guest that is not executing is never"running";"paused"while its process holds its memory,"suspended"once its state was saved away.suspend_vmnamesresume_vmas the way back.Tests
tests/test_role_contracts.py:resume_vmis declared with(self, name)besidesuspend_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.
Merged as part of the release PR #130 (4.42.0, merge commit
fb927e7, tag v4.42.0).Pull request closed