There was another interesting question that I saw recently asking whether you can use a USB device for an ESXi Datastore while still maintaining the ability to passthrough other USB devices to a VM? This was interesting because my understanding was that you had to choose between one of the two options because ESXi required the USB Arbitrator service to be disabled for USB storage (not officially supported by VMware) and thus disabling USB passthrough for all of your VMs.
I decided to reach out to our USB expert within VMware Engineering, Songtao, who you may know as developer for the popular USB Network Native Driver for ESXi and the Community Networking Driver for ESXi Fling for this thoughts on this question. It turns out my assumption has actually been incorrect and there is actually a way to easily exclude specific USB devices from VM passthrough which can then be used by ESXi.
Below are two options for excluding a specific USB device from passthrough.
Option 1:
Step 1 - Use the following ESXCLI command to list the available USB devices and then identify the USB device that you wish to disable for passthrough. In the example below, I have two USB storage devices which have VendorId:ProductId 90c:2000 and 90c:1000 respectively. The latter device is a 256GB USB device that I will setup VMFS on
esxcli hardware usb passthrough device list
Step 2 - Run the following ESXCLI command and pass in the Bus, Dev, VendorId and ProductID of the USB device that you wish to disable passthrough for.
esxcli hardware usb passthrough device disable -d 2:7:90c:1000
Step 3 - You can verify by re-running the ESXCLI list operation in Step 1 and for the changes to go into effect, you will need to reboot the ESXi host.
Once the ESXi boots up, you now can now setup an ESXi Datastore on the USB device without needing to disable the USB Arbitrator service.
Option 2:
If the above ESXCLI command is not available, there is an alternative option which leverages the USB "quirks" configuration setting which will allow for the same USB exclusion.
Step 1 - Run lsusb command to list all USB devices and identify the USB device that you wish to disable for passthrough. In the example below, I wish to disable passthrough for USB device 090c:2000 and you will need to make a note of the VendorId:ProductId
Step 2 - Run the following ESXCLI command to configure the USB quirks configuration and replace the VendorId:ProductId value for the changes to go into effect, you will need to reboot the ESXi host.
esxcli system settings advanced set -o /USB/quirks -s 0x090c:0x2000:0:0xffff:UQ_MSC_NO_UNCLAIM
Once the ESXi boots up, you now can now setup an ESXi Datastore on the USB device without needing to disable the USB Arbitrator service.
michele domanico (@MicheleDomanico) says
Hi William,
great content as always! Quick question on USB devices for a different context 🙂
Do you know if there is a way to rescan the usb devices on the ESXi hosts? I have noticed usb network adapters might disappear from vSphere client (and loose connectivity) but still available on the host with a lsusb command.
Thanks,
Michele
William Lam says
This definitely shouldn’t be happening. Can you please provide vm-support and I can share that w/Engr. Feel free to email me by going to About section
amit says
William, I am able to setup 4 TB usb device using your other article but when I reboot the usb device becomes passthrough again. I havent tried the quirk thing but anything else I can try to make it persistent.
witewulf says
Hi all, I'm seeing the same problem. I followed William's guide for setting up USB storage as a datastore (temporary solution for backups, not "live" data) but the passthrough disable doesn't persist reboots.
colin says
Hi William, great content as always! Thank you.
For the option 2,why the command is:
esxcli system settings advanced set -o /USB/quirks -s 0x090c:0x1000:0:0xffff:UQ_MSC_NO_UNCLAIM
but not
esxcli system settings advanced set -o /USB/quirks -s 0x090c:0x2000:0:0xffff:UQ_MSC_NO_UNCLAIM
? (0x1000 vs 0x2000)
William Lam says
You’re correct, it’s typo. The first example was “1000” and must have forgotten when I switched to “2000” in second example. It’s fixed
colin says
Got it. Thank you for your comment.
luba says
Amazing!!! Thanks for this!!!
maiux says
Hello, thanks for these wonderful tips. I'm trying to make settings persistents across reboots because I made two local USB based datastores for ghettoVCB backups and I noticed that for some reason (crappy hw? :)) bus number changes on poweroff/poweron. So I'm going for option 2 (QUIRKS). Is there any way to specify more than one device to exclude from passthrough? Or, is there another way to make passthrough persistent across reboot?
Shawn Cornelius says
William,
Should I be able to re-enable a device using "enable" instead of "disable"? I tried to enable my USB NIC for passthough, but it doesn't seem to work. The NIC is instead showing up as VUSB0 using the CDCE driver. I couldn't find a CDCE module to disable. Any idea how I can get my USB NICs to be available for passthrough?
[root@esxi:~] esxcli hardware usb passthrough device enable -d 1:6:bda:8153
[root@esxi:~] esxcli hardware usb passthrough device list
Bus Dev VendorId ProductId Enabled Can Connect to VM Name
--- --- -------- --------- ------- ------------------------- ----
1 6 bda 8153 false no (passthrough disabled) Realtek Semiconductor Corp. RTL8153 Gigabit Ethernet Adapter
Thanks,
Shawn
William Lam says
Yea, in the case where cdce driver is automatically claiming the USB NIC, you'll need to apply USB Quirk to tell VMkernel not to claim the device.
In your example, just run the following ESXCLI command: esxcli system settings advanced set -o /USB/quirks -s 0x0bda:0x8153:0:0xffff:UQ_NET_IGNORE and then reboot for change to go into effect