7

I want to mount an USB drive to VMWare ESXi 5.5 host.

The USB drive is visible with lsusb : Bus 01 Device 03: ID 154b:0095 PNY

But not under /vmfs.

Under /dev/disks/ I see many entries, but dunno if one of those is my USB disk:

mpx.vmhba32:C0:T0:L0   vml.0000000000766d68626133323a303a30
mpx.vmhba33:C0:T0:L0   vml.0000000000766d68626133333a303a30
mpx.vmhba33:C0:T0:L0:1 vml.0000000000766d68626133333a303a30:1
mpx.vmhba34:C0:T0:L0   vml.0000000000766d68626133343a303a30
mpx.vmhba34:C0:T0:L0:1 vml.0000000000766d68626133343a303a30:1
mpx.vmhba34:C0:T0:L0:5 vml.0000000000766d68626133343a303a30:5
mpx.vmhba34:C0:T0:L0:6 vml.0000000000766d68626133343a303a30:6
mpx.vmhba34:C0:T0:L0:7 vml.0000000000766d68626133343a303a30:7
mpx.vmhba34:C0:T0:L0:8 vml.0000000000766d68626133343a303a30:8

dmesg says:

2015-05-27T16:18:36.169Z cpu3:33302)<6>usb 1-6: New USB device found, idVendor=154b, idProduct=0095
2015-05-27T16:18:36.169Z cpu3:33302)<6>usb 1-6: New USB device strings: Mfr=1, Product=2, SerialNumber=3
2015-05-27T16:18:36.169Z cpu3:33302)<6>usb 1-6: Product: USB 3.0 FD
2015-05-27T16:18:36.169Z cpu3:33302)<6>usb 1-6: Manufacturer: PNY Technologies
2015-05-27T16:18:36.169Z cpu3:33302)<6>usb 1-6: SerialNumber: 1955999360
2015-05-27T16:18:36.169Z cpu3:33302)<6>usb 1-6: usbfs: registered usb0103
2015-05-27T16:18:36.254Z cpu3:33302)<6>usb 1-3.1: new high speed USB device number 4 using ehci_hcd

I tried dozens of commands, including:

  • chkconfig usbarbitrator off
  • esxcli storage core device list
  • esxcfg-rescan
  • esxcli storage vmfs extent list

And I have read approximately 200 web pages and KBs, but I was not able to find the way to identify the right disk to be able to format it.

Somewhere in dmesg I saw this:

2015-05-27T16:18:36.739Z cpu3:33321)DMA: 612: DMA Engine 'vmhba32' created using mapper 'DMANull'.
2015-05-27T16:18:36.740Z cpu3:33321)<6>usb-storage 1-6:1.0: interface is claimed by usb-storage

Does it means that my USB drive is vmhba32?

If yes can I mount it somehow, or should I format it?

ewwhite
  • 194,921
  • 91
  • 434
  • 799
db_ch
  • 638
  • 5
  • 14
  • 20
  • 1
    Why are you trying to do this? – ewwhite May 27 '15 at 21:10
  • 1
    AFAIK USB simply aren't supported. Or at least they weren't in older releases. As ewwhite said, what is your root problem/question? – Zoredache May 27 '15 at 21:13
  • @ewwhite I think it could be useful in many repair / data recovery situations, despite the right way would be to use the usb disk through a vm. – peterh May 27 '15 at 22:02
  • @Zoredache I confronted this problem around 2 days ago. I needed it for a repair of an esxi host after a failed upgrade (I wanted to copy a vib of a NIC card whose driver was deactivated by the upgrade). – peterh May 27 '15 at 22:04
  • Crack open the disk case and attach the disk using SATA innit. You can also get a drive bay in the front that will let you whack normal sata drives in and out to your hearts content if you want removable disk media. – BlueCompute May 28 '15 at 11:51
  • 1
    Dear all, the problem I want to solve is to copy the Datastore to an USB drive because I have to replace the disks. Then I would like to copy the datastore again on the new disks. And my problem is that the servers are more than 15'000km away from me, and I have no network share available. – db_ch Jun 01 '15 at 10:24
  • 1
    Have you tried `/etc/init.d/usbarbitrator stop` - source http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1036340? – Nam G VU Aug 17 '15 at 08:32
  • @Zoredache You know wrong. [Cannot mount a USB key or disk device media to an ESXi/ESX host](https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1036340) – ᄂ ᄀ Jul 01 '16 at 13:05

