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
Hi! could you briefly tell where to place this script
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.
Is there a script that loops through each vmid?