Proxmox UPS and Power Loss

ieronymous

Active Member
Apr 1, 2019
251
18
38
44
Hi

Has someone deployed a configuration where during power loss and when the batteries level are critical-low / below a certain percentage, UPS informs proxmox and proxmox shuts down all VMs gracefully?
Does the way goes UPS->Server (idrac / ilo) ->proxmox?

Thank you
 
I installed nut on my PVE host. It can monitor a attached UPS for the power and battery status and you can then tell it to shutdown your host when only x% of battery is left. A shutdown will automatically gracefully stop your VMs.
 
You can also setup a Nut client to monitor a Nut/UPS over a network, so you can set that up inside your server VMs if you want.
 
I installed nut on my PVE host. It can monitor a attached UPS for the power and battery status and you can then tell it to shutdown your host when only x% of battery is left. A shutdown will automatically gracefully stop your VMs.
The link reminded me that I knew the service but had set it aside for future testing. It all comes down if your UPS is compatible with which feature of nuc in order to be supported?

ps when you say it can monitor an attached ups, how do you mean that? Directly to the pve with usb? Connected by ethernet to the same network as the pve?
 
Last edited:
The link reminded me that I knew the service but had set it aside for future testing. It all comes down if your UPS is compatible with which feature of nuc in order to be supported?

ps when you say it can monitor an attached ups, how do you mean that? Directly to the pve with usb? Connected by ethernet to the same network as the pve?
Ive got a nut server and some nut clients. My UPS is connected via USB to the nut server. The nut clients then connect to the nut server over thesnetwork so all machines will shutdown when the UPS runs low on battery.
 
No, the Clients are other physical hosts. You dont need to shutdown guests. As soon as the PVE host receives a shutdown command it will automatically use a "stop all guests" task so all guest will do a graceful shutdown and the PVE host will wait (I think 5 minutes) for them to shutdown and only if they weren't shutdown in time, the PVE host will kill the guests and shutdown itself.

You can test that without NUT by just using shutdown now while guests are running because NUT will just run a shutdown script (which you could edit) which is using this as a default.
 
Last edited:
You can test that without NUT by just using shutdown now while guests are running
This is the way I am shutting a demo pve, but I don t have a way to see if he will first shutdown the VM. I assume that it does it - gracefully and not by force. If I ll try to watch via gui interface, the only thing I am going to notice is the no connection message, so i wont be able to see if the VM has been greyed out (so it is off)
 
I installed nut on my PVE host. It can monitor a attached UPS for the power and battery status and you can then tell it to shutdown your host when only x% of battery is left. A shutdown will automatically gracefully stop your VMs.
Hi Dunuin, sorry for reviving this old thread, however I'm very interested in this topic. Did you install NUT server in one of Proxmox VMs? I'm just thinking do I need a separate device for NUT server or hosting it inside Proxmox that it will potentially shut down is ok?
 
Yes, just install the "nut" meta package which will install both the "nut-server" and the "nut-client" packages. The PVE node can then act as a server as well as shut itself down.
 
  • Like
Reactions: rigel.local
I have 3 nodes and one UPS serving all 3. I have installed nut and nut-snmp, i have the driver reporting the UPS ok and I am now deep in upsmon.conf.... i am now a little confused....

1. each node will spot a UPS failure at slightly different times
2. when the first node starts to shutdown i assume my HA VMs will start to migrate to another node
3. that other node is likely to start shutting down in the middle of that (i am using ceph)

Do i need to worry about this and configure a more complex script than upsmon calling /sbin/shutdown?
 

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!