feat(vm): resume a paused VM, and list it as paused (NetOrk/netork#2658) #70

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

suspend_vm paused a QEMU guest (status/suspend without todisk) that nothing could bring back: PVE then lists it status: running, qmpstatus: paused, refuses start, and netOrk had no resume (NetOrk/netork#2658).

What changes

  • resume_vm(name): reads status/current, refuses a guest that is not paused (PVE would answer status/resume on a running guest with success and do nothing), and posts status/resume, waiting for its task like the other power actions.
  • A container is refused with a clear message. PVE does have POST /nodes/{node}/lxc/{vmid}/status/resume, but the container suspend it pairs with is marked experimental (CRIU), this driver refuses to suspend a container, and the container listing does not tell a suspended container from another, so nothing could offer it.
  • get_vms() asks for the full listing (GET /nodes/{node}/qemu?full=1), the only one with qmpstatus (PVE's vmstatus returns before the QMP queries unless full), and reports a guest whose qmpstatus is paused or suspended (asleep in S3, which status/resume wakes with system_wakeup) as "paused" (qemu_status).

Tests

  • tests/test_vm_contract.py: the listing asks for full=1; paused and S3 guests are paused, running and stopped stay; resume posts status/resume and waits; a guest that is not paused and a container are refused without a call. test_vm_contract.py, test_vm_migration.py, test_vm_snapshots.py: 75 passed locally.
  • get_vms stays at its baseline length.

To check on a live node

That qmpstatus is in GET /nodes/{node}/qemu?full=1 for a paused VM on the PVE version in use, and that status/resume returns a UPID.

Needs napalm-device-types' contract PR (same branch) only for the declaration; no runtime dependency. CHANGELOG under Unreleased; no version bump.

`suspend_vm` paused a QEMU guest (`status/suspend` without `todisk`) that nothing could bring back: PVE then lists it `status: running`, `qmpstatus: paused`, refuses `start`, and netOrk had no resume (NetOrk/netork#2658). ## What changes - `resume_vm(name)`: reads `status/current`, refuses a guest that is not paused (PVE would answer `status/resume` on a running guest with success and do nothing), and posts `status/resume`, waiting for its task like the other power actions. - A container is refused with a clear message. PVE does have `POST /nodes/{node}/lxc/{vmid}/status/resume`, but the container `suspend` it pairs with is marked experimental (CRIU), this driver refuses to suspend a container, and the container listing does not tell a suspended container from another, so nothing could offer it. - `get_vms()` asks for the full listing (`GET /nodes/{node}/qemu?full=1`), the only one with `qmpstatus` (PVE's `vmstatus` returns before the QMP queries unless `full`), and reports a guest whose `qmpstatus` is `paused` or `suspended` (asleep in S3, which `status/resume` wakes with `system_wakeup`) as `"paused"` (`qemu_status`). ## Tests - `tests/test_vm_contract.py`: the listing asks for `full=1`; paused and S3 guests are `paused`, running and stopped stay; resume posts `status/resume` and waits; a guest that is not paused and a container are refused without a call. `test_vm_contract.py`, `test_vm_migration.py`, `test_vm_snapshots.py`: 75 passed locally. - `get_vms` stays at its baseline length. ## To check on a live node That `qmpstatus` is in `GET /nodes/{node}/qemu?full=1` for a paused VM on the PVE version in use, and that `status/resume` returns a UPID. Needs napalm-device-types' contract PR (same branch) only for the declaration; no runtime dependency. CHANGELOG under Unreleased; no version bump.
christianmanivong added 1 commit 2026-11-25 20:52:02 +00:00
feat(vm): resume a paused VM, and list it as paused (NetOrk/netork#2658)
driver / standard (pull_request) Successful in 16s
driver / lint (pull_request) Successful in 13s
driver / types (pull_request) Successful in 52s
driver / test (3.12) (pull_request) Successful in 1m1s
driver / test (3.13) (pull_request) Successful in 56s
driver / lowest (pull_request) Successful in 32s
driver / build (pull_request) Successful in 33s
driver / security (pull_request) Successful in 1m13s
CI / driver (pull_request) Successful in 2m43s
driver / publish (pull_request) Skipped
93c974b8f0
suspend_vm paused a QEMU guest that nothing could bring back: start is
refused because PVE still says the guest is running. resume_vm posts
status/resume for a paused VM and refuses a container or a guest that is
not paused. get_vms() asks for the full status and reports a guest whose
qmpstatus is paused or suspended as paused, not running.
Author
Owner

Merged as part of the release PR #71 (0.11.0, merge commit ad3b5b2, tag v0.11.0).

Merged as part of the release PR #71 (0.11.0, merge commit ad3b5b2, tag v0.11.0).

Pull request closed

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