In this article, I will explain to you how to setup iSCSI for ESXi in FreeNAS. I have setup a VMware ESXi 7.0 server and connect it as an iSCSI datastore.
It is not very difficult, The FreeNAS web GUI makes it easy to enable iSCSI and set up a storage volume as an iSCSI target, and you can connect it using the ESXi web GUI using software iSCSI.
Keep reading to found out how to setup iSCSi for ESXi on FreeNAS.
Enabling the iSCSI service in FreeNAS
1- Open web browser, type FreeNAS IP address, and hit enter. Type your credentials and then click login.
2- FreeNAS Dashboard.
3- To enable iSCSI Service, click on the Services tab, and then enable iSCSI, Start Automatically.
How to create a new storage volume to share in FreeNAS
4- Select Storage, select Pools, and then ADD.
5- Choose create new pool checkbox, and then select create pool.
6- Type a unique name and then select the disk you want to share as iSCSI share.
7- Click on the error key to select the disk and then click create.
8- Select the confirm checkbox and then click create pool.
How to Add Zvol
9- Next to the pool we need to create the storage volume in. Take note of how much space you have available, then select three dots and select Add Zvol.
10- zvol name – type a vzol name.
Comments – a description
Size for this zvol – choose the volume size you want to create.
Now click SAVE to create the new Zvol.
11- freenas add zvol.
12- How to setup iSCSI to share the new volume
Select the Sharing tab and then Block (iSCSI)
Select the Portals tab and then click the ADD button.
13- Description – type a description
IP Address – Enter the IP of an existing network interface that you want the portal to existing on. If you click the box it should expand to show you the currently available IPs.
Port – The TCP port the default is 3260.
Click SAVE to create the portal.
14- We need to create an Initiator to attach to the portal so it can initiate requests to and receive responses from iSCSI target(s). Select the Initiators tab and then click on ADD.
15- Select Allow All initiators and then save button.
16- Select targets and click ADD.
17- Target Name – type a name for your target.
Target Alias – a user-friendly name
Portal Group ID – Select the ID of the portal group we created earlier.
Initiator Group ID – Select the ID of the initiator group we created earlier.
Click SAVE to create the target.
18- Create the Extents tab and then click ADD.
19- Extent name – The name of the extent.
Extent type – Select Device.
Device – Click here to select the Zvol we created earlier.
Under description select enable TPC
Select Enabled and then click SAVE to create the extent.
20- Select the Associated Targets tab and then click ADD.
21- Target –select the target we created earlier.
LUN ID – Enter a number between 0 and 1023.
Extent – Click to select the extent we just created.
Click save to associate the extent with the target.
22- You will be returned to the Associated Targets tab and see the newly available target.
To add iSCSI FreeNAS to VMware vCenter vSphere Environment.
1- Login to VMware vCenter and select a host in the navigation pane.
Select the Configure tab, select Storage Adapters under storage and then select Add Software Adapter,
2- Select Add software iSCSI adapter and then select OK.
3- Select vmhba65 (the iSCSI software adapter), and then clicked Rescan Adapter and OK. Select the Dynamic Discovery tab and then click Add.
4- In the Add Send Target Server, enter the IP address of the FreeNAS system in the ISCSI Server text field and then click ok.
5- Select Rescan Adapter.
6- Right-click on the ESXi host, select Storage and then New Datastore.
7- Select the VMFS, and then click Next.
8- Enter the Datastore name, select the iSCSI target (FreeNAS), and then click next.
9- Select VMFS 6 and then click next.
10- Click next.
11- Review the configuration and then click finish.
12- Select the Datastore tab and saw the iSCSI-based datastore listed.
For more details please click here