Automatic node evacuation

Alessandro 123

Well-Known Member
May 22, 2016
653
24
58
41
Let's assume a cluster with shared storage
If i have to reboot a node, PVE automatically migrate all running VMs when issuing the reboot/shutdown command, like xenserver does, or i have to wait the timeout from cluster manager?
 
i know that option, but having the automatic evacuation is nice, so that in case of shutdown or reboot you don't have to wait 60s
It should be trivial to implement, as reboot/poweroff script via systemd

As proof of concept, with a one-liner taken from https://forum.proxmox.com/threads/bulk-migrate-via-command-line.25775/:

Code:
[Unit]
Description=Evacuate node on shutdown/reboot

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/true
ExecStop=/bin/sh -c 'for vm in $(qm list | awk "{print $1}" | grep -Eo "[0-9]{1,3}"); do qm migrate $vm node2 --online; done'

[Install]
WantedBy=multi-user.target
 

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!