3 Answers3

4

I was able to make this happen by formatting the USB drive appropriately. as a FAT16 partition at 2GB or less (my example is 500MB)

In Windows, open a commmand prompt as admin and type diskpart:

C:\Windows\system32>diskpart

Microsoft DiskPart version 6.1.7601
Copyright (C) 1999-2008 Microsoft Corporation.
On computer: MIS-001

DISKPART> list disk

  Disk ###  Status         Size     Free     Dyn  Gpt
  --------  -------------  -------  -------  ---  ---
  Disk 0    Online          465 GB      0 B
  Disk 1    Online           29 GB      0 B

DISKPART> select disk 1

Disk 1 is now the selected disk.

DISKPART> list part

  Partition ###  Type              Size     Offset
  -------------  ----------------  -------  -------
  Partition 1    Primary             29 GB  1024 KB

DISKPART> clean

DiskPart succeeded in cleaning the disk.

DISKPART> active

There is no partition selected.
Please select a partition and try again.

DISKPART> list disk

  Disk ###  Status         Size     Free     Dyn  Gpt
  --------  -------------  -------  -------  ---  ---
  Disk 0    Online          465 GB      0 B
* Disk 1    Online           29 GB    29 GB

DISKPART> create part primary size=500

DiskPart succeeded in creating the specified partition.

DISKPART> active

DiskPart marked the current partition as active.

DISKPART> format fs=fat quick

  100 percent completed

DiskPart successfully formatted the volume.

DISKPART> assign

DiskPart successfully assigned the drive letter or mount point.

DISKPART> exit

Also: /u/ewwhite Someone asked the question:

"Why are you trying to do this?"

In my case, I had to reinstall Network Drivers after failed hardware. I had no guest access, no host access, and no storage access after a hard failure of the host. Reinstalling NIC drivers via USB or CD was only way to update these blades.

1

While this seems like it could be useful... (and it really could be a handy thing)

The VMware gods have not allowed it to happen, so you really don't have any option to use removable media or USB-attached devices for ESXi, beyond the support use case of boot and USB passthrough to a virtual machine.

Sorry.

ewwhite
  • 194,921
  • 91
  • 434
  • 799
  • Based on your answer, the only solution I see is : 1. Create a simple Linux virtual machine. 2. Copy all other machines from Datastore on the USB stick with passthrough and SCP. 3. Remove the disks with Datastore. 4. Add new disks and format them + create Datastore. 5. Configure again a Linux simple machine. 6. Copy the data from USB to the new Datastore with USB passthrough and SCP. What do you think ? – db_ch Jun 01 '15 at 10:28
  • Offically guided by vmware.com and still as @db_ch has tried, it just didn't work. Strange. http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1036340 – Nam G VU Aug 17 '15 at 08:32
  • This is simply not true. The ability to connect USB storage was available since 4.1. The key is to have it formatted as FAT16. [Cannot mount a USB key or disk device media to an ESXi/ESX host](https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1036340) – ᄂ ᄀ Jul 01 '16 at 13:02
1

Why are you trying to do this?

I have a whole bunch of operating system ISOs on an external drive that I'd like to use on my home ESXi 6 lab, but I can't mount them directly.

Here's what I did:

  • Install Debian in a virtual machine
  • Pass the drive you'd like to access to the Debian VM
  • Mount the USB drive(s) in the VM, (for example, to /mnt/img0)
  • Install nfs-kernel-server into the Debian machine
  • Configure Debian's /etc/exports to point to /mnt/img0. For example, you could add the line:

    /mnt/img0 1.2.3.4(rw,sync,no_subtree_check,all_squash)

    • Replace 1.2.3.4 with the IP address of your ESXi host
  • In your virtual machine settings, add a new NFS datastore. Point it to the IP address if your Debian VM, leaving username and password blank if you used the sample /etc/exports above.

Now, you should be able to access the files on the USB drive as a datastore. It will also be mounted under /vmfs if you log into the ESXi host via ssh.

Admittedly, this is a lot of work to use a USB drive, but this worked in a pinch.

transistor1
  • 166
  • 8