Skip to content

fix(actions): stop shuts guests down gracefully instead of pulling the plug - #42

Merged
TimInTech merged 1 commit into
mainfrom
claude/affectionate-faraday-0e1zux
Oct 21, 2026
Merged

TimInTech merged 1 commit into
mainfrom
claude/affectionate-faraday-0e1zux

Conversation

@TimInTech

Copy link
Copy Markdown
Owner

Summary

The stop action (menu key 2) called qm stop / pct stop. On PVE 9.2.21 qm help stop documents this as "akin to pulling the power plug of a running computer and may damage the VM data"; pct help stop says it "will abruptly stop all processes". The --overrule-shutdown 1 retry after the Bash timeout forced nothing, it only aborts running shutdown tasks, which pman never started.

Stop now runs qm|pct shutdown <id> --timeout $STOP_TIMEOUT --forceStop 1: a clean ACPI / guest-agent shutdown, and Proxmox hard-stops the guest itself only after the timeout. Both options exist for qm shutdown and pct shutdown on PVE 9.2.21 (checked via qm help shutdown / pct help shutdown on the node).

The qm/pct mocks now log their argv (PMAN_MOCK_GUEST_LOG) and can fail on demand (PMAN_MOCK_GUEST_FAIL); 10 new tests cover stop, the timeout value, the failure path, a declined confirmation and restart for VM and CT. Against the old script 6 of them fail.

Behaviour change: a guest that ignores ACPI and has no guest agent is now hard-stopped after STOP_TIMEOUT (default 60 s) instead of immediately.

Type of Change

  • Bug fix
  • New feature / flag
  • Refactor / performance improvement
  • Documentation only
  • CI / tooling

Checklist

  • shellcheck proxmox-manager.sh passes locally with no warnings
  • Tests pass: tests/run.sh — all green (141 passed)
  • CHANGELOG.md updated under [Unreleased]
  • New flags documented in usage() / --help output (no new flags; --timeout text updated)
  • No generated files, scan outputs, or binaries committed
  • Commit messages follow type(scope): summary convention

Not yet verified

A live stop of a real guest on the node (task log should show vzshutdown/qmshutdown, not vzstop/qmstop).

🤖 Generated with Claude Code

…e plug

The stop action called `qm stop` / `pct stop`, which kills the guest
immediately; the `--overrule-shutdown 1` retry after the Bash timeout only
aborts running shutdown tasks and forced nothing. Stop now runs
`qm|pct shutdown --timeout STOP_TIMEOUT --forceStop 1`, so Proxmox shuts the
guest down cleanly and hard-stops it only after the timeout.

The qm/pct mocks now log their argv and can fail on demand; new tests cover
stop (VM and CT), the timeout value, the failure path, a declined
confirmation and restart.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S8LmYGQA8hFstiLCCyzUYZ
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T19:50:57.074623Z 002ee4a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@TimInTech
TimInTech merged commit bbbdbd3 into main Oct 21, 2026
7 checks passed
@TimInTech
TimInTech deleted the claude/affectionate-faraday-0e1zux branch October 21, 2026 19:50
@TimInTech TimInTech mentioned this pull request Oct 21, 2026
8 of 11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants