Navigate to Storage and highlight the Volume you just created and Select create zVol
Enter a Volume name and the size, if using GB be sure to enter the g after the number. Select Add zvol
Navigate to Services on the top bar and turn on iSCSI by clicking on the Toggle
Click on the Wrench next to iSCSI to enter the iSCSI Settings
Select Portals and Add Portal
Give the Portal a comment and leave the IP at 0.0.0.0 which means it will communicate with all IPs
Select Initiators and select Add Initiator
We could lock this down but for the lab environment I will leave at ALL and ALL and click OK
Select Authorised Access and select Add Authorised Access
Enter a Username and Password details ( I kept them simple for the lab)
Select Targets and Add Target
Enter Relevant details i.e Target Name and Alias and use Drop down menu on the Portal Group ID and Initiator Group ID just created
Select Extents and Add Extent
Enter a name for the Extent and Select Device from the Extent Type options. Select the Volume you want from the Device window and click OK
Select Associated Targets and Add Target / Extent
Give the Extent a LUN ID and select the Target and Extent from the drop downs and click OK
So from here we can map this back to vSphere or Windows. As a quick test, I will map it to a Windows Box.
Bring up the iSCSI Initiator and enter the IP of the FreeNAS Box – click Quick Connect
Select Done
Now if we go into Computer Management / Disk Management we should see Windows wanting to Add the Drive
Select OK and add Volumes as necessary
Make sure you can Write files to the New Drive