Thursday, August 26, 2010

FreeNAS - This thing rocks.

FreeNAS is a free network-attached storage server OS. Personally, I like to use it as a VM with 256 MB RAM (higher if your going to do RAID5, then you want 512, and if you're thinking ZFS then, better give a gig) and an 8GB thin provisioned VHD on one of my ESXi servers. You could probably get away with an even smaller VHD drive for the OS. Supposedly only 128MB. I figure, I'll give it a thin-provisioned disk and if it ever needs it, it'll grab it then. Minimum Hardware Requirements

  1. Download the ISO file of the version you want from here

  2. Create and start a new VM with 8gb thin vhd, 256 mb ram and give it a name like obxFreeNAS01 with your iso file attached.

  3. Once it's started, choose to install FreeNAS on the local 8gb thin vhd.

  4. Then configure your IP address as DHCP first... then let it initialize.  Now, I know you don't want a stupid DHCP address on that thing. because you don't want your iSCSI initiators out there losing a potentially very important connection to it's drive. But trust me on this...

  5. Test a regular ol web browser and point it to the DCHP address that it was assigned.  Just to make sure you get a login at all.

  6. Shutdown your FreeNAS vm. Now configure a few new thin-provisioned VHDs for this VM.  Make a 5gb, 10gb and a 20GB one.  Later we'll use them for things like a quorum, data drive and a log drive for a SQL 2008 R2 Failover Cluster :)

  7. Start up your FreeNAS vm.

  8. Configure a static IP address for the FreeNAS... let it initialize.

  9. Now, go open a browser and make sure that the login screen for FreeNAS comes up ok.

  10. login with username admin and password freenas Once you're in, you should go update the default password to something else and also create yourself a new user account with admin privs.

  11. Next to come... the steps to create iSCSI Targets for your Windows 2008 R2 nodes to use for a Failover Cluster.

  12. Disks > Management > click the + link, select a disk you want to carve for your cluster (it'll be something like da1)

  13. Give it a description, like Logs. Leave it Unformatted and click Add

  14. Do the same for all of the vhds that you created for your cluster. I've got 3. Quorum of 5gb, Data of 20GB and Logs of 10GB.

  15. Disks > Format > Format UFS for each of your disks, give them a Volume label that matches your descriptions from the previous steps.  There's many ways to skin this cat.  This is simply my little method.

  16. Disks > Mount Points > click the + link. Give it a mount point name and description. I'm boring, I just used the same names I used for the respective volume names and disk descriptions. click Add.

    1. Oh yeah... you might notice that things get stuck in Modifying status... uh... don't forget to click APPLY CHANGES.... it's a sneaky little button at the top of the page in a few places.



  17. Services > iSCSI Target > Settings > Set your Base Name...

    1. I'm using iqn.2007-09.jp.ne.peach.obxFreeNAS01



  18. Services > iSCSI Target > Initiators> create an initiator for your own subnet.

    1. (i.e. 192.168.1.0/24)



  19. Services > iSCSI Target > Portals > use  the static IP address of your FreeNAS VM.

    1. something like this 192.168.1.58:3260



  20. Services > iSCSI Target > Targets > create an extent file for each of your disks

    1. mine looks like this: Extent name - Data0, Type - File, Path - /mnt/Data/data.file, File Size - 20Gib, Comment - Data

    2. now! Create a Target for that extent file we called Data0 and give it a Target Name of Data0

    3. Click Add at the bottom, now click Apply Changes at the top.



  21. ok - now you're ready to build a Windows 2008 R2 cluster.  Just fire your nodes up and use the local iSCSI initiator to connect to your disks. Bring em online, initialize them, format them, give them drive letters and give them a volume name.

1 comment: