Definite guide to iSCSI with FreeNAS on ESX(i) – Part 2 – FreeNAS installation and configuration

Written by Pawel Lakomski on Październik 17th, 2012

This is Part 1 of the definite guide to iSCSI with FreeNAS on ESX(i). Make sure to check out the other parts as well.

1. Introduction
2. FreeNAS installation and configuration
3. Configuring iSCSI on ESX 3.5 (standard vswitch)
4. Configuring iSCSI on ESXi 5.1 (standard vswitch)
5. Configuring iSCSI on a distributed vswitch
6. Migrating iSCSI from a standard to a distributed vswitch

 

2. FreeNAS installation and configuration

FreeNAS will be installed and configured in the same way for both ESX 3.5 and 4.x/5.x so you can follow this point no matter which version you are planning to use. There will be an additional step if you are doing it in the nested environment.

Download iso with FreeNAS from here. At the time of writing the newest stable version is 8.2.0.

Create a new virtual machine and install FreeNAS machine. I advise to create one small disk for FreeNAS system files and the bigger one for the iSCSI storage we will present to ESX hosts later (where you will be able to create VMFS datastore or map it as a RDM). The installation procedure is trivial.

The only configuration necessary after it is installed is setting up networking. Open a console and assign an IP address, then complete the configuration of FreeNAS system or go ahead to the next point.

Open your favorite browser on the machine that has got a network connectivity with FreeNAS server and enter the IP address you configured for FreeNAS.

NAS configuration portal main page

NAS configuration portal main page

Click on Services and find iSCSI. It is disabled by default so click on the slider to turn it on.

Enabling iSCSI service

Enabling iSCSI service

Click on the tool icon next to iSCSI and begin service configuration. In  the upper menu select Portals.

No portal created yet

No portal created yet

A portal is an IP address and port your iSCSI NAS will be listening on. Click Add Portal button and insert portal’s name, IP and port (the default port 3260 is already there and you can leave it as it is or change it if neccessary).

Creating a new portal

Creating a new portal

Portal configured

Portal configured

Click on Initialtors in the upper menu. By default there is no authorized initiator group configured so no one can connect to the portal configured before.

No authorized initiators configured

No authorized initiators configured

Be creating an initiators group you can select who will be able to connect. Click on Add Initiator button. In my example below by using „ALL” keyword I explicitly allow anyone to connect. However, you can of course restrict the access to certain initiators’ names or authorized networks.

Everyone's invited... but not the safest configuration!

Everyone's invited... but not the safest configuration!

No we will bind the target with the initiator group by creating a target. In the upper menu you will find Targets button – click it and select Add Target. Select the target and the initiator group you created before. Give a meaningful name to your target. For the rest of the filds you can leave defauts.

Putting the portal and the initiator group together into target

Putting the portal and the initiator group together into target

While the portal answers the question „how?” and initiator group „who?”, the extent answers to „where?”. Well, if you connect, you’d like to get access to something, right? We will use the second disk (remember when I told you at the beggining to create the FreeNAS virtual machine with two disks? If you didn’t, do it now) to  be presented by iSCSI portal to authorized initiators. In the upper menu find Device Extents. Click Add Extent. If you have a second disk in your FreeNAS VM you will be able to select it in the Disk device menu:

Using a raw disk as a device extent

Using a raw disk as a device extent

The last things to do is to put all elements together and add the extent to the target. In the upper menu select Associated targets. Click the Add Extent to Target button.

Putting everything together...

Putting everything together...

From the menus select your target and extent. Click ok. You’re done.

Target + Extent = happy NAS

Target + Extent = happy NAS

Now if you cofigured everything correctly, you will be able to see the LUN from your ESX hosts. Check out the next parts of the guide to see how.

At the beggining I found it confusing to get what goes with what so I created this diagram to help you with that.

FreeNAS configuration diagram

FreeNAS configuration diagram

 

6 Comments so far ↓

  1. jd pisze:

    very nice article… finally i know how this works.

    Thanks.

  2. Alex pisze:

    Hi!

    How did you set up the FreeNAS Link Aggregation for your two NICs which you have used in step 4?

    We’ve bound four NICs together regarding to your step 4 (just two more). If we set up FreeNAS with Link Aggregation (load-balancing mode) over 4 NICs, we can not see the LUN in VMware anymore.

  3. Karl Fife pisze:

    What’s your opinion/experience on block storage service (iSCSI) when combined with a Copy-On-Write file system like ZFS? It seems that it would lead to colossal fragmentation because every single modified data block would need to be written to a new free location instead of re-writing the block in place. Even with a ZIL accelerator and crazy amounts of RAM, I expect performance after a FreeNAS restart (with a cold cache) would be unpredictable.

  4. Randall Cruz pisze:

    Well done!!! Very nice doc!

    Thanks!

  5. Rafael pisze:

    Very helpful. I used this for my own blog too. Thanks.
    Btw, this is my blog – you can find in there more useful information …

    http://blogbt.net/index.php/2014/05/vcap-dca-beginning/

  6. Fred Evil pisze:

    Good stuff, thanks for the walkthrough for the FreeNAS n00b!

Leave a Comment