UPS configuration in FreeNAS VM (ESXi 6.5 host) with USB 3.0 controller

Status
Not open for further replies.

helgew

Cadet
Joined
Sep 10, 2017
Messages
5
I have FreeNAS (11.0-STABLE) running as a VM on an ESXi 6.5 host. When changing the assigned USB controller for the VM from 2.0 to 3.0, upsmon is no longer able to connect to the attached UPS (APC Back-UPS XS 1500G):
Code:
Nov 27 20:50:43 freenas ugen0.4: <American Power Conversion Back-UPS XS 1500G FW866.L8 .D USB FWL8> at usbus0
Nov 27 20:50:51 freenas upsmon[2279]: UPS [ups]: connect failed: Connection failure: Connection refused
Nov 27 20:50:51 freenas upsmon[2279]: Communications with UPS ups lost
Nov 27 20:50:55 freenas upsmon[2279]: UPS [ups]: connect failed: Connection failure: Connection refused
Nov 27 20:50:55 freenas upsmon[2279]: UPS ups is unavailable

Here are the nut configuration files:
Code:
root@freenas:/etc/local/nut # more ups.conf
[ups]
	driver = usbhid-ups
	port = /dev/ugen0.4
	desc = ""
	
root@freenas:/etc/local/nut # more upsd.conf
LISTEN 0.0.0.0
	
root@freenas:/etc/local/nut # more upsmon.conf
FINALDELAY 60
MONITOR ups 1 upsmon upsupordown master
NOTIFYCMD "/usr/local/sbin/upssched"
NOTIFYFLAG ONBATT SYSLOG+WALL+EXEC
NOTIFYFLAG LOWBATT SYSLOG+WALL+EXEC
NOTIFYFLAG ONLINE SYSLOG+WALL+EXEC
NOTIFYFLAG COMMBAD SYSLOG+WALL+EXEC
NOTIFYFLAG COMMOK SYSLOG+WALL+EXEC
NOTIFYFLAG REPLBATT SYSLOG+WALL+EXEC
NOTIFYFLAG NOCOMM SYSLOG+EXEC
NOTIFYFLAG FSD SYSLOG+EXEC
NOTIFYFLAG SHUTDOWN SYSLOG+EXEC
SHUTDOWNCMD "/sbin/shutdown -p now"
POWERDOWNFLAG /etc/nokillpower

root@freenas:/etc/local/nut # more upssched.conf
CMDSCRIPT   /usr/local/bin/custom-upssched-cmd
PIPEFN	  /var/db/nut/upssched.pipe
LOCKFN	  /var/db/nut/upssched.lock
	
AT NOCOMM   * EXECUTE EMAIL
AT COMMBAD  * START-TIMER COMMBAD 10
AT COMMOK   * CANCEL-TIMER COMMBAD COMMOK
AT FSD	  * EXECUTE EMAIL
AT LOWBATT  * EXECUTE EMAIL
AT ONBATT   * START-TIMER ONBATT 60
AT ONBATT   * EXECUTE EMAIL
AT ONLINE   * CANCEL-TIMER ONBATT ONLINE
AT ONLINE   * EXECUTE EMAIL
AT REPLBATT * EXECUTE EMAIL
AT SHUTDOWN * EXECUTE EMAIL

It does look like the OS detects the UPS just fine. The logs and usbconfig also report the appropriate speed for another connected USB 3.0 device (backup drive) when configured for the USB 3.0 controller. However, the usbhid-ups driver does not seem to like that one. I tried using some of the other drivers given in the interface without any luck.

Any pointers or advice would be greatly appreciated!
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080

Stux

MVP
Joined
Jun 2, 2016
Messages
4,358
Haven’t implemented shutdown yet. Getting ESXi *Free* to shutdown is tricky.

But you can shutdown/start ESXi VMs from inside the vm FreeNAS. There are scripts floating around.

Plan is to have FreeNAS startup all the other VMs when it’s finished booting, and shut them down when it decides to shutdown.

This would solve the UPS problem, except for ESXi.
 

helgew

Cadet
Joined
Sep 10, 2017
Messages
5
I think the thread got off-topic a little... before I can implement shutdown of ESXi (definitely something I need to do), I will have to get FreeNAS (or ESXi?) recognize the UPS when connected via the USB 3.0 controller.
 

Stux

MVP
Joined
Jun 2, 2016
Messages
4,358
I think the thread got off-topic a little... before I can implement shutdown of ESXi (definitely something I need to do), I will have to get FreeNAS (or ESXi?) recognize the UPS when connected via the USB 3.0 controller.

You should be able to pass-through a USB device into FreeNAS just fine. No need to pass in a whole controller I'd think... unless the UPS is playing games like the old serial ones did.
 
Status
Not open for further replies.
Top