[SOLVED] Autoreboot of guests and/or PVE server itself?

verulian

Well-Known Member
Feb 18, 2019
180
21
58
44
I have a situation where I need to reboot three guests daily. I would be fine with restarting Proxmox itself, but would prefer to have an automated mechanism for restarting the guest servers easily.

Is there a function that already accomplishes this or is this a feature that Proxmox developers could add to the functionality for guests so we can trigger such reboots routinely?
 
Thanks @bbgeek17. I suppose I worry about trusting crontab editing, but it definitely is a work around without such a (useful) feature at present.

Some potentially useful options to make this a little more safe/sane perhaps for a virtual machine guest with a VMID of 101:
  • Set the frequency you want: https://crontab.guru/#30_4_*_*_*
  • Line in crontab -eto reboot daily at 4:30 AM with a max of 3 minute wait for system to reboot: 30 4 * * * /usr/sbin/qm reboot 101 --timeout 180
 
Sure you can gold plate it as much as you want. I.e. wrap qm in a script that does error checking and sends email on success... Or tries to ssh reboot, check the result, then the uptime and if it didnt work, use the "reset" hammer. The possibilities are endless.

You should really be initiating this from inside the VM, giving it a chance to sync writes and dismount disks. Hope you have a good reason to do it because none of this is an "enterprise" solution.


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
Last edited:

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!