Monday 3 August 2009

Setting up ISCSI Drives using FreeNAS for a Windows 2008 Cluster

Ok I promised a FreeNAS guide – so here it a quick guide to how I’ve setup FreeNas running as a VM under VirtualBox 3.2 from my Desktop PC. It will then be used as NAS storage for my HyperVR2 cluster.

Downloaded RC1 FreeNAS ISO from here

Created a VM with VirtualBox using these settings -

f15

Then followed this guide by Dave Lawlor over at Signal Training. It’s a great guide and shows you clearly what steps are required to install FreeNAS. Personally I chose to install the Full OS (OPTION 3) during the install process.

Once the Freenas is up and running, I follow these steps.

Logon to the FreeNAS Web GUI using the default password of admin, with freenas as the password.

F1

Click on Disks> Management

F2

Click on the Management tab, and on the right side of the screen select the + sign. This allows us to add our disks to FreeNAS.

F3

Select for each virtual disk you setup under Virtualbox, and then select ZFS as the reformatted File system. DON’T SELECT THE PARTITION YOU INSTALLED FREENAS ONTO. Once you have your disk selected click on ADD, continue the process until you have added all your desired disks.

F4

Once all the disks are added select Apply Changes to confirm changes.

f5

You’ll now see all your disks online

Select Disks> Management>ZFS>Virtual Device – and click on the + symbol to add virtual devices.

f6

Here put a name, type as stripe, and select the drive you want, and lastly select ADD. After you’ve add your disks, you’ll see them under the Virtual device, select “Apply Changes”

f7

Select Disks> Management>ZFS again and choose Management. Add your disks into this section

F8

and “Apply Changes”

f9

Now select Services>iSCSI target>Settings – and enable iSCSI using the tick box top right of the page. You can change the addresses here, but I just leave the default in. Click “save and restart” button at the bottom of the page.

Then select “Services>iSCSI target>Targets”

Select the plus symbol under “Extent”. This allow you add the disks you created. One area to note is that for the path, click the button with 3 dots and select the disk you want, then add at the end of the file path /extent/. Also add the disk size in as well.

F10

Once all the disks are added, select Services>Iscsi Target>Portal Group – Select the plus symbol. Create a portal for your iSCSI disks, select add, and then apply changes.

f11

Select Services>Iscsi Target>Initiator – depending on your IP setup change these details accordingly. Then ADD and Apply Changes.

f12

Do the same for all your disks.

Ok now we just need to setup the iSCSI disks as iSCSI Targets. So select “Services>iSCSI target>Targets” and select the + symbol under the Target section on that page. Add your ISCSI target names, and select the corresponding disk. The rest leave as default. Do this for each of your disks.

f13

PLEASE NOTE “_” IS NOT AN ACCEPTABLE ISCSI TARGET NAME. So please do change it, if you have included it as your disk name!

F14

Once all the disks are given a target, hit “Apply Changes” – and your done!!! That's it for FreeNAS.

Now to test our disks under Windows 2008 Clustering.

Next go to your Windows 2008 Hyper V servers, login with admin rights, and start the “iSCSI Initiator” service. Do this on both Cluster Nodes.

f16

Then on the discovery tab, click add portal, and enter your FreeNAS Portal IP

f17

Then select the “Targets” tab and do a refresh. You disks will appear as inactive

f18

For each disk, select it and then hit the “Connect” button

F19

Select “Automatically restore this connection when the computer starts” and hit OK. The status of the drive will change from “Inactive” to “Connected”.

Open Disk Management, select “rescan disk” and your iSCSI disks are now ready to be used in the Windows 2008 HyperV cluster.

F20

Do these steps on both nodes of your cluster. Then once both nodes have discovered the iSCSI disks via the portal, add the disks as normal under Disk Management on node1, install Failover clustering feature on both servers, and run a “validate Windows 2008 Cluster configuration” test.

f21

You should receive this from the test !! Now the next post will be adding HyperVR2, adding VM’s to the LUN’s and doing some Live Migrations. Cya again soon!

3 comments:

  1. Great tutorial, could you point me in the right direction for creating the virtual drives in the Virtualbox setup. Do the vdi's of the storage devices get created before creating the VM or during the VM setup?

    Thanks
    Art Atkinson

    ReplyDelete
  2. Man, do you able to format the disk with ntfs file system using freenas vol?

    ReplyDelete
  3. Great, this can be done with OpenFiler 2.99 either or FreeNAS 8. Just for reference for another user as me, you need to get online the disk, initialize the disk, format the disk as basic (mbr), and the get offline the disk in each server of the cluster, only when you get this steps the cluster don't compliant with warnings.

    Thanks for the post, very helpful.

    ReplyDelete