VMware ESXi Using Cheap NAS

VMware ESXi Using Netgear ReadyNAS NFS Connections

I successfully used a $400 NAS from Netgear as shared network storage for ESXi server. The key is NFS shares and a simple command line utility. The solution scales up well in their line of products which continues to be very affordable even on large storage capacity units.

I love VMware and virtual servers. They make life so much easier in the data center saving space and making new servers a much quicker and cost effective turn around than having to buy new hardware for everything. But the longer I use the technology the more I come to realize the big benefit requires good shared storage. These virtual machine files are so large and the files are held open during normal use. Having a backup copy of these server files is essential your “hardware” backup. And if the host machine dies it is a long time to copy the virtual machine files over to another host, assuming you have the disk space for it in the first place.

However, most shared storage solutions are expensive. Looking at the recomended setups was eye popping for a cheap guy like me. There had to be another way. At the local VMware users conference in Pittsburgh I learned that many large shops in VMware were using NAS with standard NFS shares to store and run machines. These didn’t require necessarily a large Fibre channel or iSCSI SAN to work. And some of the names mentioned were large financial institutions. Thus I started looking around for cheap NAS with NFS support.

Netgear’s ReadyNAS

I’m now in love with ReadyNAS from Netgear. They make a whole line of products starting with mirrored 500 Gig storage on up to 12 drive arrays. And all are really priced to move. I had been thinking about replacing my old home server (NT 4.0 so I do mean OLD). I only had less than 90 gigs of data and maybe 150 gigs in drives. My other problem was my DAT drive on the backup system failed. So I needed a new location to be saving my backups from the workstations and server. Dell had a sale early June with $100 (instant savings not a rebate) for the low end ReadyNAS Pro so I got the 500 Gig model and a second drive from CDW for $60. They don’t sell the mirrored dual drive by default probably to keep the price down. I then got a cheap $50 USB 320 gig drive to attach for the backups.

So this rig supports NFS, CIFS, AFP, FTP & even HTTP access to the shares. There is a built in backup script utility that can run backups to the USB drive attached to the built in port. Rsync is also available to sync with another ReadyNAS at an alternate site. And the same USB connection (3 ports; 1 front 2 back) can be used to network share a printer to both Windows and Bonjour. There are a bunch of niceties for the home network as well, auto-copy to a directory if you insert a usb key. This can get those pictures public fast. An application for sharing photos that can be published to the web, but real web services are probably better for this. A bunch of streaming servers are included (iTunes & Bit torrent among them).

For this device you have to manage your own users and groups and it essentially is your server. This is a Linux distribution specifically setup for this hardware and the Open Source components are available for download. Obviously, messing with it voids the warranty. The higher end of the product line offers full Active Directory integration and support for iSCSI protocols with the built in OS initiators for Mac, Windows and Linux.

ESXi Connecting to NFS

But my real question was not will this replace my aging home server with backups, but can I make ESXi use this to store and run virtual machines. The answer is yes. The key is NFS shares and some command line mounting on the ESXi side of the equation. I created a share without security that only advertised NFS. However, the create Data Store wizard in VMware Infrastructure Client would not attach and gave the error “Mount request was denied by the NFS Server.” I was disappointed to say the least but did not give up. Anything you run in Infrastructure Client is really executing commands under the hood so with a little help from my friend Google the command in question is esxcfg-nas.

  • Enter the command prompt on the server or SSH session for the server.
  • esxcfg-nas -a -o -s /VolumeName DataStoreName
  • Where: is your NAS IP address
    VolumeName is the NFS volume name on the NAS
    DataStoreName is the ESXi name created by the command that will show up in your datastore list

The IP address of the NAS must be in the same subnet or VLAN as an active IP address for your ESX kernel port. This will not work across VLAN or subnets even if they are on the same switch fabric. They simply must be in the same network. I did not test running the same VLAN across a network, but I’ve read that this will work for remote connections but may require that multicast is supported across the VLAN.

This can be on a different network card and port than what you normaly connect to your ESXi server. My test server has two NICs one on the main production LAN where I have both a kernal port and the main VM network port. I connected the second NIC to another LAN and put a second kernal port and the NAS there. This connects fine to the NAS and runs the machines out of the other NIC. This is important here because I left the NFS share wide open so I don’t have to deal with security. But since the LAN is completely separated from all the others it is secured off the back end of the network without any direct routes there. But the data store itself is still visible to your SCP transfer utility to copy files on and off the NAS.

Help for esxcfg-nas

This is just a snap of the options you get from the help request at the console.

esxcfg-nas <options> [<label>]
-a|–add Add a new NAS filesystem to /vmfs volumes.
Requires –host and –share options.
Use –readonly option only for readonly access.
-o|–host <host> Set the host name or ip address for a NAS mount.
-s|–share <share> Set the name of the NAS share on the remote system.
-y|–readonly Add the new NAS filesystem with readonly access.
-d|–delete Unmount and delete a filesystem.
-l|–list List the currently mounted NAS file systems.
-r|–restore Restore all NAS mounts from the configuration file.
-h|–help Show this message.

Originally Posted June 24, 2009
Last Revised on November 20, 2010