Friday, August 24, 2007

ESX 3.0 host as NAS server

A client asked me to configure one of their ESX hosts as an NFS server for hosting ISO files. This host had 300GB of remaining disk space which would otherwise be just a waste. So, I started right away: creating an export directory, formatting the file system (converting vmfs to ext3), tested mounting it from different ESX host... no problem!

Until I tried to import the new volume as a datastore via the VI Client, then the VI Client complains about the fact that the NFS server does not support NFS v3 over TCP. Although NFS over TCP has been around for ages, it appears to have been stripped from the NFSD module in the service console. Is this done on purpose by VMware to make sure you can not easily run a standalone ESX host with shared storage out-of-the-box?

Anyhow, by recompiling the NFSD module (luckily VMware has added the source for the kernel) one can make it work. See this document (in dutch) for a procedure on how to make this work. Works like a charm!


Kevin said...

Hi Toni,

I find you article very useful. I was able to get ESX as NAS to itself. However, I have one quick question to the nfs that is shared from the esx. I am able to create the nfs datastore in VIC but when I was trying to mount the nfs share from a Ubuntu box, I get the time out error. "mount.nfs: mount to NFS server '' failed: timed out, retrying". Do you experience this problem?

Toni Verbeiren said...

Hi Kevin,

I did not get the timeout issue you described. It may have something to do with the connection with the service console (firewall, routing, ...).

Apart from that, in a recent design study a client asked me a similar question as the one in the post. This time, I proposed a different approach: running an NFS/iSCSI virtual appliance that uses local storage on the ESX with a lot of local disk space.

The main benefits of this approach are: it is a supported configuration and it avoids some 'tweaks' to the service console OS.

Open-source options for such an appliance are for instance OpenFiler and FreeNAS.

Kevin said...

Thank you very much for your reply. The mounting Linux box is in the same
subnet. I am using ESX 35. Anyway, for the virtual appliance suggestion, do
you present the hard drive to the v-appliance as raw device or you created a
large vmdk? Will there be a performance catch if it is a vmdk?

Toni Verbeiren said...

I recommend creating a big vmfs volume on local storage, with a big vmdk file for the disk. The performance overhead is small (see VMware whitepapers on this topic) and it gives some additional flexibility.

LatinSuD said...

But Service Console is based on RedHat 3, which is older than "ages".

Anonymous said...

Hey Years ago VMWare released there ESXi 5.

Is there a solution to acitvate/install an NFS Server inside the ESXi 5?

My idea is to get an all-in-on USB Stick with ESXi 5 and VMs without any local or network space!

But i´m a linux noob so i can´t realize my idea.

But maybe you can?

Custom Search