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:

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

  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.

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

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

  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!!

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.