From d1a6332186720684e3cd76a05b73f607529d5d7f Mon Sep 17 00:00:00 2001 From: Csaba Kos Date: Fri, 18 Aug 2023 18:45:49 -0500 Subject: [PATCH] Update monitor-all.sh to restart virtual machines instead of resetting Resetting a virtual machine may not work if the virtual machine is frozen/stuck. (Home Assistant OS tends to get into this state sometimes and resetting it does nothing.) Restarting the VM by stopping it and starting it seems to resolve the issue. --- misc/monitor-all.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/misc/monitor-all.sh b/misc/monitor-all.sh index 65dbca92..a60f8dd5 100644 --- a/misc/monitor-all.sh +++ b/misc/monitor-all.sh @@ -73,12 +73,13 @@ while true; do else # It is a virtual machine if qm status $instance | grep -q "status: running"; then - echo "$(date): VM $instance is not responding, resetting..." - qm reset $instance >/dev/null 2>&1 + echo "$(date): VM $instance is not responding, restarting..." + qm stop $instance >/dev/null 2>&1 + sleep 5 else - qm start $instance >/dev/null 2>&1 echo "$(date): VM $instance is not running, starting..." fi + qm start $instance >/dev/null 2>&1 fi fi done