==== First of all:
1) I understand this
is the official list of supported USB devices; however I hope you'll have a suggestion even if my hardware is not on that list.
2) I understand there are alternatives to connecting an UPS directly to a VM (ie: network agent). But right now we don't have one of those UPSes and I'd
like to convert a physical machine to virtual with as few changes as possible.
==== HARDWARE:
ESXi-4.1 on Dell PE-T310.
VM (virtual hw v7): RHEL5.x (CentOS), latest kernel (2.6.18-194.17.4.el5)
USB device: APC Back-UPS CS 650 (051d:0002)
If used on the real hardware, the UPS is detected w/o any issue, I can start apcupsd and check its status.
==== PROBLEM:
If used attached to the VM (ESXi: add USB controller, then ADD USB device) the device is "partially" detected:
See lines marked with "<==== PROBLEM":
hub 2-0:1.0: USB hub found
usb 2-1: new full speed USB device using uhci_hcd and address 2
usb 2-1: configuration #1 chosen from 1 choice
drivers/usb/input/hid-core.c: usb_submit_urb(ctrl) failed <===== PROBLEM
drivers/usb/input/hid-core.c: timeout initializing reports <===== PROBLEM
hiddev96: USB HID v1.10 Device [American Power Conversion Back-UPS CS 650
FW:817.v4.I USB FW:v4] on usb-0000:02:02.0-1
Those 2 lines are not present when installing Linux on the PE-T310 directly.
When used in the VM I can start apcupsd but then either I get no output from apcaccess or I get empty values, like:
CABLE : USB Cable
MODEL : Back-UPS CS 650
UPSMODE : Stand Alone
STARTTIME: Tue Oct 26 20:20:05 CEST 2010
STATUS : ONLINE
LINEV : 000.0 Volts <==== PROBLEM
LOADPCT : 0.0 Percent Load Capacity <==== PROBLEM
BCHARGE : 100.0 Percent
TIMELEFT : 27.2 Minutes
MBATTCHG : 5 Percent
MINTIMEL : 3 Minutes
MAXTIME : 0 Seconds
OUTPUTV : 000.0 Volts <==== PROBLEM
BATTDATE : 1980-00-00 <==== PROBLEM
...
==== THINGS I TRIED:
- adding the device to the kernel "quirks/HID_QUIRK_NOGET" list, w/o success.
- testing it on the same VM running on VMware Workstation 7.x: it works perfectly
Any suggestions?
Thanks
BTW, this is the log
grep -Ei "(usb|uhci)" vmware.log |grep -v "disk backing" > usb.log
Oct 29 20:40:51.353: vmx| DICT usb.present = TRUE
Oct 29 20:40:51.354: vmx| DICT usb.pciSlotNumber = 32
Oct 29 20:40:51.354: vmx| DICT usb:1.present = TRUE
Oct 29 20:40:51.354: vmx| DICT usb:1.deviceType = hub
Oct 29 20:40:51.354: vmx| DICT usb.analyzer.enable = true
Oct 29 20:40:51.354: vmx| DICT usb:0.present = FALSE
Oct 29 20:40:51.354: vmx| DICT usb.autoConnect.device0 = path:2/0/0
Oct 29 20:40:51.431: vmx| USB: Search for USB devices to connect Re: ESXi-4.1: USB passthrough problem with APC Back-UPS CS 650
Oct 29 20:40:51.431: vmx| USB: Initializing 'Generic' backend
Oct 29 20:40:51.431: vmx| USBGL: Connected to arbitrator socket: 39
Oct 29 20:40:51.431: vmx| USB: Initializing 'Virtual Hub' backend
Oct 29 20:40:51.431: vmx| USB: Initializing 'Virtual HID' backend
Oct 29 20:40:51.431: vmx| USB: Initializing 'Remote Device' backend
Oct 29 20:40:51.432: vmx| RemoteUSBVMX: Retrieved hostId Re: ESXi-4.1: USB passthrough problem with APC Back-UPS CS 650
Oct 29 20:40:51.432: vmx| RemoteUSBVMX: Protocol version 15
Oct 29 20:40:51.432: vmx| RemoteUSBVMX: no delay setting is TRUE.
Oct 29 20:40:51.432: vmx| USB: Initializing 'Virtual Mass Storage' backend
Oct 29 20:40:51.432: vmx| USB: Initializing 'Virtual CCID' backend
Oct 29 20:40:51.432: vmx| USB-CCID: failed to GetModulePath.
Oct 29 20:40:51.432: vmx| USB: Unable to initialize 'Virtual CCID' backend
Oct 29 20:40:51.464: vmx| USB: Initializing 'UHCI' host controller
Oct 29 20:40:51.465: vmx| USB: Initializing 'EHCI' host controller
Oct 29 20:40:51.487: vmx| USB: Autoconnecting device "APC Back-UPS CS 650 FW:817.v4.I USB FW:v4" matching pattern Re: ESXi-4.1: USB passthrough problem with APC Back-UPS CS 650
Oct 29 20:40:51.487: vmx| USB: Connecting device 0x20003051d0002
Oct 29 20:40:51.487: vmx| VMXVmdbLoadUsbDevices: New set of 1 USB devices
Oct 29 20:40:51.487: vmx| USB: Found device Re: ESXi-4.1: USB passthrough problem with APC Back-UPS CS 650
Oct 29 20:40:51.489: vmx| USBGA: device 20003051d0002 arrived
Oct 29 20:40:51.489: vmx| USBG: CONNREQ: Dequeued head request after 2 ms for Re: ESXi-4.1: USB passthrough problem with APC Back-UPS CS 650
Oct 29 20:40:51.557: vmx| USB: Device Re: ESXi-4.1: USB passthrough problem with APC Back-UPS CS 650 should already be connected
Oct 29 20:40:51.557: vmx| VMXVmdbLoadUsbDevices: New set of 1 USB devices
Oct 29 20:40:51.557: vmx| USB: Found device Re: ESXi-4.1: USB passthrough problem with APC Back-UPS CS 650
Oct 29 20:41:15.837: vcpu-0| UHCI: HCReset
Oct 29 20:41:19.375: vcpu-0| UHCI: HCReset
Oct 29 20:41:21.215: vmx| USBGL: SETCONFIGURATION=1 failed -1:16:Device or resource busy, work around triggered
Oct 29 20:41:22.034: vmx| UHCI: unexpected in/out 1 pid 69
Oct 29 20:41:22.551: vmx| UHCI: unexpected in/out 1 pid 69
Oct 29 20:41:23.054: vmx| UHCI: unexpected in/out 1 pid 69
Oct 29 20:41:23.559: vmx| UHCI: unexpected in/out 1 pid 69
Oct 29 20:41:24.064: vmx| UHCI: unexpected in/out 1 pid 69
Oct 29 20:41:24.565: vmx| UHCI: unexpected in/out 1 pid 69
Oct 29 20:41:25.071: vmx| UHCI: unexpected in/out 1 pid 69
Oct 29 20:41:25.574: vmx| UHCI: unexpected in/out 1 pid 69
Oct 29 20:41:26.080: vmx| UHCI: unexpected in/out 1 pid 69
Oct 29 20:41:26.581: vmx| UHCI: unexpected in/out 1 pid 69
Oct 29 20:41:27.086: vmx| UHCI: unexpected in/out 1 pid 69
Oct 29 20:41:27.591: vmx| UHCI: unexpected in/out 1 pid 69
Oct 29 20:41:28.093: vmx| UHCI: unexpected in/out 1 pid 69
Oct 29 20:41:28.601: vmx| UHCI: unexpected in/out 1 pid 69
Oct 29 20:41:29.103: vmx| UHCI: unexpected in/out 1 pid 69
Oct 29 20:41:29.610: vmx| UHCI: unexpected in/out 1 pid 69
Oct 29 20:41:30.113: vmx| UHCI: unexpected in/out 1 pid 69
Oct 29 20:41:30.617: vmx| UHCI: unexpected in/out 1 pid 69
Oct 29 20:41:31.121: vmx| UHCI: unexpected in/out 1 pid 69
Oct 29 20:41:31.627: vmx| UHCI: unexpected in/out 1 pid 69
I then tried "uhci.syncWriteback = true" and "usb.generic.skipsetconfi=true" w/o success.
===
I verified that it will work if I take the VMDirectPath route instead of USB passthrough.
Unfortunately VMDirectPath has its own issues (all configured memory is reserved, no snapshots while running, all USB devices connected to the same PCI device linked to the same VM,...).
I've been having this exact same problem with an APC XS 1500. Interestingly, while the linux driver seems to have a problem, other guest operating systems seem to be able to interact with the APC just fine. I tried installing apcupsd from pkgsrc in a NetBSD 5.0.2 guest and everything worked just as it was supposed to.
It's not clear to me yet if this is a bug in the linux HID or something idiosyncratic with the virtual usb controller, but I'm inclined to suspect the former.
I've tested in Fedora 10, 13, and 14, with both 32 and 64-bit kernels/libraries; and in NetBSD 5.0.2, 32-bit- only.
I have same problem. Did you manage to solve this?
Not exactly. What I did was to get a Smart-UPS with a network card, and use that to monitor the status of the UPS. The network interface provides quite a bit more information anyway.