VMware Cloud Community
john_qvortrup
Contributor
Contributor

Connect an usb disk to an esxi and present the disk as datastore

I would like to connect an usb harddisk to an esxi host. It is possible to present the usb disk to a guest with the usb device. But I would like to present the usb disk to the host and use it as a datastore.

Are there any of you out there who has been trying that ? 

18 Replies
BharatR
Hot Shot
Hot Shot

Hi,

You could mount the USB drive in the Console Operating System

Best regards, BharatR--VCP4-Certification #: 79230, If you find this information useful, please award points for "correct" or "helpful".
john_qvortrup
Contributor
Contributor

Thankyou for your answer .Do you mean mount the disk the unix way in the console ?  Can you direct me to the commands to obtain that ?

0 Kudos
BharatR
Hot Shot
Hot Shot

Hi,

For the Virtual Machine it can be Mount from the console

and for the ESX Host u need to mount from the command Line, Check this article describe for the Linux for How to mount the USB Disk

http://ldots.org/prodrive/#mounting

Best regards, BharatR--VCP4-Certification #: 79230, If you find this information useful, please award points for "correct" or "helpful".
0 Kudos
Virtualinfra
Commander
Commander

Welcome to this community.

USB Disk driver as datastore with VMFS partition cant be mounted to ESXi its still not supported.

But USB Disk can be mounted to virtual machine with path redirection.

Still USB DISK can be used as a boot disk to install ESXi on to it. but cant be used as datastore to create VM on it.

Thanks & Regards Dharshan S VCP 4.0,VTSP 5.0, VCP 5.0
john_qvortrup
Contributor
Contributor

I was unable to mount it although I followed the KB below.

http://kb.vmware.com/selfservice/microsites/search.do?cmd=displayKC&docType=kc&externalId=1036340&sl...

I've been trying different approaches and none of them seem to do the trick.

So I'm inclined to draw the same conclusion as you . That it isn't supported.

http://kb.vmware.com/selfservice/microsites/search.do?cmd=displayKC&docType=ex&bbid=TSEBB_1297203662...

I'm seeking a solution to make it fast copying guests off the host, and I can't find any other way than to copy over the network, and that is too slow even with a 1Gbit connection, for standalone esxi hosts.

0 Kudos
jose_maria_gonz
Virtuoso
Virtuoso

Hi team,

Am I right in saying that ESXi 5 still does not support USB v3 on a direct connection to the host?

I hope I have helped you out

My Company: http://www.jmgvirtualconsulting.com

My Blog: http://www.josemariagonzalez.es

My Web TV show: http://www.virtualizacion.tv

My linkedin: http://es.linkedin.com/in/jmgvirtualconsulting

My Twitter: http://twitter.com/jose_m_gonzalez

0 Kudos
garyhocking
Contributor
Contributor

Unfortunately a USB connection directly attached to the host is still not supported in vSphere 5, so you are correct in my understanding from VMware.

USB 3.0 and lower is supported from the client device to the VM, so you can attach it as a drive to copy data to and from the VM, but directly connecting it to the host still isn't supported. From my testing so far that is the case, if different by all means let me know.

It is a shame as there are so many different benefits to being able to attach directly to the host. Removable datastore, backups etc.

One thing that USB can be used for is installing ESXi onto a supported USB flash drive instead of the local disks, which is great because you can have a diskless host and you can use an iSCSI or FC SAN instead or it allows you full use of the disks in the host for something like HP's VSA or VMware's new VSA.

0 Kudos
fyc3010
Contributor
Contributor

hopefullly a fix will come out for this very soon.Smiley Sad

0 Kudos
chrisguk
Contributor
Contributor

Vmware is a great system and very powerful for any business needs.  What you are attempting to do is not impossible but you need to do a few things first. 

If I have understood your question correctly then all you want to do is use the USB disk drive as a datastore?

I will assume that is correct. So I will go on:

First of all try not to think of your disk as a physical disk just yet.  It can all be achieved with the use of FreeNAS.  You will first need to boot up FreeNAS box as a VM then make sure you format your USB as FAT32.  Once you have done that I urge you to follow this guide here:

http://mikebeach.org/2013/02/27/mounting-a-usb-fat32-formatted-disk-in-freenas-8/

Once you have followed that guide, in all intense and purposes you have an external storage device.  Now in order to get it to operate as a datastore you will have to create an NFS share on the newly attached volume in the FreeNAS box.  Once you have done that attached it to your VM Host as network attached storage.  In order to preserve your setup I recommend setting up regular backups of your FreeNAS configuration and of course your VMware config. 

