How to configure FreeNAS 8 for iSCSI and connect to ESX(i)
FreeNAS is working a bit differently than Openfiler when it comes to configuring iSCSI connection to ESXi host.
When I finished building my homelab recently, I at first tested several distributions but finally sticked with FreeNAS which I think has the coolest user interface, and which can be up and running in less than 10 minutes. There is an iSCSI configuration which works a bit differently than what I use to experiment with Openfiler. So if you’re new to FreeNAS or Learning ESX(i) and if you have experienced a bit in your homelab and installed a FreeNAS 8 with RaidZ spindle you might want to read on.
I’ll try to show you how I achieved this iSCSI configuration on my homemade NAS box running Intel Atom 1.6GHZ double core CPU. At first after creating RAID Z volume, which you could see in my previous article, I went the and created NFS share.
For iSCSI there are different configuration possibilities in FreeNAS 8. If you’re have some individual disks or(and) RaidZ spindle. If you’re having an individual disks like I do, (I have 2 individual SSD’s on 2 SATA ports) you can export the whole disk as an iSCSI disk, and so you will create a device extent. But you can’t do it for ZFS pool. You have to create a file and then export the file.
On the FreeNAS website, you can see that the file extent is slower than device extent.
A quick quote from FreeNAS documentation:
A device extent allows a raw partition (volume) to be exported via iSCSI. The advantage of device extent is that they are faster than file extents. The disadvantage is that the entire volume is exported. If you only want to share a portion of a volume using iSCSI, you will need to create a file extent instead.
A file extent allows you to export a portion of a volume. When creating a file extent, you specify a file name that iSCSI clients will have access to (similar in concept to a mount point) and the maximum size of that file (storage area). The advantage of file extents is that you can create multiple exports per volume. The disadvantage is that they are slower than device extents.
This makes me think, in my case, I better configure my individual SSD’s as an iSCSI targets and the raid Z volume as an NFS …. -:) to get the most out of my SSD’s and use the RaidZ spindle for more/less some storage, since those 4 SATA drives with 7200 RPM won’t deliver much IOPS anyway.
Ok Let’s go and configure one disk as an iSCSI Target. Not so difficult.
The steps:
01. Portal group creation.
Go to the Portals > Add Portal.

02. iSCSI initiator.
Go to the menu Initiators > Add Initiator.

The next step is to create an iSCSI target.
03. Create an iSCSI Target.
Menu Targets > Add Target.

Once the target created, you must create an extent. As I mentioned before, the device extent is apparently faster, so I go for it and create a device extent. The downside is that the whole disk is exported. Does not really matter in my case, since the disks size is only 128 Gigs.
04. Device Extent.
To add a device extent, go to Services > ISCSI > Device Extents > Add Device Extent
In the example below I’m creating a device extent for the whole SSD which has got a 128 Gigs of total storage capacity.

05. Target/Extent Association.
After the Extent created, the next step is the Target-Extent association. Once this done, one last step is to activate the iSCSI service.

06.Activate the iSCSI service.
The iSCSI service can be activated in this menu.

07. Connection from the VMware ESXi Server.
That’s it for the FreeNAS part, concerning that single SSD disk. The next step are on the VMware vSphere console. Connect to your individual ESX(i) server or through vCenter. This part is actually the same as described in the Openfiler’s configuration.
Go to the Configuration >Storage Adapters and enable the iSCSI storage Adapter first.

Then Enter the IP adress of your NAS device – it’s 10.10.8.10 in my case – as on the image below…

Once validated, you’ll get a prompt to rescan your iSCSI adapters. You can do so. You should be able to see the iSCSI Disk as on the image below.

08. The last step is to create a Datastore through the VMware vSphere Client.
Go to the Storage Menu > Add Storage > Choose Disk/Lun, create a new partition and format the newly created partition with VMSF file system.

You’re done.
You should see the newly created Datastore in the VMware vSphere Client’s user interface.

This article is part of the Home made Do It Yourself NAS series.
Last note: I was able to connect both single disks with “device extent” configuration and being exported as different targets, but I did not manage to Add the RaidZ volume At the Same time. So I went and shared that volume as an NFS share….
Get some Top Free Whitepapers which you can download for free:
Top 5 VM Performance Problems.
In the Whitepaper you’ll first read the explanations where are the usual location of performance issues, and see that the resolution is not always evident in Virtual Infrastructure in general.
There are some caveats to know to find the problem first and then resolve.
Continuing to Reap the Rewards of Virtualization -
Balance and Efficiency. This illustrated e-book tells you more about interesting scenarios for sizing servers. With a clear examples. Also by using the monitoring solution bundled with Veeam One can show you exactly what’s going on in a real time or in what-if scenario.
If your RAM utilization is 4%, you have plenty of room to grow, but if you have no intention of growing that is a lot of expensive RAM going to waste. Bear in mind that more is not always better and the optimal strategy is to instead right-size your virtual environment. Download for Free
Analytics Required to Successful Manage Performance and Capacity in Cloud Environments- Managing Virtual Infrastructure instead of just physical servers one by one is challenging. One must make some decisions on where to best place the workloads or how much physical server and storage capacity to provision for new VMs…
What’s the best sizing for new VMs so they’re not oversubscribed with memory, disk or CPU…? Identify the “sleeping VMs” which do nothing, orphaned VMDKs, Snapshots, logfiles…
You can find more Free Whitepapers to download on my Free Resources page.
Enjoy… -:)
.
You may also like:
- How to configure OpenFiler iSCSI Storage for use with VMware ESX.
- How-to connect ESX4, vSphere to Openfiler iSCSI NAS
- Configure iSCSI port binding in VMware vSphere 4.1 video
- New low cost iSCSI SAN storage VMware Certified
- Starwind with ISCSI SAN Software can do High Availability for you…
- Starwind 5.0 iSCSI SAN preview video
- Starwind iSCSI HA Connection to ESX Server















