To get a zvol shared out on a network and visible to clients we need to set up the iSCSI service. This is not as bad as it used to be in the older interfaces.
The iSCSI config can be reached from Sharing / Block Shares (iSCSI) or Services / iSCSI.
Just remember to check that the iSCSI service is running and set to start automatically (says the voice of very bitter experience)
Go to Services / iSCSI (don’t start it now) and click the pencil.
The first tab in the iSCSI config is Target Global config.
This can be left as is for now. Click Save
Although this is not technically a config change, FreeNAS will now want to enable the iSCSI service. If the service is not enabled it will be now. Click Enable Service.
The Portals menu is shown. Click Add.
The Portal pop window will ask for an IP address, select the IP defined for the iSCSI NIC and click Save.
Note: as this is a test build and I’m not that paranoid I am not using any authentication.
Select the Initiators tab and click on the Add button to create an initiator group.
Here I have just added the whole iSCSI network segment. If you are more paranoid (or are going to use this build) I would add the individual host initiators.
Click Save when done
Click on the Target tab and then click the Add button.
Select the Portal Group ID created earlier (normally 1) and the Initiator group ID (again normally 1)
This is a test homelab so I’m not using Chap authentication, these are blank.
Click Save
Click the Extents tab and the Add button
Give the Extent a name (I normally use the vmware Datastore name)
The Extent type is a device and that device is the zvol we created earlier.
Don’t forget the tick the enabled box and then click Save.
Now click on the Associated Targets tab and then click the Add button.
In the pop up window Add a target name. A valid name is something like iqn.2005-10.org.freenas.ctl:freenas.[your domain]
Leave the LUN ID black as it will be auto assigned and select the Extent we created earlier.
Click Save.
iSCSI is now configured. Go back to Services / iSCSI and make sure the service is running and set to auto start.
Connecting to the iSCSI zvol
In the ESXi host go to Configure / Storage Adapters / iSCSI adapter /Dynamic Discovery and add the FreeNAS iSCSI NIC IP.
Re-scan the adapter and then click on static discovery.
If the ESXi server can see FReeNAS server we will see the target IQN
Then we start the new storage wizard on an ESXi host. We should see the zvol.
From there just run through the wizard, naming the Datastore and setting the size, VMFS version etc.
Other Posts in this series
FreeNas build and setup
1, Install from CD
2, IP setup
3, Basic config
4, Data NIC
5, Disks and pools
6, iSCSI setup