Home > Storage, Virtualization, VMware > Configure NFS shares in Openfiler for your vSphere homelab

Configure NFS shares in Openfiler for your vSphere homelab

Even if you have access to the enterprise-class storage appliances, like the HP P4000 VSA or the EMC Celerra VSA, an Openfiler storage appliance can be a great asset to your homelab. Specially if you, like myself, run an “all virtual” homelab within VMware Workstation, since Openfiler is by far less resource hunger than its enterprise counterparts.

Simon Seagrave (@Kiwi_Si) from TechHead.co.uk wrote an excellent article explaining how to add iSCSI LUNs from an Openfiler instance to your ESX/ESXi servers, if iSCSI is your “thing” you should check it.

In this article I’ll explain how-to configure a NFS share in Openfiler and then add it as a datastore to your vSphere servers. I’ll take for granted that you already have an Openfiler server up and running.

1 – Enable NFS service

As always point your browser to https://<openfiler_address&gt;:446, login and from the main screen go to the Services tab and enable the NFSv3 service as shown below.

2 – Setup network access

From the System tab add the network of the ESX servers as authorized. I added the whole network segment but you can also create network access rules per host in order to setup a more secure and granular access policy.

3 – Create the volumes

The next step is to create the volumes we are going to use as the base for the NFS shares. If like me you’re a Unix/Linux Geek it is for sure that you understand perfectly the PV -> VG -> LV concepts if not I strongly recommend you to check the TechHead article mentioned above where Simon explained it very well or if you want to go a little deeper with volumes in Unix/Linux my article about volume and filesystem basics in Linux and HP-UX.

First we need to create the physical volumes; go to the Volumes tab, enter the Block Devices section and edit the disk to be used for the volumes.

Create a partition and set the type to Physical Volume.

Once the Physical Volume is created go to the Volume Groups section and create a new VG and use for it the new PV.

Finally click on Add Volume. In this section you will have to choose the new VG that will contain the new volume, the size, name descrption and more important the Filesystem/Volume Type. There are three type:

  • iSCSI
  • XFS
  • Ext3

The first is obviously intended for iSCSI volume and the other two for NFS, the criteria to follow here is the scalibility since esxt3 supports up to 8TB and XFS up to 10TB.

Click Create and the new volume will be created.

4 – Create the NFS share

Go to the Shares tab, there you will find the new volume as an available share.

Just to clarify concepts, this volume IS NOT the real NFS share. We are going to create a folder into the volume and share that folder through NFS to our ESX/ESXi servers.

Click into the volume name and in the pop-up enter the name of the folder and click Create folder.

Select the folder and in the pop-up click the Make Share button.

Finally we are going to configure the newly created share; select the share to enter its configuration area.

Edit the share data to your suit and select the Access Control Mode. Two modes are available:

  • Public guest access – There is no user based authentication.
  • Controlled access – The authentication is defined in the Accounts section.

Since this is only for my homelab I choose Public access.

Next select the share type, for our purposes case I obviously choose NFS and set the permissions as Read-Write.

You can also edit the NFS options and configure to suit your personal preferences and/or specifications.

Just a final tip for the non-Unix people, if you want to check the NFS share open a SSH session with the openfiler server and as root issue the command showmount -e. The output should look like this.

The Openfiler configuration is done, now we are going to create a new datastore in our ESX servers.

5 – Add the datastore to the ESX servers

Now that the share is created and configured it is time to add it to our ESX servers.

As usually from the vSphere Client go to Configuration -> Storage -> Add storage.

In the pop-up window choose Network File System.

Enter in the Server, Folder and Datastore Name label.

Finally check the data and click finish. If everything goes well after a few seconds the new datastore should appear.

And with this we are finished. If you see any mistake or have anything to add please comment :-)

Juanma.

