Advice on keeping a VM up at all times

greavette

Renowned Member
Apr 13, 2012
163
9
83
Hello Forum,

I have a VM I'd like to ensure is always running. So in case it gets turned off I have a process in place on my Proxmox Host that will turn it back on.

The only time I wouldn't want this process to turn the VM on is when I'm running a backup of the VM from a scheduled Proxmox Task.

Does Proxmox give this functionality? And if not, does anyone have a script they use that could accomplish what I need that they would be willing to share?

We currently use Proxmox 4.3-1 (and will be upgrading to version 5 in the next month or two).

Thank you.
 
Thank you @micro for your reply. I sadly don't have distributed storage in place that would allow me to use High Availability. So I've whipped up the following bash script to run in a cron job and check on a schedule. Not ideal but should solve my problem.

#!/bin/bash
Logfile=checkvm.log
#Check if VM is running - checkvm.sh

check=$(qm status 140)
#echo $check
if [ "$check" == "status: running" ]
then
echo "$(date "+%m%d%Y %T") : The VM is already running" >> $Logfile
else
echo "$(date "+%m%d%Y %T") : The VM is not running and has been started" >> $Logfile
qm start 140
fi
 
  • Like
Reactions: Atila Vasconcelos