From b4abd792955fa2c3cf1bc022f5242bfc24c344ea Mon Sep 17 00:00:00 2001 From: MickLesk <47820557+MickLesk@users.noreply.github.com> Date: Wed, 23 Sep 2026 16:19:46 +0200 Subject: [PATCH 1/2] Report a finished VM as done, not aborted --- pve/vm-core.func | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/pve/vm-core.func b/pve/vm-core.func index 3b7c88a..de81267 100644 --- a/pve/vm-core.func +++ b/pve/vm-core.func @@ -719,10 +719,17 @@ cleanup() { if declare -f post_update_to_api >/dev/null 2>&1; then if [[ $exit_code -ne 0 ]]; then post_update_to_api "failed" "$exit_code" + elif [[ -n "${VMID:-}" ]] && qm config "$VMID" &>/dev/null; then + # A clean exit with the VM in place is a finished run; the script just + # never said so. Filing those as aborted put every debian-vm and + # truenas-vm success in the abort column and drove their reported + # failure rate to 96% and 100%. Scripts that post success themselves + # never reach this branch - POST_UPDATE_DONE keeps them out. + post_update_to_api "done" "none" else - # Exited cleanly but description()/success was never called: the user - # backed out of a dialog. Report as aborted - NOT "failed 1" (which - # produced meaningless 'General error' records with no error text). + # Clean exit and no VM: the user backed out of a dialog. Reported as + # aborted, NOT "failed 1" - that produced meaningless 'General error' + # records with no error text. post_update_to_api "aborted" "0" fi fi From aec75b7e649af26490ac0c4f294a0ee324bec8aa Mon Sep 17 00:00:00 2001 From: MickLesk <47820557+MickLesk@users.noreply.github.com> Date: Wed, 23 Sep 2026 16:23:49 +0200 Subject: [PATCH 2/2] Trim comments --- pve/vm-core.func | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/pve/vm-core.func b/pve/vm-core.func index de81267..9eaafe8 100644 --- a/pve/vm-core.func +++ b/pve/vm-core.func @@ -720,16 +720,10 @@ cleanup() { if [[ $exit_code -ne 0 ]]; then post_update_to_api "failed" "$exit_code" elif [[ -n "${VMID:-}" ]] && qm config "$VMID" &>/dev/null; then - # A clean exit with the VM in place is a finished run; the script just - # never said so. Filing those as aborted put every debian-vm and - # truenas-vm success in the abort column and drove their reported - # failure rate to 96% and 100%. Scripts that post success themselves - # never reach this branch - POST_UPDATE_DONE keeps them out. + # Clean exit with the VM in place: a script that never said so itself. post_update_to_api "done" "none" else - # Clean exit and no VM: the user backed out of a dialog. Reported as - # aborted, NOT "failed 1" - that produced meaningless 'General error' - # records with no error text. + # Clean exit, no VM: the user backed out of a dialog. post_update_to_api "aborted" "0" fi fi