Proxmox VM auto start VM after found in shutdown state

I was having this strange issue, where a running busy VM stopeed all of a sudden due to high CPU or Memory overload issue. So manually had to start everythime. In order to avoid this, created a small script to start the VM in case if it’s down.

#!/bin/bash

# Set environment
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

su -

if [[ $(qm status 101) = *"status: stopped"* ]];
then
echo `qm start 101`
fi
Share

3 thoughts on “Proxmox VM auto start VM after found in shutdown state

    • You can put the script anywhere with the executable permission. What I did later to add it on the cron to check the status in every 5 mins.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.