In my neverending quest to run a decent ESX lab at home I’ve been messing around with some storage options on the cheap. Currently I use my iMac to serve up NFS storage to my ESX and ESXi hosts at home. This works fine but I wanted something a little, well…better!
FreeNAS has been around for a while as well as OpenFiler. I downloaded and played around with both, and just found FreeNAS to be a little simpler to use. The nice thing about both packages is 1. They’re FREE! and 2. They can run on standard PC hardware rather efficiently. I had an AMD64 3200 mobo laying around and threw in 1GB worth of memory sticks I had into a beat up old case. The neat thing about FreeNAS is that if you can boot from an USB stick there is an embedded version that will consume a quaint 32MB of space and conserves your SATA ports for data disks.
I started off with a 160GB drive and had some storage up in under 30 minutes. But that wasn’t quite “geeky” enough for me so I picked up 2 x 750GB drives off NewEgg for $120. Setting up the RAID1 mirroring was a little tricky though.
I’m not going to get into specifics on how to install FreeNAS, there are hundreds of other websites out there to explain that. But here is how to get thru the RAID1 setup.
First when you log into the WebGUI (default login is admin/freenas) Go under Disks then Management. Even though FreeNAS can see your disks you have to manually add them.
Click on the little plus sign (+) and add your disk….for each disk you add, change the “Preformatted File System” to SoftwareRAID
Repeat this for each physical disk you have in your machine. Be sure to click the button (not shown) that says “Apply Changes” You should have something that looks like this….
The next step is to go to Disks, Software RAID. This is where we configure our RAID setup. This is where I got a little thrown off. Click on the little plus sign (+) to create your RAID. In my case, I have 2 drives so I’ll go with RAID1 so click on the RAID1 tab.
Give your RAID array a name then ctrl-click both drives. IMPORTANT – be sure to click the option to Create and initialize RAID, otherwise you go nuts trying to figure out the next step!
Now go to Disk, Format. This threw me off because I thought my drives were already formatted, however now you need to format the RAID array, not the disks that “make up” the array. FreeNAS is built on FreeBSD and UFS is the default file system so use that. Don’t worry, NTFS and Apple-Journaled work just fine with UFS and will do some VMFS later. Simply pick your newly created RAID under the Disk drop down and give the volume a name. You should see a ton of text generated while the disk is formatted.
(LOL…in this example, the Volume Name I used was invalid…can’t have an underscore in there!)
Finally the last step is to create a mount point so you can actually start using the storage. Click on Disk, Mount Point.
Type should be Disk, the Disk should be your RAID array you created (properly formatted hopefully!) You need to specify a Mount Point, you need to remember this for when you enable some services, like CIFS. Again, be sure you click “Apply Changes” after you click Save.
So cool! Now we have some storage to use. Lets test it by creating a CIFS share. Click on Services, CIFS/SMB. There is a bunch of configuration on the opening page, but the most important thing is clicking the little Enable checkbox on the right. You can change the name, authentication, etc as you wish.
Next click on the Shares tab. Give your Share a name, comment and you need to specify a Path. Click the browse button and another browser window should open. Here is where you specify the Mount Point you created earlier
Lets test it out to see if we can access the share. From my XP machine, I’ll just browse My Network Places, or from Start, Run go to \IP of FreeNas
While we’re here, lets create a new folder called “nfs” and an empty file called “iscsi”
So everything seems to be working just fine…Lets move on to VMWare. First, lets try using NFS. Creating an NFS share is similar to creating a CIFS share. Click on Services, NFS. Again, enable the service by clicking the same box on the right.
Next Click on the Shares tab and click the little plus sign (+)
Here we need to specify the path again…this is why I created that “nfs” folder earlier. This way all my VM data doesn’t get lumped together with my CIFS share data. You also need to specify a network that can access the NFS share. In this case, I’m allowing any server on my network. Realistically this would present a problem in the enterprise, but this is for a home lab. I’m sure there are some settings in FreeNAS to lock this down further, I’m just scratching the surface here.
If we go to our ESX server, and add storage, we can map to our NFS share using the Add Storage Wizard in VI Client
You can see the 675 GB of RAID1 goodness!
What about iSCSI? Sure we can do that too! Click on Service, and iSCSI Target. Again we need to enable the service first by clicking the little box on the right and applying our changes. Next we need to click on the little plus (+) sign next to Extents and create a new one.
First the Extent needs a name, the default one will work just fine. However we’re going to change the Type to File. Remember that “iscsi” file we created before? We’re going to point to that file. The next thing is to give it an actual size. In this example we’re going to make it 150GB.
The next thing we need to do is on the Services, iSCSI Target main menu we need to create a target. This target initializes FreeNAS’s iSCSI target and tells it to use the Extent we just created. You noticed after you add it, the “Name” will be the FreeNAS initiator name…
Click “Save and Restart” and we’re ready to head back to the ESX server! I’m not going to get into detail on how to configure iSCSI on ESX. But real quick, the first thing we need to do is add the target of our FreeNAS box in ESX. Under your Configuration tab, click on Storage Adapters, then highlight your iSCSI Software Adapter (if you don’t see it, your missing a VMKernel port) and click Properties.
Once you’ve enabled iSCSI if you haven’t already, click on the Dynamic Discovery Tab to add the IP address of the FreeNAS box.
Now go back to your Configuration tab under Storage Adapters and click Rescan….
Shazam!!! Now you should see your iSCSI target listed under Details
The final step for iSCSI is to go under the Configuration tab and click on Storage and run the Add Storage Wizard. Except this time, unlike NFS, we’re going to select Disk/LUN and use our new iSCSI target
Viola! iSCSI Storage in ESX in my basement!
I hope you found this info useful. I was looking at the new IoMega StorCenter’s that are certified with VMware for storage, but the reviews were terrible. For half the price of a StorCenter and with some regular hardware I had laying around I was able to get more storage (750GB vs. 500GB) and iSCSI. I’m noticing that my screenshots aren’t coming up 100% perfectly, I’ll fix those but in the meantime if you get stuck, drop a post and I’ll try to help!