About these ads
  1. January 24, 2011 at 13:02 | #1

    Excellent. I have been trying to get this working for days and I followed this article and had it working in minutes.

    Nice one. Thanks

  2. Adam
    March 3, 2011 at 03:38 | #2

    Just wanted to say that this was a life saver – got me through perfectly!

    Thanks a ton!

  3. April 21, 2011 at 10:07 | #3

    Any idea if it’s possible to use showmount from an ESX service console? I’ve tried a showmount -e but it times out, even with the firewall disabled. I’ve already enabled the portmapper service. I know the service console is separate to the vmKernel but this is my standard diagnostic process (we’re increasingly a Linux shop) – if I can get it working on ESX then the rest of my team don’t need special troublehshooting instructions.

    I know I could use esxcfg-nas -l.

    thanks,

    Ed.

    • April 21, 2011 at 13:41 | #4

      Hi Ed thanks for the comment. Regarding your question, yes it’s possible to use showmount from the ESX COS, since it’s based on Linux and showmount is a Unix standard command.

      However the timeout issue you described is perfectly normal in a ESX server if you use “showmount -e” without any more arguments because by default showmount will try to query localhost and the ESX should not be exporting anything. To get NFS exported shares from the Openfiler server you should use “showmount -e OPENFILER_IP_ADDRESS”.

      But this command will show every NFS shares exported in the Openfiler server that the ESX server is authorized to access not which of them are configured as datastores.

  4. Hussain
    May 8, 2011 at 06:28 | #5

    Hi,

    What about NFS performance? can you give me some hints to achieve higher read/write in my VMs. I have both physical OF and Virtual OF

    • May 10, 2011 at 21:27 | #6

      Hi Hussain, thanks for the comment. I currently run OF as a VM and to be sincere I don’t run high loads on it, just to provide a bunch of iSCSI LUNS and NFS shares for my labs. However best thing to improve I/O is going to a faster disk, SSD if possible.

      Regarding NFS with vSphere, VMware NFS Best Practiced whitepaper is worth a read (http://www.vmware.com/files/pdf/VMware_NFS_BestPractices_WP_EN.pdf), hope this helps.

      • Hussain
        May 11, 2011 at 07:39 | #7

        Hello Juan,, Thank you very much for this link. I’m testing the OF NAS on VM on old PE2850, PE 2650, DL380 G3 and DL380 G6.

        I will go through the paper provided and I will try to hit a decent speed.

        Any tips or tricks will be highly appreciated.

        Thanks once again.
        S.Hussain

  5. Hussain
    May 16, 2011 at 14:00 | #8

    Hi once again,

    All the past days, I was testing the OF NFS on a VM. Here’s the screen shot of disk performance on one of the VM that is hosted on the vNFS Datastore on the Same ESX Host.

    Is it decent?
    http://imageshack.us/photo/my-images/857/nfsattoperformancejpep.png/

  6. November 21, 2011 at 21:53 | #9

    Great post! Unfortunately I just put together exactly the same thing from a number of Openfiler forum posts and a lot of trial and error before I came across it. Just typical!

    I’ve now bookmarked it for futur reference – thanks!

    • November 22, 2011 at 08:31 | #10

      Thanks for the comment Nigel! I’m glad you liked, yes that’s very typical and we all do it, but it’s also a nice way to learn :-)

      BTW I also like dance/electronic music ;-)

  7. January 5, 2012 at 19:59 | #11

    Awesome Post! Bang On, followed these instructions and they worked great, even with version 2.99…Thanks for this!

  8. Raymond YE
    January 24, 2012 at 02:12 | #12

    Version 2.99 NAS works perfect in ESXi5. Have you try iscsi in ESXi5? The software iSCSI adpater can not find the volume after scan.

    Thanks!

    Ray.

  9. Rob
    February 28, 2012 at 20:19 | #13

    Thanks for a great how-to. Your effort is much appreciated!

  10. NRJ
    April 15, 2012 at 13:55 | #14

    Hello and thank you to the author of this article – Juan Manuel! I have been trying to get my lab working for days, hence I couldn’t use the DRS, FT, and Storage vMotion in my VMware lab just due to the lack of an NFS datastore and heartbeat datastore. Thanks a lot for your help mate!

  11. Lawrence
    April 19, 2012 at 22:39 | #15

    Thank you so much for your great work that saves me a lot of time.

  12. August 6, 2012 at 14:12 | #16

    Hi Friends,

    To help you all I created a video to add storage to ESXi server and link of the same is given below. http://www.youtube.com/watch?v=Ggm6m-lGsas to see more videos you can visit http://www.prohut.net/blogging/videos/.

  13. abbrakile
    August 21, 2012 at 09:57 | #17

    Soon autumn, hurry to say goodbye to summer!).

  14. Dev
    December 9, 2012 at 20:14 | #18

    wow..excellent artcile….thanks a lot guys..

  15. Hatim
    February 10, 2013 at 11:44 | #19

    great man , this is really helpful :)

  16. Toby
    March 26, 2013 at 23:44 | #20

    Great walk through guide. This helped me get some shared storage configured in my VMware lab. Many thanks!

  1. December 8, 2011 at 14:38 | #1
  2. December 2, 2012 at 01:04 | #2

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 157 other followers

%d bloggers like this: