UPS APC to shutdown VMs?

I got this running with apcd in a docker container checking the UPS via the network, with a crontab script looking for the apcd created file. Simple setup.
 
Thanks, but my ups is usb only ...
So, no solution for usb UPS rather than installing on host ?
thanks !
 
Seh is stable. It works. it does not have hick-ups and it plays nice within a hot environment.
I have Seh USB to network hubs in my environments that have been running for 8+ years without needing ANY manual input post setting up.

I am willing to pay the 150€/piece. You might not be. There sure are alternatives out there.
 
According to the APC manual, apcupsd is looking for nodes in /dev/usb/hiddev*. So, you may want to try passing that through instead of /dev/bus/usb/xxx/yyy. I finally got this working for my APC Back-UPS XS 1500G after doing the following:

On the host:
Code:
chown root:100000 /dev/usb/hiddev0
chmod 660 /dev/usb/hiddev0

And in my LXC .conf:
Code:
lxc.cgroup.devices.allow: c 180:* rwm
lxc.mount.entry: /dev/usb/hiddev0 dev/usb/hiddev0 none bind,optional,create=file

Et voila (in LXC):
Code:
root@ups1:~# apcaccess
APC      : 001,036,0860
DATE     : 2021-04-09 19:30:44 +0000
HOSTNAME : ups1
VERSION  : 3.14.14 (31 May 2016) debian
UPSNAME  : ups1
CABLE    : USB Cable
DRIVER   : USB UPS Driver
UPSMODE  : Stand Alone
STARTTIME: 2021-04-09 19:30:43 +0000
MODEL    : Back-UPS XS 1500G
STATUS   : ONLINE
LINEV    : 121.0 Volts
LOADPCT  : 21.0 Percent
BCHARGE  : 100.0 Percent
TIMELEFT : 31.1 Minutes
MBATTCHG : 5 Percent
MINTIMEL : 3 Minutes
MAXTIME  : 0 Seconds
SENSE    : Medium
LOTRANS  : 88.0 Volts
HITRANS  : 139.0 Volts
ALARMDEL : 30 Seconds
BATTV    : 27.3 Volts
LASTXFER : No transfers since turnon
NUMXFERS : 0
TONBATT  : 0 Seconds
CUMONBATT: 0 Seconds
XOFFBATT : N/A
SELFTEST : NO
STATFLAG : 0x05000008
SERIALNO : 4B1504P15630
BATTDATE : 2015-01-21
NOMINV   : 120 Volts
NOMBATTV : 24.0 Volts
NOMPOWER : 865 Watts
FIRMWARE : 866.L8 .D USB FW:L8
END APC  : 2021-04-09 19:31:39 +0000
 
Not a production environment, but in my home lab I use NUT. Synology NAS is connected via USB to an APC BackUPS and acts as the UPS “server”. Proxmox nodes are connected power-wise to the same UPS and have NUT installed on them in netclient mode listening for power issue/commands from the synology over the LAN.

All seems to work well and, although I haven’t tested recently, I recall the synology UPS Server notified the Proxmox NUT clients after X minutes of being on battery (can’t recall whether you can configure a UPS battery % remaining trigger?) and they shutdown the VMs and then themselves gracefully (followed by the UPS itself). on power restore to the UPS, all restarted successfully - Although I recall I had to change the Proxmox host (Intel NUC) bios settings to get them to automatically start up on power restore from the UPS.
This is a long shot but could you provide me with a copy and paste of your config files. I did initially have this working and it the process of trying to complete the process I've broken everything and now it won't communicate back with the APC.


Any help would be greatly appreciated
 

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!