apcupsd on pve 4.4 not working properly

kobuki

Renowned Member
Dec 30, 2008
474
28
93
I know it's not exactly an apcupsd UPS support site, but I hope that someone else might have seen the same issues as I, as it possibly relates to the PVE kernel.

I've upgraded 2 systems where previously we ran PVE 3.4 latest. These systems used apcupsd for smaller MGE/Eaton Ellipse UPS boxes. They were perfectly fine, apcaccess has displayed proper status info, shutdown, etc. was properly carried out. On PVE 4.4 it's broken, apcaccess is displaying this:
Code:
APC      : 001,028,0643
DATE     : 2017-05-04 12:57:23 +0200
HOSTNAME : behemoth
VERSION  : 3.14.12 (29 March 2014) debian
UPSNAME  : behemoth
CABLE    : USB Cable
DRIVER   : USB UPS Driver
UPSMODE  : Stand Alone
STARTTIME: 2017-05-04 12:57:22 +0200
MODEL    :
STATUS   : ONLINE
LOADPCT  : 0.0 Percent
BCHARGE  : 0.0 Percent
TIMELEFT : 0.0 Minutes
MBATTCHG : 40 Percent
MINTIMEL : 3 Minutes
MAXTIME  : 0 Seconds
OUTPUTV  : 0.0 Volts
DWAKE    : 0 Seconds
LOTRANS  : 0.0 Volts
HITRANS  : 0.0 Volts
ALARMDEL : 30 Seconds
NUMXFERS : 0
TONBATT  : 0 Seconds
CUMONBATT: 0 Seconds
XOFFBATT : N/A
STATFLAG : 0x05000008
SERIALNO :
END APC  : 2017-05-04 12:57:24 +0200

It appears the UPS is not properly recognised as all important values are bogus.

PVE version:
Code:
proxmox-ve: 4.4-87 (running kernel: 4.4.59-1-pve)
pve-manager: 4.4-13 (running version: 4.4-13/7ea56165)
pve-kernel-4.4.59-1-pve: 4.4.59-87
lvm2: 2.02.116-pve3
corosync-pve: 2.4.2-2~pve4+1
libqb0: 1.0.1-1
pve-cluster: 4.0-49
qemu-server: 4.0-110
pve-firmware: 1.1-11
libpve-common-perl: 4.0-94
libpve-access-control: 4.0-23
libpve-storage-perl: 4.0-76
pve-libspice-server1: 0.12.8-2
vncterm: 1.3-2
pve-docs: 4.4-4
pve-qemu-kvm: 2.7.1-4
pve-container: 1.0-99
pve-firewall: 2.0-33
pve-ha-manager: 1.0-40
ksm-control-daemon: 1.2-1
glusterfs-client: 3.5.2-2+deb8u3
lxc-pve: 2.0.7-4
lxcfs: 2.0.6-pve1
criu: 1.6.0-1
novnc-pve: 0.5-9
smartmontools: 6.5+svn4324-1~pve80
fence-agents-pve: not correctly installed

Does any one have an idea? I've tried to downgrade to the old Wheezy version, upgraded to latest from sources, none worked, so I'm suspecting it's PVE or PVE kernel specific.
 
Hello kobuki,

It seems to be very strange .... what you have ;) I have also install in Proxmox 4.4(I gues it was few days ago) tje same, but it is working for me, take a look:

Code:
APC      : 001,036,0876
DATE     : 2017-05-04 14:31:02 +0300 
HOSTNAME : nobody-is-here
VERSION  : 3.14.12 (29 March 2014) debian
UPSNAME  : MY
CABLE    : USB Cable
DRIVER   : USB UPS Driver
UPSMODE  : Stand Alone
STARTTIME: 2017-05-04 07:21:43 +0300 
MODEL    : Back-UPS XS 950U   
STATUS   : ONLINE
LINEV    : 244.0 Volts
LOADPCT  : 12.0 Percent
BCHARGE  : 100.0 Percent
TIMELEFT : 48.0 Minutes
MBATTCHG : 15 Percent
MINTIMEL : 5 Minutes
MAXTIME  : 0 Seconds
SENSE    : Medium
LOTRANS  : 160.0 Volts
HITRANS  : 280.0 Volts
ALARMDEL : 30 Seconds
BATTV    : 13.4 Volts
LASTXFER : Unacceptable line voltage changes
NUMXFERS : 0
TONBATT  : 0 Seconds
CUMONBATT: 0 Seconds
XOFFBATT : N/A
SELFTEST : NO
STATFLAG : 0x05000008
SERIALNO : 3Bxxxxxxxx 
BATTDATE : 2015-07-10
NOMINV   : 230 Volts
NOMBATTV : 12.0 Volts
NOMPOWER : 480 Watts
FIRMWARE : 925.T1 .I USB FW:T1
END APC  : 2017-05-04 14:31:02 +0300


