This article explains how to add USB devices as Datastores in VMware ESXi 7.0. Adding USB devices as datastores was also possible in previous versions, but in vSphere 7 it has become even easier.
Please be aware that using USB Datastores is not supported by VMware so be careful when using this method with sensitive data.
In this example, I'm using a USB 3.0 to NGFF M.2 case.
USB Drive Recommendations
There are plenty of options that you can use as Datastores:
- NGFF M.2 to USB Adapter
- Mini PCIe to USB Adapter
- USB Flash Drive
- 2.5" USB Hard Drive
- 3.5" USB Hard Drive
Step 1 - Disable usbarbitrator service
When you connect a USB device to an ESXi host, the usbarbitrator service claims it to make it available for virtual machines. The usbarbitrator service needs to be stopped so that the ESXi has access to it.
Make sure to disable usbarbitrator prior to plug the USB drive into your ESXi host.
Option 1 - Advanced Setting
- Open the vSphere Client
- Navigate to ESX > Configure > System > Advanced System Settings and click Edit...
- Search for USB.arbitratorAutoStartDisabled and set the Value to 1
- Reboot the ESXi
Option 2 - CLI
- Connect to the ESXi host with SSH
- Stop the USB arbitrator service.
~ # /etc/init.d/usbarbitrator stop
- Permanently disable the USB arbitrator service after reboot.
~ # chkconfig usbarbitrator off
- No reboot is required
Step 2 - Create VMFS Datastore
Creating the Datastore in vSphere 7.0 is is very simple. You no longer have to rely on partedUtil and vmkfstools as in previous versions. Datastores on USB drives can be created using the vSphere Client.
- Plug in the USB device to your ESXi host.
- While connecting, check /var/log/vmkernel.log for errors. It should been registered using the following message:
ScsiDevice: 5745: Successfully registered device "mpx.vmhba34:C0:T0:L0" from plugin "NMP" of type 0
Note: When you have the vmkusb NIC Fling installed, and the usbarbitrator is still active, you get the following error message:
vmkusb_nic_fling: usbd_req_re_enumerate:2205: addr=4, set address failed! (USB_ERR_IOERROR, ignored) vmkusb_nic_fling: usbd_setup_device_desc:2099: getting device descriptor at addr 4 failed, USB_ERR_IOERROR vmkusb_nic_fling: uhub_reattach_port:981: could not allocate new device
You do not have to remove the vmkusb NIC Fling, just disable the usbarbitrator service as explained in Step 1.
- Navigate to ESX > Configure > Storage > Storage Devices and verify that the device has been added.
- USB devices are tagged as "HDD" by default. If you are using an SSD, mark it as Flash as explained in this article.
- Navigate to Actions > Storage > New Datastore and follow the wizard to create the Datastore
Existing Datastores are not mounted automatically
A common problem that I've heard multiple times, is that when you connect a drive that already contains a VMFS datastore, the datastore does not show up. You can see the device but the datastore remains offline. The vmkernel.log hints the problem:
cpu0:65593)LVM: 11136: Device naa.5000000000000001:1 detected to be a snapshot:
The datastore is detected as a snapshot. Get a list of VMFS snapshots with esxcli:
# esxcli storage vmfs snapshot list 583b1a72-ade01532-55f6-f44d30649051 Volume Name: usbflash VMFS UUID: 583b1a72-ade01532-55f6-f44d30649051 Can mount: true Reason for un-mountability: Can resignature: true Reason for non-resignaturability: Unresolved Extent Count: 1
Use the VMFS UUID to mount the datastore:
# esxcli storage vmfs snapshot mount -u 583b1a72-ade01532-55f6-f44d30649051
The datastore should now be usable.
USB Datastore on USB drives >2TB
There is a limit that prevents you from using USB drives with >2TB capacity. Currently, there is no workaround.
[Update]: In vSphere 7, some USB drives with >2TB capacity are failing to mount with a "Device does not contain a logical volume" error. This appears to be device specific:
cpu2:524312)ScsiDeviceIO: 4035: Cmd(0x453a4104dec0) 0x1a, CmdSN 0xce25 from world 0 to dev "mpx.vmhba35:C0:T0:L0" failed H:0x0 D:0x2 P:0x0 Valid sense data: 0x5 0x24 0x0. cpu1:526326 opID=7bbfb4d2)LVM: 13107: LVMProbeDevice failed with status "Device does not contain a logical volume". cpu1:524550)ScsiPath: 7771: Aborted Cmd(0x453a410169c0) 0x28, cmdId.initiator=0x4303560e2dc0 CmdSN 0x112 from world 526285 to path "vmhba35:C0:T0:L0". Cmd count Active:1 Queued:0. cpu1:524550)NMP: nmp_ThrottleLogForDevice:3856: Cmd 0x2a (0x453a410155c0, 526285) to dev "mpx.vmhba35:C0:T0:L0" on path "vmhba35:C0:T0:L0" Failed: cpu1:524550)WARNING: NMP: nmp_DeviceRequestFastDeviceProbe:237: NMP device "mpx.vmhba35:C0:T0:L0" state in doubt; requested fast path state update... cpu1:524550)ScsiDeviceIO: 4052: Cmd(0x453a410155c0) 0x2a, cmdId.initiator=0x4303560e2dc0 CmdSN 0x112 from world 526285 to dev "mpx.vmhba35:C0:T0:L0" failed H:0x5 D:0x0 P:0x0 . Cmd count Active:1 Queued:0 cpu2:524312)ScsiDeviceIO: 4035: Cmd(0x453a41105ac0) 0x1a, CmdSN 0xce84 from world 0 to dev "mpx.vmhba35:C0:T0:L0" failed H:0x0 D:0x2 P:0x0 Valid sense data: 0x5 0x24 0x0. cpu0:526327 opID=7dfda24f)World: 12458: VC opID sps-Main-327424-531-5a-1-143b maps to vmkernel opID 7dfda24f cpu0:526326 opID=7bbfb4d2)LVM: 10713: LVMProbeDevice failed on (3291089120, mpx.vmhba35:C0:T0:L0:1): Device does not contain a logical volume cpu0:526326 opID=7bbfb4d2)FSS: 2393: Failed to create FS on dev [mpx.vmhba35:C0:T0:L0:1] fs [Datastore] type [vmfs6] fbSize 1048576 => Timeout