Use the blue Nav bar above to access the main index pages!

Using an NFS Data Store for ISO Images in your VMWare ESX Environment

How to Setup an NFS Data Store for VMWare ESX:  I've got four ESX servers in my lab, running various versions of VMWare (ESX 3.0, 3.5 and ESXi 4.1).  When I first got started, I found myself copying ISO images of various operating systems to each ESX server so that I could install the OS on the virtual machines.  Not only was it time consuming, but it used up valuable space on the ESX servers, that I'd rather use to host VMs.

Now, one thing you can do, if you have SAN storage, is to attach the same SAN LUN to all of your ESX servers, and put your ISO images there.  What a waste of expensive SAN storage though.  Instead, you can create an NFS server using a Windows or Linux server with cheap local storage.

I tested few different operating systems for the NFS server.   First I tried Fedora Linux version 12, then Windows 2003 with Services for UNIX (an add-on), then Windows 2008 R2 with Services for NFS (an in the box feature).  I'll explain the procedure for setting up 2008 as an NFS server.  But first, let's discuss the placement of your NFS server.

Network Connections
Hosting your ISO images on an NFS server means that you're going to be mounting ISO images, booting from them, and installing the OS, all over the network.  That means that it's important that you maximize the throughout, and minimize the impact on the NICs in your VMWare servers that carry the traffic between your users and the VMs.  So ideally, it would be a good idea to connect your NFS server to the same network switch as your ESX servers, hopefully at 1Gb/sec.

Figure 1 - Dedicated NICs for VMKernel Networking
The next thing to be clear about is that ESX needs to have a VMKernel port defined (the VMKernel runs the NFS client), and bound to one or more NICs, in order to connect to an NFS data store (or an iSCSI target).  Hopefully, your ESX servers have lots of NICs, and you've followed best practice, dedicating one or more NICs to VMKernel and Service Console ports, while other NICs service the VMs (see figure 1).

As you can see in the figure, I've got two NICs servicing the VMKernel and the Service Console, and two more NICs servicing the virtual machines.  This configuration will keep the NFS traffic off of your virtual machine NICs.

Installing Services for NFS on Windows Server 2008 R2
OK, we've got our 2008 R2 server on the same switch as the ESX hosts' VMKernel NICs, and now we can install Services for NFS:
  1. Launch Server Manager, click Roles, and click Add Roles
  2. Select the File Server role, and click Next. 
  3. On the Role Services screen, select Services for Network File System
  4. Click Next, then Install.
Setting up an NFS Share on 2008 R2
Next we can create a folder to hold our ISO images, and share it via NFS:
    Figure 2 - Adding an NFS Share
  1. Create the folder on the 2008 server
  2. Right-click the folder, and click properties. 
  3. On the NFS Sharing tab, click Manage NFS Sharing
  4. Check the Share This Folder box and give it a share name
  5. Click the Permissions button, and set the permissions.
I've allowed all machines read-only access to the share, with root access enabled (see figure 2).

Mounting the NFS Share as a Data Store in ESX
Figure 3 - Adding an NFS Data Store to ESX
Now launch the VMWare client and connect to your ESX server.  We can now mount the NFS share as a data store:
  1. In the VMWare client, click the configuration tab
  2. Under the Hardware section, click Storage
  3. Click the Add Storage link.
  4. Select NFS, and click Next
  5. Enter the IP Address of the 2008 server and the name of the NFS share
  6. Enter a name for your new data store, and click Next, and Finish
Repeat these steps on each of your ESX servers.  Your ESX servers should now be able to access files on the NFS share.  Once you've copied your ISO images to the share, they'll be accessible to the VM's that you want to build on your ESX servers.  The ISO's are now in a central location, and what's better (if you ask a Windows guy like me), they're on a Windows server so I don't have to brush up on FTP or SCP every time I need to copy an ISO.  Sorry UNIX geeks, no offense.
You can even host a VM on an NFS data store.  I've tried it, and performance isn't all that terrible for light loads, as long as you have a RAID set with enough spindles to provide adequate performance.  But if you copy any big files, performance kind of tanks.  And of course you need read-write access for that.

An NFS data store might also provide options for backups of your VMs.  You can copy VM files to the NFS server, when you can use Windows backup tools to back them up.  Not to say that this is a solution for enterprise backup, but it gives some examples of how flexible and handy NFS data stores can be.


Anonymous said...

thank you thank you thank you.

Post a Comment

Related Posts Plugin for WordPress, Blogger...