In your case I would try to make a backup for /etc/apcupsd, and then I would remove(with the conf files) and then reinstall again apcupsd!

Have a nice day.
 
Thanks for answering, I see you have an APC model. I have MGE/Eaton Ellipse models that have been working perfectly fine on PVE 3.4. The problem might only come up when MGE (or specific models) AND PVE 4.4 is used together.
 
Maybe you are wright! If you can not solve a problem try to avoid it ... ;)
Whay dou you not try to create a guest in proxmox with kvm/qemu, and install your previous version of proxmox(when your apcupsd was working) or any echivalent debian version. Then setup a pass-thrue for usb for this VM(see the wiki proxmox). And test that is OK for you. In a succes case, you need only to pust some custom scripts for power-down events and so on !!!
 
I have actually just finished such a test. I've set up a PVE 3.4 instance in a KVM VM, passed the appropriate USB device to it and - it works.
Code:
root@pve3test:~# apcaccess
APC      : 001,028,0707
DATE     : 2017-05-04 14:33:41 +0200
HOSTNAME : pve3test
VERSION  : 3.14.10 (13 September 2011) debian
UPSNAME  : pve3test
CABLE    : USB Cable
DRIVER   : USB UPS Driver
UPSMODE  : Stand Alone
STARTTIME: 2017-05-04 14:33:37 +0200
MODEL    : Ellipse ECO
STATUS   : ONLINE
LOADPCT  :  10.0 Percent Load Capacity
BCHARGE  : 087.0 Percent
TIMELEFT :  38.4 Minutes
MBATTCHG : 40 Percent
MINTIMEL : 3 Minutes
MAXTIME  : 0 Seconds
OUTPUTV  : 230.0 Volts
DWAKE    : -01 Seconds
LOTRANS  : 184.0 Volts
HITRANS  : 264.0 Volts
ALARMDEL : 30 seconds
NUMXFERS : 0
TONBATT  : 0 seconds
CUMONBATT: 0 seconds
XOFFBATT : N/A
STATFLAG : 0x07000008 Status Flag
SERIALNO : 000000000
END APC  : 2017-05-04 14:33:48 +0200
root@pve3test:~# pveversion -v
proxmox-ve-2.6.32: 3.4-156 (running kernel: 2.6.32-39-pve)
pve-manager: 3.4-6 (running version: 3.4-6/102d4547)
pve-kernel-2.6.32-39-pve: 2.6.32-156
lvm2: 2.02.98-pve4
clvm: 2.02.98-pve4
corosync-pve: 1.4.7-1
openais-pve: 1.1.4-3
libqb0: 0.11.1-2
redhat-cluster-pve: 3.2.0-2
resource-agents-pve: 3.9.2-4
fence-agents-pve: 4.0.10-2
pve-cluster: 3.0-17
qemu-server: 3.4-6
pve-firmware: 1.1-4
libpve-common-perl: 3.0-24
libpve-access-control: 3.0-16
libpve-storage-perl: 3.0-33
pve-libspice-server1: 0.12.4-3
vncterm: 1.1-8
vzctl: 4.0-1pve6
vzprocps: 2.0.11-2
vzquota: 3.1-2
pve-qemu-kvm: 2.2-10
ksm-control-daemon: 1.1-1
glusterfs-client: 3.5.2-1

Apparently some change in the new PVE series broke something in a weird way.

However, I don't want to depend on a VM for an important facility such as UPS initiated shutdown, etc. It's not the right way.
 
Quick update. It doesn't work on the upstream Ubuntu kernel either. Used kernel version:

Linux upstest1 4.4.0-77-generic #98-Ubuntu SMP Wed Apr 26 08:34:02 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

It is most probably not related to PVE, only the kernel it uses. Will try to submit a bug report for Ubuntu...
 

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!