After reviewing some of the basics on storage, as well as some specifics pertaining to VMware, let’s see next how to setup iSCSI on FreeNAS and present the volume to two ESXi Hosts – as it is my case since the hosts are clustered.

The instructions below show how to export/present an iSCSI volume to the outside world where, it could then be “found” by a client (ESXi host).

iscsi-diagram-02

 

I. FREENAS & ISCSI TERMINOLOGY

  • Portal – nothing more than an association between an IP Address and a TCP port number defining the interface on which to listen to incoming iSCSI connections
  • iSCSI Target is the software, server component. This is configured within FreeNAS management web interface by setting up a Portal
  • iSCSI Initiator is a software driver which is linked to a vSwitch/VMkernel interface. This is configured in vSphere via either the vSphere Windows client, or the vSphere Web-Client. This component is in fact the iSCSI client, hence it initiates iSCSI connection to an iSCSI target
  • An extent is seen as the storage unit being shared; it can be a file, or it can be a device. Choosing file based extent vs. a device based extent shouldn’t be tricky – simply put, you should always choose file based extents since they are more flexible and offer identical performance to the device extents. Good documentation can be found here, including explanation on the difference between the two
  • LUN is the Logical Unit Number of the volume being presented to the server by means of an extent. There must exist a iSCSI target set for each LUN. Also, multiple servers could connect to the same iSCSI target at the same time, effectively accessing the LUN/Volume simultaneously
In this case, corruption is avoided by the underlying filesystem VMFS, which is VMware proprietary.
LUN vs. Extent vs. Volumes ...
The LUN is a *logical* entity representing a volume; it is what iSCSI clients see. An extent however, is a *physical* representation of the volume, as it exists locally on the actual storage.

Functionally speaking, you define an extent within FreeNAS; the extent then shows up as a LUN to the outside world. The iSCSI protocol will make the LUN appear as a storage volume, to the actual iSCSI client.

  • iSCSI Authentication is optional; when used, most likely we would use either CHAP (only the initiator authenticates) or Mutual CHAP (both initiator and server authenticate).

 

II. EXPORTING THE ISCSI LUN

1. Login to the web management interface of FreeNAS

2. Go to Services and enable the iSCSI service

screenshot190

3. Click on the little tool icon and then go to Target Global Configuration – I have changed the domain name part from example.com to home.cm; also make sure you check the LUC box. At last, I’ve chosen no authentication method to keep things simple. In real life, you would probably want storage access to be authenticated. Click Save.

screenshot193-1

4. Go to Portals and add a portal

screenshot194

5. Next, go to Initiators and allow connections from ALL initiators and ALL networks …

screenshot195

6. Jump straight to targets and add a target … Portal Group ID and Initiator Group ID must be populated as per steps done previously

screenshot197

7. You now need to create an extent … mine is called iscsi.extent 

screenshot198

8. At last, we need to link the extent to the target; so go to Associated Targets and link the two …

screenshot199

 

III. VMWARE ISCSI INITIATOR

For additional reference, or a quick recap, please see my previous blog, Part I.

1. Going forward, we will have to setup the iSCSI Initiator. This will be a one step process … no wizards, no extra information needed – just click the plus button…

screenshot202

2. Next, while the newly added adapter is selected, go to  Network Port Binding and add click the plus button …

screenshot204

3. … this will bring a pop-up similar to the one below; you will then have to select the correct VMkernel interface – the one which belongs to the vSwitch where your storage network is. In my case, this was vSwitch2, portgroup STORAGE-2-GW, and the vmk1 interface.

screenshot205

4. Next, point the initiator to the iSCSI target created previously; it will actually be automatically detected as soon as we add in the IP address of our storage:

Untitled-6

5. … adding the IP (the hostname resolves to the correct IP) and press OK.

screenshot207

6. At last, rescan your storage devices and adapters …

screenshot209

… and job (nearly) done.

7. To finish off the job, just go and add a new datastore as you would normally do. You will see the new iSCSI device in your list of available devices.

Go back to Index


Thank you,
Signature
View Rafael A Couto Cabral's profile on LinkedIn



Leave a reply

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>