From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 2591A1FF09B for ; Mon, 14 Sep 2026 11:21:01 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 785B9215EF; Mon, 14 Sep 2026 11:20:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1789377644; x=1789982444; darn=lists.proxmox.com; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=ykNWZ82rmiW+eKFI5Qq6DWc/XtAqtsWsDZceMh+XzvQ=; b=VIKZFWS3rPGwRBIKnfZePNj15hjl2hpvDXzfOZzM6kXIl63H95ZGXsHkYMB3xnEfH+ wTiZQy7/FZbKlXGREL1QDjxXnIl5FVeu2xQ65BSoXdWdtvayICmQEGZKIE+fZmK7UsIH dIRraVhmOH3p1nPYxARm07PAWkhtnAc43BauPtlmniAaCYe8EpH2otJu+7sUc5zTImLZ ZRG3ZVC9cfSEVxmJK3uulWIxRWMTCAGkaY688NFRhs5RD7fuRyc/b0pwNMkLLvWsrNP+ EnbO9vWBWnmkGxNLvyrJbfmgOdTuyyY8gYcUN7KOo3y8Xo8CzJLMVkhA/iRqKtpjhnf2 U7pQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789377644; x=1789982444; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=ykNWZ82rmiW+eKFI5Qq6DWc/XtAqtsWsDZceMh+XzvQ=; b=AfLrSbzGggjpBUYtsLbnnqJkDZk1mkYtQRo6+ImuzpHd5KVRbWP1pd5xB0wAtEUF87 6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-0700 (PDT) From: Kaiyang Wu X-Google-Original-From: Kaiyang Wu To: pve-devel@lists.proxmox.com Subject: [PATCH ha-manager 5/5] lrm: stop and restart panicked VMs to keep the "started" state Date: Mon, 14 Sep 2026 17:20:12 +0800 Message-ID: <20260914092015.125780-6-wukaiyang@loongfans.cn> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260914092015.125780-1-wukaiyang@loongfans.cn> References: <20260914092015.125780-1-wukaiyang@loongfans.cn> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.000 Adjusted score from AWL reputation of From: address DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain DMARC_PASS -0.1 DMARC pass policy FREEMAIL_ENVFROM_END_DIGIT 1 Envelope-from freemail username ends in digit FREEMAIL_FROM 0.001 Sender email is commonly abused enduser mail provider RCVD_IN_DNSWL_NONE -0.0001 Sender listed at https://www.dnswl.org/, no trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: FWJWYVQPC4IQ2UAEH4GLY4ULJPWQHFUI X-Message-ID-Hash: FWJWYVQPC4IQ2UAEH4GLY4ULJPWQHFUI X-MailFrom: wukaiyang2003@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Kaiyang Wu X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: When a VM panics, 'check_running()' returns -1 to indicate the panicked state. Stop the service first since panicked VMs are still running, then restart the service to keep the "started" state. Suggested-by: Dominik Csapak Signed-off-by: Kaiyang Wu --- src/PVE/HA/LRM.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/PVE/HA/LRM.pm b/src/PVE/HA/LRM.pm index 72e37e6..8fa1ff6 100644 --- a/src/PVE/HA/LRM.pm +++ b/src/PVE/HA/LRM.pm @@ -982,7 +982,14 @@ sub exec_resource_agent { if ($cmd eq 'started') { - return SUCCESS if $running; + return SUCCESS if $running == 1; # running normally + + # stop the panicked service before restarting it + if ($running == -1) { + $haenv->log("info", "stopping panicked service $sid"); + + $plugin->shutdown($haenv, $id, 0); + } $haenv->log("info", "starting service $sid"); -- 2.55.0