Scheduled Reboots

CameronMG

Member
Nov 15, 2022
19
0
6
Hi Everyone,

So I've been using Proxmox VE for a good few months now since transitioning from an ESXi environment. I have two nodes, one which predominantly handles Windows VMs and one that handles Linux VMs and containers.

I've currently got a task setup on all of the Windows VMs which are set to reboot every Sunday morning, however I'd like to reboot the node which has the windows VMs on it as well. I know this is not necessary, however this is something that I'd like to do as I check for updates weekly on the hosts.

At this stage, i'm not sure about how would be the best way about going about this. Would a cron job be suitable or is this something that I'm going to have to do manually (which I could be doing without). Effectively, I'd like to have the VMs shut down, the host to restart and then I'd just set the VMs to start "On start" etc.

Any assistance would be greatly appreciated.
 
Then write a line to /etc/crontab that tells the server to reboot. Something like 0 4 * * * root /usr/sbin/reboot to reboot the server each day at 04:00. Thats how it's done for nearly 50 years.
 
Last edited:
  • Like
Reactions: anish03 and MALOW
Then write a line to /etc/crontab that tells the server to reboot. Something like 0 4 * * * root /usr/sbin/reboot to reboot the server each day at 04:00. Thats how it's done for nearly 50 years.
Many thanks for the heads up on this. Tested it earlier on with my test box and worked perfectly!
 
Old thread but how about rebooting a specific guest?
Instead of running the reboot-command for the host, tell it to reboot a specific VM:

Code:
man qm
...
qm reboot <vmid> [OPTIONS]
 
  • Like
Reactions: _gabriel
Can this be done on a cluster level, so wherever the vm is hosted, the script is still applied?
 
you can also use crontab -e on your Proxmox and insert this to your daily job:

Code:
#VM 200 (daily reboot 07:30 Uhr)
30 7 * * * /usr/sbin/qm reboot 200

200 is the ID of your VM.
 
  • Like
Reactions: UdoB