As part of my ongoing work towards the MCM Certification in SQL Server, something I wanted to look into was the creation of a cluster to play with. It turns out this isnât a straightforward as you might think (!).
DISCLAIMERÂ – This isnât a plan for a live production environment. It is a plan for a set of Virtual Machines, that you can use to play with.
DISCLAIMER 2Â – This is most certainly not a guide on how to use FreeNAS. This method works, but I make no claims that this is the best way to do it, as Iâm certainly not a FreeNAS Expert.
To get the process around creating a cluster together, Iâm going to write a few blog posts:
Part 1 – Creating the storage (This post)
Part 2Â – Creating the Windows Cluster (Pending)
Part 3 –Â Creating the SQL Server Cluster (Pending)
There may be additional partsâŚ
Iâm anticipating creating a network as shown in the diagram to the right.
Itâll be a Windows Domain, so thereâll be a Domain controller (VMLAN-DC), two SQL Serverâs whichâll eventually be running in a Cluster.
One thing that a Cluster needs is a shared storage area. To achieve this, Iâm going to use FreeNAS, which is an Open Source Storage Platform. Itâll allow me to create ISCSI-3 drives and since Requirements for Windows clustering specify Serial attached SCSI, Fibre Channel or ISCSI for storage, thatâll work.
Step 1 â Download FreeNAS
Iâm going to use FreeNAS 8 since that is the current (at this date) version. Itâs a free download, so go here, and set it downloading (approx. 130mb).
Step 2Â – Start your Virtualisation
Next up, start your virtualisation engine of choice. Iâm going to use VMWare Workstation 8, as itâs always served me well in the past, and it gives me flexibility that I need. I imagine this process should work with other Virtualisation platforms. Create yourself a VM, and Iâm giving it the following specification:

2 Gb RAM, which I may reduce after testing, and just the one core.
Hard Disk 1 will be used by FreeNAS.
Hard Disk 2 will be the Quorum disk (used for Clustering).
Hard Disks 3-6 will be available for shared storage (Data, Log, Tempdb, Backup).
Virtually insert the ISO Image, and start the VM.

Choose Option 1 to Install to a Hard Drive

Choose da0 to install to the appropriate Disk.

Click Yes, to continue with the installation.

Upon completion, Press OK, Choose 4 to Shutdown the machine, and when itâs done, âejectâ the ISO Image.
Then restart the VM. When it has completed starting up, youâll be presented with a screen similar to this:

The important bit here is the web address at the bottom. Open that up in a browser.

Step 3 – Configuring FreeNAS
The first thing to do is assign a password, as thisâll get rid of the annoying red light in the top right corner. Click the Account Icon, choose the Change Password option and enter a new password.
The next thing we need to do is to add the storage devices into FreeNAS. Do this by clicking on the Storage icon at the top, then click on Create Volume

Then enter the volume name, pick the Member disks and choose ZFS as the filesystem, then click Add Volume. Iâm going to create them as follows:
quorum – da1
disk1Â – da2
disk2Â – da3
disk3Â – da4
backup – da5
This should give you the following results:

Step 4 – Configuring iSCSI
Next click on the Services icon, and click the spanner next to the iSCSI service.

In here, youâll have a number of tabs. First, weâll need to create a Portal:

So, click the Portals tab, and click Add Portal. The IP Address of the server should appear in the box, if you have 0.0.0.0, replace it with the IP Address of the server, so it should be <ipaddress>:3260. Then click ok.

Next click, Authorized Initiator, to add an Initiator. Leave the defaults here (ALL and ALL) and click Ok.

Next go to the Targets tab, and click Add Target. You need to add a target for each disk, so for each, youâll need to add a name, choose Disk as Type, Choose 1 for Portal Group and 1 for Initiator Group, and click OK. Repeat this for each disk. This should result in this screen:

Next we need to add extents to the NAS, so click on the Extents tab, and click Add Extent. Again, we need to create one for each disk, so enter a name, choose the path, and add /<diskname> to the end, and specify the extent size, whichâll be 10240MB for the 10gb disks. Repeat this for each disk.

So, youâll have these extents:

Next we need to associate the Targets we created earlier, with the Extents. Click on the Associated Targets tab, click Add Extent to Target, and for each disk, pick the Target and Extent to match.
Next, click the System Icon, click Reboot, and let the system reboot. When it comes back up, log in to the Web UI again, click the Services icon, and click the On/Off Toggle next to iSCSI and it should start.

Step 5 â Testing iSCSI
The easiest way to test that the iSCSI connection works is to run the iSCSI Initiator, whichâll be on a server, or your Windows 7 Desktop. Go to Start -> Administrative tools and click iSCSI Initiator. Itâll ask to start the service. Say yes.
Then, in the Target box at the top, enter the IP Address of your FreeNAS VM, and click Quick Connect. If all is working, youâll be presented with the list of disks from the FreeNAS VM.

Congratulations, youâve created a FreeNAS Environment for your Cluster!
Next up, creating the Windows Cluster