Wednesday 2 January 2013

Set Up Windows 2003 R2 NFS Server for VMware ESXi Backups

Generally my preference is to use Linux as an NFS server.  On the internet you will see frequent reference to the belief that NFS works better on Linux/UNIX.  Recently I decided to try and set up NFS services on Windows to see how well it would perform.  In this tutorial I will set up Services for UNIX 3.5 on a Windows 2003 R2 server and configure it using the User Name Mapping service to allow a VMware ESXi to use it as a datastore for VMs or backups via non-anonymous connections.
First off grab the Windows Services for UNIX (SFU) installation files here.  Extract the files from the download file and run the setup.
Click Next.
Select Custom Installation and click Next.
Under NFS select Client for NFS and Server for NFS for installation.  Although in the image I have not unselected them you can unselect all the other UNIX utilities.
Scroll down and under Authentication tools for NFS select User Name Mapping to be installed.  Again this and Client/Server NFS should be the only three options that need to be installed.  Click Next.
Click Next.
Select Local Mapping Server, and select Password and group files.  Click Next.
Now go to Windows Explorer and create a directory to store the password and group lists from the VMware ESXi host.
In this example I will create a directory C:\SFU for the password/group files.  Unfortunately SFU will install the program files into this directory and will delete the password/group files, so after the install is completed you’ll need to recopy the files here.  They do need to be placed here initially so the installer will find them.  Or obviously you could use a different directory for the password/group files.








Enter the path for the password and group list files, click Next.


Click Next.  Allow the install to complete.
Create User Name Mapping

Go to Start > Administrative Tools > Services for UNIX Administration.

In the left pane go to User Name Mapping, then in the middle top click Maps.

Uncheck Simple maps.  Then under Advanced maps click Show User Maps.

Now click the List Windows Users and List UNIX Users buttons.

Select a Windows user and UNIX user to map each other to, I just mapped the UNIX/ESXi root user to Administrator.  Now click the Add button.

Click OK.

Click OK.

You will now see the new user mapping below.  Optionally you could create a group mapping as well, but I found that it isn’t necessary.
In the upper right click the Apply button.  Then close the window.



Now go out to a directory that you’d like to make available via NFS, right click it and select Properties.
Click the NFS Sharing tab in the dialog, then select Share this folder.  Now click the Permissions button.
Change the Type of access to Read-Write, and check Allow root access.  This is not the most secure setup, so you may want to limit what is available in this directory.  Click OK.
Click OK.
Now go into the Services MMC, we now need to restart the User Name Mapping service.
NFS requires a variety of network ports to be made available, so for now I will disable the Windows firewall.  Obviously this is not recommended for production environments.
Click Properties.
Click Advanced.
Click Settings.
Select Off, then click OK.
Connect VMware ESXi to NFS Datastore
Go into the vSphere Client.  Select the ESXi host, then in the main pane click Configuration, then under Hardware select Storage.
In the Datastore section click Add Storage.
Choose Network File System and click Next.
Enter the NFS server hostname/IP address, the name of the nfs folder share name with a preceding /, and a datastore name and click Next.
If all goes well the NFS share from Windows will now show up under datastores!  You now have a place for your virtual machine backups.  I have actually found that read/write performance from Linux and ESXi clients connecting to the Windows NFS server if very good.  Good luck!

No comments:

Post a Comment

Next previous home