MARWAN docs NOC knowledge base
DocsVirtualization

Put a Proxmox VE node into maintenance mode

Put a Proxmox VE node into HA maintenance mode so its VMs and containers live-migrate away, then back when you disable it.

Maintenance mode tells the Proxmox VE HA manager to move every HA-managed VM and container off a node, and to bring them back when maintenance is over. Use it before updating, rebooting or repairing a node. Run the commands below as root on any node of the cluster. Our node is called computeX.

Warning

Only guests that are HA resources move. VMs and containers that are not in HA (Datacenter → HA) stay on the node and are shut down if you reboot it. Add them to HA first, or migrate them by hand.

1. Before you start#

Check that the cluster is healthy and that the other nodes have room for the guests:

pvecm status
ha-manager status

If the node runs Ceph, stop Ceph from rebalancing data while the node's OSDs are down:

ceph osd set noout

2. Enable maintenance mode#

ha-manager crm-command node-maintenance enable computeX

Watch the guests move away. The node shows as maintenance once it is empty:

ha-manager status

You can now update or reboot the node.

3. Disable maintenance mode#

When the node is back and healthy:

ha-manager crm-command node-maintenance disable computeX

The HA manager migrates the guests back to the node. If you set noout, clear it:

ceph osd unset noout

4. Maintenance on every reboot (optional)#

Instead of enabling it by hand, you can let a normal reboot do the same. In the web interface go to Datacenter → Options → HA Settings and set the shutdown policy to migrate, or add this line to /etc/pve/datacenter.cfg:

/etc/pve/datacenter.cfg
ha: shutdown_policy=migrate

With this policy, a node that is rebooted or shut down cleanly moves its HA guests away first and gets them back when it returns.

Sources#

https://pve.proxmox.com/wiki/High_Availability