Repository navigation
fix(actions): stop shuts guests down gracefully instead of pulling the plug - #42
Merged
Merged
Conversation
…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
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The stop action (menu key 2) called
qm stop/pct stop. On PVE 9.2.21qm help stopdocuments this as "akin to pulling the power plug of a running computer and may damage the VM data";pct help stopsays it "will abruptly stop all processes". The--overrule-shutdown 1retry after the Bashtimeoutforced 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 forqm shutdownandpct shutdownon PVE 9.2.21 (checked viaqm help shutdown/pct help shutdownon the node).The
qm/pctmocks 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
Checklist
shellcheck proxmox-manager.shpasses locally with no warningstests/run.sh— all green (141 passed)CHANGELOG.mdupdated under[Unreleased]usage()/--helpoutput (no new flags;--timeouttext updated)type(scope): summaryconventionNot yet verified
A live stop of a real guest on the node (task log should show
vzshutdown/qmshutdown, notvzstop/qmstop).🤖 Generated with Claude Code