Skip to content

USB Devices as VMFS Datastore in vSphere ESXi 7.0

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 before plugging the USB drive into your ESXi host.

Option 1 - Advanced Setting

  1. Open the vSphere Client
  2. Navigate to ESX > Configure > System > Advanced System Settings and click Edit...
  3. Search for USB.arbitratorAutoStartDisabled and set the Value to 1
  4. Reboot the ESXi

Option 2 - CLI

  1. Connect to the ESXi host with SSH
  2. Stop the USB arbitrator service.
    ~ # /etc/init.d/usbarbitrator stop
  3. Permanently disable the USB arbitrator service after reboot.
    ~ # chkconfig usbarbitrator off
  4. 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.

  1. Plug in the USB device to your ESXi host.
  2. 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.

  3. Navigate to ESX > Configure > Storage > Storage Devices and verify that the device has been added.
  4. USB devices are tagged as "HDD" by default. If you are using an SSD, mark it as Flash as explained in this article.
  5. Navigate to Actions > Storage > New Datastore and follow the wizard to create the Datastore

 

Known Problems

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

20 thoughts on “USB Devices as VMFS Datastore in vSphere ESXi 7.0”

    1. Pretty late reply: I get around 110 MB/s (deploy VM from template) on an EVO 860 over USB 3.0. Not terrible, not great. Since the external enclosure was pretty cheap, I don't expect more.

  1. Hy,

    i see my USB Stick in STorage Devices, but when i try to create an datstore no USB Storage Device is listed.

    Maybe any hints for me?

    Its an 256GB USB Stick.

    Thx Andy

  2. You need to use "old" procedure "https://www.virten.net/2016/11/usb-devices-as-vmfs-datastore-in-vsphere-esxi-6-5/" and if your device is named mpx.vmhba:Cx:Tx:Lx without :x at the end, you need to add :1 in vmfs6 creation command. Example: vmkfstools -C vmfs6 -S USB-DS /dev/disks/mpx.vmhba34:C0:T0:L0:1.

    ESXi version: 7.0.1, 16850804

  3. Unfortunately, this isn't working for me with ESXi 7 U2 and a 2.5" external Samsung SSD.

    After disabling the USB arbitrator service and rebooting, I plug in the disk and vmkernel.log says, "DMA Engine 'vmhba33' created using mapper 'DMANull'". But it never says, "Successfully registered device...", I don't see 'vmhba33' when I do "ls /dev/disks" and the disk never appears as a device in the GUI.

  4. Thanks to this awesome blog, I've been using this method for the last ~4 or so years, first with ESXi 6.0, then 6.5, and now 6.7.

    All was fine for the last year or so on 6.7, but recently a few datastores stopped responding.
    I rebooted the host, and now two of my datastores won't come online, even though the drives they live on are visible to the host.

    Under the above heading 'Existing Datastores Not Mounting Automatically", I followed the instructions to look for snapshots, but unlike in the example, my datastores show as un-mountable:

    [root@localhost:~] esxcli storage vmfs snapshot list
    58093217-a9790f66-8740-b8aeed7bdb97
    Volume Name: BigData0
    VMFS UUID: 58093217-a9790f66-8740-b8aeed7bdb97
    Can mount: false
    Reason for un-mountability: the original volume has some extents online
    Can resignature: true
    Reason for non-resignaturability:
    Unresolved Extent Count: 1

    580932cd-eeab161a-7963-b8aeed7bdb97
    Volume Name: BigData1
    VMFS UUID: 580932cd-eeab161a-7963-b8aeed7bdb97
    Can mount: false
    Reason for un-mountability: the original volume has some extents online
    Can resignature: true
    Reason for non-resignaturability:
    Unresolved Extent Count: 1

    Does anyone know the meaning of 'original volume has some extents online'?
    I searched online, but found nothing helpful.

    Thanks in advance for any ideas!!

  5. I'm not sure if the 2TB limit still applies. I was able to go through this process with a 3TB USB HDD using VMFS 6.82 on ESXi 7.0u2 without any problems.

  6. suggest to disable passthrough for specific usb hdd.
    esxcli hardware usb passthrough device list
    esxcli hardware usb passthrough device disable -d xxxx:xxx

    remake: disable usbarbitrator service, it will be affected usb dongle passthrough

  7. I'm using a Western Digital MyBook external back drive, 2TB.
    It works, except from time to time, the MyBook goes to sleep, the VMs using that datastore hang, and it seems a reboot is the only way to recover.
    Any tips?

    1. Hi, how did you get it working?
      I can see the WD in devices:
      Local USB Direct-Access (mpx.vmhba33:C0:T0:L0) 1.82TB but cannot select it to use as a new datastore. I just get "no devices with free space" message when trying to make a new one.

    1. Thanks Squirrel for noting this. This is useful for those need more than 2 T. I followed the article and mounted 8T to my home lab successfully, so there is no limitation, it depends on your hardware !

  8. I'm looking to replace a NVMe SSD with a larger one in a system with no more CIe or NVMe slots available and stumbled upon this post. If I put the larger NVMe in an external enclosure, set it up as a datastore and move the VMs over, can I then swap in the NVMe drives on the motherboard and expect things to work?

    Or do I have to move the VMs over to say a SATA drive first and then move them to the new NVMe once it is on the motherboard?

    Thanks

  9. Hi again
    Is there a way maybe to disable a kind of timeout ?
    Or should i disable the APD with that command :
    esxcli system settings advanced set -o "/Misc/APDHandlingEnable" --int-value "0"

    Or should i disable the PDL :
    esxcli system settings advanced set -o "/Disk/AutoremoveOnPDL" -i 0

    Or something else ?

    Have that commands a sense ?

  10. Hello,
    I bought a Samsung T7 usb-c hard drive to connect using your procedure.
    The procedure works very well and the drive is recognized. Second datastore ESXi 7.0U3.
    However, the hard disk doesn't seem to be recognized by the ESX for a long time and it appears inaccessible and has been removed from the host. I have numerous errors in the logs.
    Can this be due to the USB-c hard drive itself? Could it be that a SATA USB-A hard drive would hold up better?
    Are there any settings to apply to ESX host to do not disconnect that external usb drive ? Its annoying because i must stop all VM's to reboot host
    An once rebooted, USB-c external drive reappears and works !
    Maybe its due to release of ESX 7.x ?

    Here are bellow some log's messages on ESX

    2022-12-01T15:29:50.469Z cpu3:1048732)WARNING: NMP: nmpUnclaimPath:1732: NMP device "mpx.vmhba32:C0:T0:L0" quiesce state change failed: Busy
    2022-12-01T15:29:50.469Z cpu3:1048732)WARNING: ScsiPath: 6873: Path vmhba32:C0:T0:L0 is being removed
    2022-12-01T15:29:50.469Z cpu3:1048732)WARNING: ScsiPath: 7187: Failed to issue command 0x0 (cmdSN 0x0) on path vmhba32:C0:T0:L0: No connection
    2022-12-01T15:29:50.469Z cpu3:1048732)WARNING: ScsiScan: 2044: Could not delete path vmhba32:C0:T0:L0
    2022-12-01T15:29:50.472Z cpu0:1051911)WARNING: NMP: nmp_IssueCommandToDevice:5950: I/O could not be issued to device "mpx.vmhba32:C0:T0:L0" due to Not found
    2022-12-01T15:29:50.472Z cpu0:1051911)WARNING: NMP: nmp_DeviceRetryCommand:133: Device "mpx.vmhba32:C0:T0:L0": awaiting fast path state update for failover with I/O blocked. No prior reservation exists on the device.
    2022-12-01T15:29:50.472Z cpu0:1051911)WARNING: NMP: nmp_DeviceStartLoop:740: NMP Device "mpx.vmhba32:C0:T0:L0" is blocked. Not starting I/O from device.
    2022-12-01T15:29:50.615Z cpu0:1048953)WARNING: NMP: nmpDeviceAttemptFailover:647: Retry world failover device "mpx.vmhba32:C0:T0:L0" - issuing command 0x4578c112adc8
    2022-12-01T15:29:50.615Z cpu0:1048953)WARNING: NMP: nmpDeviceAttemptFailover:722: Retry world failover device "mpx.vmhba32:C0:T0:L0" - failed to issue command due to Not found (APD), try again...
    2022-12-01T15:29:50.615Z cpu0:1048953)WARNING: NMP: nmpDeviceAttemptFailover:772: Logical device "mpx.vmhba32:C0:T0:L0": awaiting fast path state update...
    2022-12-01T15:29:51.613Z cpu5:1048953)WARNING: NMP: nmpDeviceAttemptFailover:647: Retry world failover device "mpx.vmhba32:C0:T0:L0" - issuing command 0x4578c112adc8
    2022-12-01T15:29:51.613Z cpu5:1048953)WARNING: NMP: nmpDeviceAttemptFailover:722: Retry world failover device "mpx.vmhba32:C0:T0:L0" - failed to issue command due to Not found (APD), try again...
    2022-12-01T15:29:51.613Z cpu5:1048953)WARNING: NMP: nmpDeviceAttemptFailover:772: Logical device "mpx.vmhba32:C0:T0:L0": awaiting fast path state update...
    2022-12-01T15:30:01.784Z cpu4:1049023)WARNING: NMP: nmp_DeviceStartLoop:740: NMP Device "mpx.vmhba32:C0:T0:L0" is blocked. Not starting I/O from device.
    2022-12-01T15:30:01.784Z cpu4:1049023)WARNING: NMP: nmp_DeviceStartLoop:740: NMP Device "mpx.vmhba32:C0:T0:L0" is blocked. Not starting I/O from device.

    022-12-01T18:16:08.557Z cpu2:1048961)WARNING: NvmeScsi: 172: SCSI opcode 0x1a (0x4578c13fe188) on path vmhba1:C0:T0:L0 to namespace t10.NVMe____CT2000P5PSSD8___________________________7ECDF43A0175A000 failed with NVMe error status: 0x2
    2022-12-01T18:16:08.557Z cpu2:1048961)WARNING: translating to SCSI error H:0x0 D:0x2 P:0x0 Valid sense data: 0x5 0x24 0x0
    2022-12-01T18:16:08.557Z cpu0:1048603)WARNING: ScsiDeviceIO: 4052: ModeSense 0x1a request failed - blocking page:0x1c subpage:0x2 t10.NVMe____CT2000P5PSSD8___________________________7ECDF43A0175A000
    2022-12-09T07:53:27.867Z cpu3:1048993)WARNING: vmkusb: udev 0x430c37d931b8, endpoint 0x0: invalid state 5: Failure
    2022-12-09T07:53:27.867Z cpu4:1048725)WARNING: NMP: vmk_NmpSatpIssueTUR:1146: Device mpx.vmhba32:C0:T0:L0 path vmhba32:C0:T0:L0 has been unmapped from the array
    2022-12-09T07:53:27.867Z cpu0:1048605)WARNING: NMP: nmp_DeviceRequestFastDeviceProbe:237: NMP device "mpx.vmhba32:C0:T0:L0" state in doubt; requested fast path state update...
    2022-12-09T07:53:27.867Z cpu4:1048725)WARNING: ScsiDevice: 1750: Device :mpx.vmhba32:C0:T0:L0 has been removed or is permanently inaccessible.
    2022-12-09T07:53:27.879Z cpu5:1048731)WARNING: ScsiPath: 6873: Path vmhba32:C0:T0:L0 is being removed
    2022-12-09T07:53:27.968Z cpu0:1048731)WARNING: NMP: nmpUnclaimPath:1806: Physical path "vmhba32:C0:T0:L0" is the last path to NMP device "Unregistered Device". The device has been unregistered.
    2022-12-09T07:53:27.968Z cpu1:1048731)WARNING: ScsiPath: 9139: Remove path: vmhba32:C0:T0:L0
    2022-12-09T07:53:39.713Z cpu1:1048978)WARNING: ScsiPath: 9487: Adapter Invalid does not exist
    2022-12-11T22:46:01.586Z cpu0:1048601)WARNING: NMP: nmp_DeviceRequestFastDeviceProbe:237: NMP device "mpx.vmhba32:C0:T0:L0" state in doubt; requested fast path state update...
    2022-12-11T22:46:02.104Z cpu0:1048601)WARNING: NMP: nmp_DeviceRequestFastDeviceProbe:237: NMP device "mpx.vmhba32:C0:T0:L0" state in doubt; requested fast path state update...
    2022-12-11T22:46:03.742Z cpu0:1048993)WARNING: vmkusb: udev 0x430c37da3408, endpoint 0x0: invalid state 5: Failure
    2022-12-11T22:46:03.742Z cpu5:1048601)WARNING: NMP: nmp_PathDetermineFailure:3527: Cmd (0x25) PDL error (0x5/0x25/0x0) - path vmhba32:C0:T0:L0 device mpx.vmhba32:C0:T0:L0 - triggering path evaluation
    2022-12-11T22:46:03.742Z cpu1:1048725)WARNING: NMP: vmk_NmpSatpIssueTUR:1146: Device mpx.vmhba32:C0:T0:L0 path vmhba32:C0:T0:L0 has been unmapped from the array
    2022-12-11T22:46:03.742Z cpu1:1048725)WARNING: ScsiDevice: 1750: Device :mpx.vmhba32:C0:T0:L0 has been removed or is permanently inaccessible.
    2022-12-11T22:46:03.742Z cpu3:1048732)WARNING: ScsiPath: 6873: Path vmhba32:C0:T0:L0 is being removed
    2022-12-11T22:46:03.742Z cpu4:1048732)WARNING: NMP: nmpUnclaimPath:1806: Physical path "vmhba32:C0:T0:L0" is the last path to NMP device "Unregistered Device". The device has been unregistered.
    2022-12-11T22:46:03.742Z cpu4:1048732)WARNING: ScsiPath: 9139: Remove path: vmhba32:C0:T0:L0
    2022-12-11T22:46:15.588Z cpu7:1048978)WARNING: ScsiPath: 9487: Adapter Invalid does not exist
    2022-12-13T10:57:55.953Z cpu1:1048601)WARNING: NMP: nmp_DeviceRequestFastDeviceProbe:237: NMP device "mpx.vmhba32:C0:T0:L0" state in doubt; requested fast path state update...
    2022-12-13T10:57:57.080Z cpu0:1048993)WARNING: vmkusb: udev 0x430c37dbb408, endpoint 0x0: invalid state 5: Failure
    2022-12-13T10:57:57.080Z cpu4:1048725)WARNING: NMP: vmk_NmpSatpIssueTUR:1146: Device mpx.vmhba32:C0:T0:L0 path vmhba32:C0:T0:L0 has been unmapped from the array
    2022-12-13T10:57:57.080Z cpu2:1048601)WARNING: NMP: nmp_DeviceRequestFastDeviceProbe:237: NMP device "mpx.vmhba32:C0:T0:L0" state in doubt; requested fast path state update...
    2022-12-13T10:57:57.080Z cpu4:1048725)WARNING: ScsiDevice: 1750: Device :mpx.vmhba32:C0:T0:L0 has been removed or is permanently inaccessible.
    2022-12-13T10:57:57.100Z cpu4:1048728)WARNING: NMP: nmpUnclaimPath:1732: NMP device "mpx.vmhba32:C0:T0:L0" quiesce state change failed: Busy
    2022-12-13T10:57:57.100Z cpu4:1048728)WARNING: ScsiPath: 6873: Path vmhba32:C0:T0:L0 is being removed
    2022-12-13T10:57:57.100Z cpu4:1048728)WARNING: ScsiPath: 7187: Failed to issue command 0x0 (cmdSN 0x0) on path vmhba32:C0:T0:L0: No connection
    2022-12-13T10:57:57.100Z cpu4:1048728)WARNING: ScsiScan: 2044: Could not delete path vmhba32:C0:T0:L0
    2022-12-13T10:57:57.150Z cpu0:1048602)WARNING: HBX: 1891: 'USB-Storage': HB at offset 4063232 - HB IO failed due to Permanent Device Loss (PDL):
    2022-12-13T10:57:57.150Z cpu0:1048602)WARNING: [HB state abcdef02 offset 4063232 gen 237 stampUS 1035869328000 uuid 6388ef65-11c2f197-e22f-48210b34aceb jrnl drv 24.82 lockImpl 3 ip 192.168.1.98]
    2022-12-13T10:58:08.912Z cpu2:1048978)WARNING: ScsiPath: 9487: Adapter Invalid does not exist
    2022-12-13T10:58:08.923Z cpu2:1048957)WARNING: NMP: nmp_RegisterDevice:876: Registration of NMP device with primary uid 'mpx.vmhba33:C0:T0:L0' failed. Already exists
    2022-12-13T10:58:27.882Z cpu4:1048957)WARNING: NMP: nmp_RegisterDevice:876: Registration of NMP device with primary uid 'mpx.vmhba33:C0:T0:L0' failed. Already exists
    2022-12-13T10:58:27.882Z cpu7:1048957)WARNING: NMP: nmp_RegisterDevice:876: Registration of NMP device with primary uid 'mpx.vmhba33:C0:T0:L0' failed. Already exists
    2022-12-13T10:58:27.883Z cpu7:1048957)WARNING: NMP: nmp_RegisterDevice:876: Registration of NMP device with primary uid 'mpx.vmhba33:C0:T0:L0' failed. Already exist

    Is there a way maybe to disable a kind of timeout ?
    Or should i disable the APD with that command :
    esxcli system settings advanced set -o "/Misc/APDHandlingEnable" --int-value "0"

    Or should i disable the PDL :
    esxcli system settings advanced set -o "/Disk/AutoremoveOnPDL" -i 0

    Or something else ?

    Have that commands a sense ?

Leave a Reply to Matt Cancel reply

Your email address will not be published. Required fields are marked *