So if everything goes down or offline, you still have a FreeNAS volume intact on the external USB drive.

Hope that helps.

And just for the record.  Its not a fix that is needed for VMWare to support attaching USB drives to the host, its a feature.  If VMware decide that it is a popular feature then I guess they may include it in future releases.  But don't hold out because the purpose of VMware is to provide businesses a way to harness virtualisation without the need to spend money on lots of bare metal boxes.  And from a business stand point it's not a feasible feature to have USB drives lying around with maybe business critical data on it.

jeremykoerber
Contributor
Contributor

Good answer, but I think you mean "for all intents and purposes." What exactly would "all intense and purposes" mean?

DMG
Contributor
Contributor

While the FreeNAS solution is workable, I think you missed the point of the OP that he didn't want to have to transfer data across the network, but rather via USB on the host.

0 Kudos
perezil
Contributor
Contributor

The only reason VMware did not allow the use of USB as a datastore was simple: Reliability.

USB 1.1 an 2.0 can not handle the sheer volume of I/O required by VMware and the VMs. It is also the reason you should not use a cheap drives, green drives, or cheap NAS device or network equipment. If it can not handle the I/O, may hang, crash, and/or go offline. Taking a datastore offline while it is in the middle of being accessed is a VERY bad thing.

Now that USB 3.0 and 3.1 are out, you can be sure that VMware is looking at this new transports as a possible option.

Why would they not support USB 3.0+ technology? What would stop them from allowing now that it is so fast?

1. If I/O performance is not stable or equal to other direct.

2. If they can not find a way to keep older USB devices (1.1 and 2.0) from being used.

3. If the storage can not be expanded without adversely impacting I/O or performance. (Keep in mind that in most directly attached storage solutions, adding disks actually increases performance)

4. Certainty that users will not abuse the policies for using USB, and try to get support for unsupported USB solutions.

If it did happen, what we might see would be a list of approved vendors or specifications.

Remember, just because you can, doesn't mean you should.

Luis

dxun
Contributor
Contributor

Hi all,

with all this said - would this scenario be possible:

1) successfully install ESXi host on a usb 3.0 stick, let's say 32 GB

2) shrink the VMFS partition so that excess unused space on the stick is usable

3) in that unused space, create a new partition and present it to guest operating system (for example, as explained in this KB)

My plan is to use this excess space on USB stick as a squid cache_dir in a home VM lab environment, so I would like to expose that partition to the guest operating system essentially as scratch disk - reliability is not an issue as the data is transient, and the stick is blazingly fast (especially compared to ordinary HDD).

Do you think this idea of mine has any chance of succeeding on an ESXi 5.5 U2 installation? With what everyone here has said, I'd say - yes, but I am just venturing into VM space, so.....

0 Kudos
JohnHarrell
Contributor
Contributor

I know this is an old post but I came across it in my search for the same thing. It is definitely possible in ESXi 6.0.0. There is a great write up at http://www.virten.net/2015/10/usb-devices-as-vmfs-datastore-in-vsphere-esxi-6-0/‌ . I just finished performing it and confirm it works.

k2ibegin
Contributor
Contributor

I tried following the article, i was able to mount the usb drive but can not see it in the data stores.

I did exactly similar steps, and my usb drive can be seen in the devices section on vsphere client (as mounted ). However, I can not see it under the datastores section.

it only shows the other usb drive in datastores section, which has the esxi host installed on it !

When i try to add a new datastore it shows up the option of local hard disk, which i do not want to touch. I want to run my VM on this external usb drive that can not be seen as datastore on vsphere client.

Can you suggest something here ? I did not get any errors while mounting the usb drive on esxi host as per steps mentioned above

first.pngsecond.pngthird.png

0 Kudos
Sam062016
Contributor
Contributor

Hi k2ibegin,

did you solve this issue? I have the same problem.

0 Kudos
garishshunker22
Contributor
Contributor

Hello guys.

A simple workaround.

If you have a linux VM, Just add a usb controller and then add the usb device under vm settings.

Then mount it as NFS. You will get a link for the NFS Storage. Example 192.168.0.22/nfsxxx

Use that to create an NFS datastore on the vcenter.

0 Kudos
Jitu211003
Hot Shot
Hot Shot

It is possible, you need to use usb legacy mode in BIOS controller which will load the legacy usb driver during boot.

and then, you need to storage claimrule set on ESXi level.

Thanks

0 Kudos