Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know that you can install ESXi 4.0 on a thumbdrive, but I was wondering if you could plug in an external harddrive to give extra storage to one of your VMs? We run a fileserver inside of ESXi that needs a space upgrade, but we're thinking of migrating to a different fileserver solution and would rather stick to external media to ease the later transition.

edit:

Ideally I'd like the drive to show up to the VM directly and not have ESXi control it, so that I could move it to a different machine and still have all of the data appear the same.

share|improve this question
up vote 1 down vote accepted

I've solved the similar problem recently, so I can give you some results of my investigation. Our task was to move some VMs between hosts, and there was no high-speed network link between hosts and no provision to make such link, so we decided to copy VMs to external hard disk as files. We bought USB hard drive and... and we were surpsised how awful ESXi is designed (and after this experience I'll personally will NEVER EVER use any VMWare product).

Most useful documentation is this page: https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1022290

USB support in VMWare host is, in short words, absent.

We're happened to have 5.5 (pre-patch3) and 5.1 hosts, so we haven't had any chance to have USB 3.0 support. We tried to assign USB Hard Disk as a datastore directly into the host.

This is not possible at all. VMWare requres local drive to be VMFS-formatted to be a datastore. There is console tool to partition the drive and other tool to make VMFS partition (both available when you connect to host via SSH). Yes, you can't have arbitrary partitioning. However, these tools don't seem to work with USB devices. The VMFS formatter fails with some cryptic error message.

(It looks like ESXi treats USB block devices differently, not same as say SATA block devices or hardware RAID VDs, which is strange, because USB in essense uses SCSI translation layer.)

ESXi also does not support ANY other file systems that are capable of large files (ntfs, ext2/3/4, hfs+, even exfat), so you can't just mount removable disk in the host, stop VMs and copy VM images.

We succeeded in this way: created small linux VM, forwarded USB device there, partitioned, formatted and mounted it there and exported via NFS. Just to be able to forward USB device to newly created VM, we were required to REBOOT THE HOST (it wasn't appeared in the available devices until reboot. Still want to continue with VMWare? Then read further). Then we added the NFS share from the VM into the host as datastore.

However, the performance of this solution is much, much worse you'll expect. The typical linear data transfer rate was in the order of 1 MB/s (one megabyte per second), and the I/O delays were in the order of 100 ms. I am sure this not any hardware fault, because the same server booted linux had the normal 20 Mb/s performance with same disk via USB 2.0 and much less delays.

So, this way will not work to just extend VM common storage space. This could have limited usefulness to do VM backups.

share|improve this answer

The answer is: yes

USB can be used by the Guest OS by editing the settings of a Virtual Machine and then choosing the Hardware Tab.

Once you are at the Hardware Tab you can click ADD and select an USB Controller.

Once you have added a USB Controller you then repeat the same process, except this time add a USB Device instead of a controller.

You will see any attached USB devices in a list to choose from.

Once added you then need to open the console of the Virtual Machine, and Mount it to the USB connector. (the little USB icon at the top of the Console Window).

Been a while since I last did this, however this should get you there.

As for using it as a Datastore for VMWare only, I'm currently looking into that now, in my case its more useful to have USB storage for snapshots etc.

And to the guy that said its better to get eSATA. It really depends on what you are using the USB disk for. If it is just backups or file storage... who cares? Unless you are running things from this disk, performance is not relevant.

share|improve this answer
    
Life saver :) This works without having to halt the guest or anything – tm1rbrt Jul 24 '12 at 13:08

Use ESXi 4.1.0 or later - it supports this feature.

share|improve this answer
1  
Do you have any documentation to cite? I need to simply backup some vm's and I want to get in-and-out quick. I was going to stop the vm's one by one, make a copy to my NFS datastore and then copy that to the external USB HDD (from the CentOS box where the exports reside.) However, I'd prefer to keep the NFS step out if possible. Thanks. – Bretticus Aug 17 '11 at 21:11
    
Nevermind, it's passthrough only. I did see an example of a guy who got it working as a datastore (FAT only) in 4.1 by disabling the USB arbitrator from startup. I will probably just try stopping the vm and copying the folder via SSH console. That depends on whether I can mount the external HDD. – Bretticus Aug 17 '11 at 21:55

ESXi does not support USB devices (either as a datastore, or as passthru to a guest OS). Even using the Alt+F1 unsupported trick, you cannot mount the USB device.

share|improve this answer

If it's connected to the ESXi box then ESXi is going to control it, and will need to set it up as a datastore first. If you want something removable I'd recommend going with an eSATA device versus a USB device... should be fewer headaches and better performance.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.