Monday, November 25, 2013

Configuring FreeNAS 8 for iSCSI on VMware vSphere 5 part 2

iSCSI stands for Internet SCSI and allows client machines to send SCSI commands to remote storage servers such as FreeNAS. This allows you to consolidate your storage drives into a single machine for lower cost per GB and easier maintenance, with the illusion of local disk drives on your client machines. The functionality to use iSCSI drives is built into both Windows Vista and Server 2008 natively. At the higher end you can also use iSCSI for low cost clustering solutions and disaster recovery.

In the past this was usually done using special hardware and Fibre cabling, though with iSCSI you can leverage your existing network infrastructure. It should be noted that depending on the network load and performance requirements of your servers this can be drastically slower than the dedicated options. For a high performance production application you can still use iSCSI but I would look at setting it up on its own network at 1GB speeds.

How Does iSCSI Work? 


There are two parts to the iSCSI protocol, the first being clients and the second being storage devices.
Clients are called iSCSI initiators and can be configured either using hardware or software solutions. As I mentioned earlier this functionality is already built into Vista and Server 2008, so we will not have to add any software/hardware to these machines.
The storage devices are called iSCSI targets and must be running some type of software/hardware to receive the incoming requests from the iSCSI initiators. Luckily FreeNAS has the ability to create iSCSI drives as part of its core package so I am going to use the FreeNAS server I used in a past demo.

Setup iSCSI Target Drive on FreeNAS Server

I’m going to use FreeNAS as the iSCSI target, and if you are going to follow along with this demo, it is imperative that you have one setup as well.
If you don’t you can read how to setup FreeNAS server and then come back to this article for the next steps.

This demo is going to assume that while the hard drives are installed in the server they are NOT added to the FreeNAS interface.

You must add the second hard disk (or partition) to use as iSCSI storage disk.
 I have added one more virtual hard disk to my VMware Workstation virtual machine.

NOTE: You can follow these same steps for configuring a iSCSI in VMware vSphere Environments as well..

First, we will add a new HDD to the FreeNAS VM.

Open the Settings Wizard of the FreeNAS VM

 In the "Add Hardware Wizard", select the Hard Disk and click Next

Select "Create New Virtual Disk" and click Next

 Select "SCSI" and click Next

Provide the disk space for the new HDD. I have provide 20 GB.. You can use your imagination here !!

NOTE: The space that you provide here will be used as a iSCSI storage, so plan accordingly and provision.

Click FINISH when done

The best part of FreeNAS is that the newly added disk automatically shows up on the FreeNAS VM Console as shown below:

We now Create the volume as shown below:
Storage –> Volumes –> Create Volume 

Select the disk you want to add to Volume pool. Provide a Volume Name (testvolume).. select ZFS as the filesystem type and when done, click Add Volume

 You should see the new volume as shown below:

To configure iSCSI, go to Services –> iSCSI 

If you like you can change the ‘Target Global Base Name’ under iSCSI settings. Otherwise, leave with existing example name. I changed as below (iqn.2011-03.test)

Add portal in next step. You can leave the default or provide the IPv4 address of FreeNAS virtual machine. In my case it is, so I can add in portal filed, but I left if with default 0 values. 

 Add the Authorized Initiator now.

 You can go with default option ‘ALL’, if more security is required then insert the particular network in Authorized network, like

Now we need to create TargetsExtends and match them in Associated Targets.

NOTE: We have to repeat the same steps for each iSCSI disks we are going to create.

Create a target first:

Specify the target name (disk1), the TYPE (disk), the Target Flags (read-Write), Portal Group IDInitiator ID 

NOTE: If you have multiple HDDs, then do the same step again for second target

Add Extends now. 

Provide a Extent Name (extent1)

‘Path to the extend’ filed should contain mounted storage name (Created earlier.. testvolume) with extended name. I have allocated 17 GB as below.  

NOTE: Follow the same for the second extend if you are creating two iSCSI disks in FreeNAS

 Go to ‘Associated Targets’ and match the targets and extends we have created earlier.

We are almost done, but the important part is still pending, which is enabling iSCSI service in FreeNAS 0.8, it was disabled by default.

Go to ‘Services’ and Click on OFF to make it ON in iSCSI.

Now your iSCSI storage disks in FreeNAS is ready to connect from other hosts

No comments: