ESX Virtualization

VMware ESXi, vSphere, VMware Backup, Hyper-V... how-to, videos....

Nakivo Backup and Replication - #1 Backup solution for Virtual, physical, cloud, NAS and SaaS

Menu
  • Certification
      • VCP-DCV vSphere 8
          • vcp2024-125.
        • Close
    • Close
  • VMware
    • Configuration Maximums
    • vSphere
      • vSphere 8.0
      • vSphere 7.0
      • vSphere 6.7
      • vSphere 6.5
      • vSphere 6.0
      • Close
    • VMworld
      • VMware EXPLORE 2024
      • VMware EXPLORE 2023
      • VMware EXPLORE 2022
      • VMworld 2019
      • VMworld 2018
      • VMworld 2017
      • VMworld 2016
      • VMworld 2015
      • VMworld 2014
      • VMworld 2013
      • VMworld 2012
      • VMworld 2011
      • Close
    • Close
  • Microsoft
    • Windows Server 2012
    • Windows Server 2016
    • Windows Server 2019
    • Close
  • Categories
    • Tips – VMware, Microsoft and General IT tips and definitions, What is this?, How this works?
    • Server Virtualization – VMware ESXi, ESXi Free Hypervizor, VMware vSphere Server Virtualization, VMware Cloud and Datacenter Virtualization
    • Backup – Virtualization Backup Solutions, VMware vSphere Backup and ESXi backup solutions.
    • Desktop Virtualization – Desktop Virtualization, VMware Workstation, VMware Fusion, VMware Horizon View, tips and tutorials
    • How To – ESXi Tutorials, IT and virtualization tutorials, VMware ESXi 4.x, ESXi 5.x and VMware vSphere. VMware Workstation and other IT tutorials.
    • Free – Free virtualization utilities, ESXi Free, Monitoring and free backup utilities for ESXi and Hyper-V. Free IT tools.
    • Videos – VMware Virtualization Videos, VMware ESXi Videos, ESXi 4.x, ESXi 5.x tips and videos.
    • Home Lab
    • Reviews – Virtualization Software and reviews, Disaster and backup recovery software reviews. Virtual infrastructure monitoring software review.
    • Close
  • Partners
    • NAKIVO
    • StarWind
    • Zerto
    • Xorux
    • Close
  • This Web
    • News
    • ESXi Lab
    • About
    • Advertise
    • Archives
    • Disclaimer
    • PDFs and Books
    • Close
  • Free
  • Privacy policy

How to configure FreeNAS 8 for iSCSI and connect to ESX(i)

By Vladan SEGET | Last Updated: October 15, 2017

Shares

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. FreeNAS 8 for iSCSI and connect to ESX (i) . 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.

How to configure FreeNAS 8 iSCSI connection to ESX(i) server

02. iSCSI initiator.

Go to the menu Initiators > Add Initiator.

How to configure FreeNAS 8 iSCSI connection to ESX(i) server

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.

How to configure FREENAS 8 to export iSCSI disk

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.

How to configure FreeNAS for iSCSI

06.Activate the iSCSI service.

The iSCSI service can be activated in this menu.

How to configure FreeNAS for iSCSI

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.

How to configure FreeNAS 8 iSCSI connection to ESX(i) server

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

How to configure FreeNAS 8 iSCSI connection to ESX(i) server

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.

How to configure FreeNAS 8 iSCSI connection to ESX(i) server

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.

How to configure FreeNAS 8 iSCSI connection to ESX(i) server

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….

  • How to build a low cost NAS for VMware Lab – introduction
  • How to build low cost shared storage for vSphere lab – assembling the parts
  • VMware Home Lab: building NAS at home to keep the costs down – installing FreeNAS
  • Performance tests with FreeNAS 7.2 in my homelab
  • Installation Openfiler 2.99 and configuring NFS share
  • Installing FreeNAS 8 and taking it for a spin
  • My homelab – The Network design with Cisco SG 300 – a Layer 3 switch for €199.
  • Video of my VMware vSphere HomeLAB
  • How to configure FreeNAS 8 for iSCSI and connect to ESX(i) – this post
  • Haswell ESXi Whitebox

You can also find some Free Whitepapers to download on my Free Resources page.

Shares
5/5 - (1 vote)

| Filed Under: Server Virtualization Tagged With: Freenas 8, Freenas 8 iSCSI, How to configure FreeNAS 8 iSCSI connection to ESX(i) server

About Vladan SEGET

This website is maintained by Vladan SEGET. Vladan is as an Independent consultant, professional blogger, vExpert x16, Veeam Vanguard x9, VCAP-DCA/DCD, ESX Virtualization site has started as a simple bookmarking site, but quickly found a large following of readers and subscribers.

Connect on: Facebook. Feel free to network via Twitter @vladan.

Comments

  1. Ben says

    August 26, 2011 at 5:20 pm

    This…does…not…WORK!

    Everything goes according to plan, and then I get to step 8, and wouldn’t you know it, vmware says 0 0 0 for connected adapters on the software side! It’s the same stupid problem I get in the real world too, what the heck is the program’s problem here?

    • Jake says

      December 14, 2011 at 7:58 pm

      Works pretty friggin good for me. And I’ve only been using esxi with Vcenter for about 2 weeks and FreeNAS for about 2 hours. Vladan, you are the man!

  2. Vladan SEGET says

    August 27, 2011 at 1:58 am

    At first you should be able to ping the NAS box by using the command vmkping. By using Putty you can connect to your ESXi Server and try to ping the NAS.

    If that works and you correctly setup the iSCSI target on your NAS box, you should be able to find the iSCSI target through the vSphere client user interface.

  3. mark says

    August 31, 2011 at 2:22 am

    I have the same problem as Ben. what steps should I take if I am unable to ping the NAS?

    • mark says

      August 31, 2011 at 2:25 am

      I just want to add that I am able to add the iSCSI data store ok to a windows machine on the same. I’m only having issues when adding it to vmware.

    • Vladan SEGET says

      August 31, 2011 at 2:28 am

      Make sure that you’re on the same network and/or VLAN. Check the connections, activate the iSCSI initiator (not active by default). Then check ESXi Firewall as well.

      Oh, one question. The article was written BEFORE the vSphere 5 release. Are you using ESXi 4.1 or ESXi 5.0 as a hypervisor?

      Hope it helps…

      • Vadya says

        September 19, 2011 at 1:07 pm

        Hello, Vladan.
        I’ve using ESXi 5.0 and do not connect iSCSI storage.
        how i can connect FreeNAS with vSphere 5.0?

        Vadya.

        • Scott Harris says

          September 20, 2011 at 6:44 pm

          Hi Vadya,
          Perhaps make sure you are using the new release from earlier in the week(FreeNAS 8.0.1-RC2).
          The release note states “-The iSCSI target daemon (istgt) has been updated to address interoperability
          issues with VMWare ESXi 5.0 (r7530, r7652, r7817)”.
          I hope this helps, Scott

        • Vadya says

          September 22, 2011 at 12:44 am

          Hello, Scott!
          Thank you, it’s really works.
          Vadya.

  4. Jon says

    September 28, 2011 at 3:05 pm

    You may be running into compatibility problems with ESXi 5, downloading RC2 now.

    http://www.freenas.org/about/news/item/freenas-801-rc2

  5. Fas says

    October 5, 2011 at 7:41 am

    It worked 🙂 thnx 

  6. Calvin says

    October 12, 2011 at 6:11 pm

    Good it worked for me. Can you also point me a direction if I like to create an isolated volume for guest OS using MS iSCSI initiator? I’m thinking of if the volume can be assigned a IP for guest OS to connect as well as restricted access besides that particular guest.
    I would appreciate if you can answer!

    • Vladan SEGET says

      November 4, 2011 at 6:56 am

      You do it the same way, just you won’t be able to access this volume at the same time by VMware ESXi server, since the volume will be formatted as an NTFS.

      best
      Vladan

  7. Marc says

    November 4, 2011 at 6:24 am

    Hi,
    Thanks for this post ! However, I’ve got a problem. I’ve got a 8TB Raid10 array and when I would like to add a extent, there isn’t “disk device”. But the 8TB volume is mount in da0 because I saw it in CLI or in storage drive menu. Is someone can help me ? Thanks a lot, Marc.

  8. paul says

    November 20, 2011 at 9:02 am

    for me the problem is “Device extents”. i cant get it to list any. the device list is empty and its very frustrating!

  9. Michael says

    December 13, 2011 at 6:56 am

    Just wanted to say thanks as this was very easy to follow and worked excellent with Freenas8 and ESXi 4.1. Took me literally 3 minutes to have this up and running.

  10. Carl says

    December 17, 2011 at 12:48 pm

    Hi Vladan
    Did you continue using Freenas for your lab set-up, or have you changed to something else.

    I am also curious whether the USB thumb drive is being written to by Freenas V8 – and whether the write cycles might shorten the life of the USB Stick.

    Great posts by the way

    • Vladan SEGET says

      December 18, 2011 at 3:35 am

      In fact, yes, I stick with the Freenas 8 (upgraded to 8.0.1) as for now. Yes, and it’s still installed onto the USB stick (2 gigs) which is inside of the box…

      Thanks

  11. mkruger says

    December 31, 2011 at 1:53 am

    I have a lab running on Win7 64 bit all inside of individual VMplayer VM’s. For the most part, it works pretty well, but the NAS was super slow. At first I tried running freenas 7.x using NFS but it was extremely slow (CPU was 100% when transferring data). It was copying data at less than 10baseT half duplex speeds. Then the same thing using freenas 8.02, but the performance was the same.

    Next I tried a physical machine with freenas 8.02 using NFS. Much improved (20-30MB/s), but still too slow. Then I tried ISCSI using CHAP and seeing if I could get Win7 connected to it. I did and the performance was twice as fast as when using NFS. That’s good enough for a lab.

    I could not however, get ESXi to connect to the ISCSI target using CHAP. So I ended up disabling it….followed your guide. All is working well. Thanks.

    • mkruger says

      December 31, 2011 at 2:43 am

      After further observation and thought…I noticed I am still getting 100% CPU utilization…even with an external ISCSI target. Guess nesting VM’s in ESXi is not such a great idea after all. Time to build a second white box.

  12. Ariful Khandakar says

    January 4, 2012 at 8:39 pm

    Thank you mate, you made my day. Thank you
    for your effort and sharing your knowledge with us.

  13. mkruger says

    January 14, 2012 at 8:57 pm

    @vladan,

    What kind of performance numbers are you seeing with this configuration? Particularly I would be interested in the Read/Write speeds.

  14. Goran says

    January 17, 2012 at 4:40 am

    Your post helped me a lot setting up iscsi on FreeNAS 8 along with ESXi, but I did noticed one thing. I have 2 80Gb drives in soft Raid1 setup on my FreeNAS and when I tried to Add Device Extent on the FreeNAS in the iSCSI setings I could not select a disk. My Raid1 setup was not in the list. As soon as I deleted the Raid volume I could add device extent because I could see the two drives. So iscsi doesn’t work with soft raid in FreeNAS 8 or I’m doing something wrong?

    Thanks in advance.

    • Andrew says

      February 7, 2012 at 8:40 am

      Before you add device extent you have to ‘create volume’, then ‘create zfs volume’ and after that can create extent and everything will be working fine.

  15. Srikanth 1120 says

    March 2, 2012 at 8:49 am

    its working perfet on my test vm..ableto acces from redhat iscsi initiators..

  16. tequesta rules says

    March 15, 2012 at 1:58 pm

    Hello Vladan, I´m sorry if my post is unpleasant, but I really don´t know what to do.

    This is my situation:

    I got two scenarios, one of testing and one of production.

    Both scenarios has 2 IBM servers (testing 2 x IBM x346 and production, 1 IBM x3400 and 1 IBM x3200) all four only has local disk for storage. All has ESXi 4.1 U2 installed on.

    On both scenarios I got some VMs and one of them has FreeNAS (8.0.3 on testing and now 8.0.4 on production) installed on.

    On both scenarios I configure the FreeNAS and ESXi following your instructions.

    On both scenarios I configure ghettoVCB to backup VMs and send the backups to the shared storage from FreeNAS.
    On testing scenario, everything going fine and after one week of test, I implement the solution on production and it never work.

    The ESXi lost and reestablish the connection all the time, the speed sucks, and so on.

    This is a part of the log from ESXi:

    3/15/2012 9:26:54 AM – esxi02.local – Successfully restored access to volume 4f61cb8c-b99bbea0-297c-00145e5d7158 (backup) following connectivity issues.
    3/15/2012 9:26:49 AM – esxi02.local – Lost access to volume 4f61cb8c-b99bbea0-297c-00145e5d7158 (backup) due to connectivity issues. Recovery attempt is in progress and outcome will be reported shortly.
    3/15/2012 9:26:23 AM – esxi02.local – Successfully restored access to volume 4f61cb8c-b99bbea0-297c-00145e5d7158 (backup) following connectivity issues.
    3/15/2012 9:26:19 AM – esxi02.local – Lost access to volume 4f61cb8c-b99bbea0-297c-00145e5d7158 (backup) due to connectivity issues. Recovery attempt is in progress and outcome will be reported shortly.

    This is part of the messages from FreeNAS:

    Mar 15 05:25:52 freenas istgt[1718]: Login from iqn.1998-01.com.vmware:esxi02-4dea8d88 (192.168.70.10) on iqn.2011-03.example.org.istgt:backup LU1 (192.168.70.15:3260,1), ISID=23d000002, TSIH=12, CID=0, HeaderDigest=off, DataDigest=off
    Mar 15 05:26:19 freenas istgt[1718]: istgt_lu_disk.c:5137:istgt_lu_disk_queue_start: ***WARNING*** transfer abort CmdSN=2178
    Mar 15 05:26:19 freenas istgt[1718]: istgt_lu.c:2798:luworker: ***WARNING*** LU1: lu_disk_queue_start() abortedMar 15 05:26:19 freenas istgt[1718]: istgt_iscsi.c: 777:istgt_iscsi_write_pdu_internal: ***ERROR*** iscsi_write() failed (errno=32)
    Mar 15 05:26:19 freenas istgt[1718]: istgt_iscsi.c:3508:istgt_iscsi_task_response: ***ERROR*** iscsi_write_pdu() failedMar 15 05:26:19 freenas istgt[1718]: istgt_iscsi.c:4957:sender: ***ERROR*** iscsi_task_response() failed on iqn.2011-03.example.org.istgt:backup,t,0x0001(iqn.1998-01.com.vmware:esxi02-4dea8d88,i,0x00023d000002)

    What do you think about this?

    Thanks a lot.

    tequesta

    • Vladan says

      March 19, 2012 at 5:17 pm

      I’m not sure that FreeNAS is supported to run in a VM. Certainly not in prod. Should be working in LAB environments as a Shared Storage though. You’re adding an additional layer with the destination of those backups inside the FreeNAS VM…   From the logs I can see some connectivity issues, that’s all.

      • tequesta rules says

        March 20, 2012 at 6:34 am

        Thanks Vladan. I will continue trying some changes. If I put it to function, I post here my experiences.

  17. Zamir Jimenez says

    March 23, 2012 at 12:38 am

    thanks its works 

    regards from mexico 

    • Vladan SEGET says

      March 23, 2012 at 4:24 am

      Mexico city? Wow… cool. I hope that you enjoying to read my blog.

      Best regards,
      Vladan

  18. Tschak says

    April 8, 2012 at 9:22 am

    Hi,

    I have two old DL385 and freenas 8 on the board Jetway JNF81 with 2gb ram und 4x 500gb sataII. My experence with fileextend and deviceextend on iscsi was different.

    best write with fileextend  38mb/s for 422mb file or 15mb/s for 2171mb file
    second write with deviceextend 20mb/s for 422mb file or 2,5mb/s for 2171mb file
    bad write with nfs 3,3mb/s for 422mb or 2171mb file

    to messure the speed I copied the file from a local ssd on the esxi to the target below. The bigger file was a vmdk with 8388mb and 2171mb data on it. The other file was a iso file with 422mb.

    configuration of freenas

    raidz2 over all 4hds 900gb space (just for testing)
    2 zfs Dataset -> 1 for NFS und 1for iscsi fileextend
    1 zfs Volume -> 1 for iscsi deviceextend

    I think the poor speed of the bigger files depends on the ram. I will expand it to 8gb.

    Next Raid will be raidz instead of raidz2.

  19. FreeNAS Fan says

    May 25, 2012 at 9:22 pm

    Excellent Article. Had an issue starting the iSCSI service afterwards and needed to remove the iSCSI Initiator value in step 2 to get it started. Then retraced these steps for s successful deployment.
    Keep volume sizes under 2GB or ESXi 4.x will throw an error when trying to create the datastore.

  20. m0ham2 says

    July 10, 2012 at 8:46 am

    Super Article 😉

  21. NAS_Junky says

    July 15, 2012 at 3:01 am

    I am tossing together a small lab like virtual environment and trying to setup FreeNAS as a VM setup with harddisk allocations from my system but I get stuck at step 4 where after the volume is done and I’m setting up the iSCSI I can not get the extent to see a device. Maybe because I’m trying to do this all within a virtual bumble and maybe the freenas needs to be a physical box of some sort? The FreeNAS is setup in VM workstation and the ESXi hosts as well for right now.

    • NAS_Junky says

      July 15, 2012 at 3:03 am

      Meant to say Virtual bubble, been working on this setup for to long…

  22. Michael says

    April 17, 2015 at 9:10 am

    Hi,

    I’ve done the same setup with freenas 9.3, added the iscsi target in vSphere, but when going to create the Datastore it’s not appearing the iSCSI Lun. I’m using vSphere 5.5 u2
    Any ideea?

  23. Matthias says

    January 15, 2016 at 3:15 pm

    Hello Vladan

    hope u see this post. I did it with ESX 5.5 and Freenas 9.3 and it worked immediately.
    So i just would say thank you very much, you just made my day.

    • Vladan SEGET says

      January 15, 2016 at 4:13 pm

      Glad you liked it. Even old article can sometimes help -:)

Private Sponsors

Featured

  • Thinking about HCI? G2, an independent tech solutions peer review platform, has published its Winter 2023 Reports on Hyperconverged Infrastructure (HCI) Solutions.
  • Zerto: One Platform for Disaster Recovery, Backup & Cloud Mobility: Try FREE Hands-On Labs Today!
Click to Become a Sponsor

Most Recent

  • Commvault’s Innovations at RSA Conference 2025 San Francisco
  • VMware ESXi FREE is FREE again!
  • Installation of StarWind VSAN Plugin for vSphere
  • Protect Mixed environments with Nakivo Physical Machine recovery (bare metal)
  • No more FREE licenses of VMware vSphere for vExperts – What’s your options?
  • Tails – Your Private OS on USB Stick
  • StarWind V2V Converter Now has CLI
  • Veeam VHR ISO v2 – 2025 Download and Install
  • Deployment OVA and Installation of Nakivo Backup and Replication for VMware
  • XCP-NG FREE Hypervisor and XO Lite to deploy XOA

Get new posts by email:

 

 

 

 

Support us on Ko-Fi

 

 

Buy Me a Coffee at ko-fi.com

Sponsors

Free Trials

  • DC Scope for VMware vSphere – optimization, capacity planning, and cost management. Download FREE Trial Here.
  • Augmented Inline Deduplication, Altaro VM Backup v9 For #VMware and #Hyper-V – Grab your copy now download TRIAL.

VMware Engineer Jobs

VMware Engineer Jobs

YouTube

…

Find us on Facebook

ESX Virtualization

…

Copyright © 2025 ·Dynamik-Gen · Genesis Framework · Log in