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

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!