Here’s the deal: create a ZFS volume on the Nexenta server, share it as iSCSI and attach it using the software iSCSI initiator from ESXi 5.
Enable the ESXi’s iSCSI initiator
Connect to the ESXi using the vSphere client. From the “Configuration” tab, in the “Hardware” section, select the “Storage Adapters” option. If you don’t already have an iSCSI initiator, click the “Add…” button and select “Add Software iSCSI Adapter”.
That’s done. Now, let’s share space.
Create the Nexenta’s iSCSI target
Connect to the Nexenta NMV using your Web browser. Log-in and select the “Data Management” tab. From the “Zvols” section, click the “Create” link to “Create a new zvol (virtual block device)”. Select the “Volume” and fill-in the “Name”, “Description” and “Size”. To use thin provisioning, AKA sparse volume, select “No” for the “Initial Reservation” option. Enable whatever option you want ; I went for gzip compression and sha256,verify deduplication. When done, click the “Create” button.
Select the Zvol and click the “Share” button.
Now, the ESXi has to be granted permissions to access the volume.
The ESXi initiator meets the Nexenta target
From the “Data Management” tab, click the “Remote Initiators” of the “iSCSI” section. Use the link to create a new remote initiator.
Fill-in the remote initiator name and the CHAP credentials. The name is the complex “iqn(…)” string you got from the ESXi in step #1. You can copy/paste from the vSphere client to the Web interface.
CHAP credentials are optional ; depending on your security policy.
Use the “Create” button to finalize the configuration.
If you have several ESXi, you can create a group out of them to ease iSCSI sharing. I won’t detail that here, but just create a “Initiator groups”, from “SCSI Target”, and add the ESXi initiators.
From the “SCSI Target” section, click the “Mappings” option. A default mapping should have been created. If you want specific mapping, like limiting target and/or initiator to specific LUN, use the “create” link.
From the vSphere client, open the iSCSI Initiator properties. Select the “Dynamic Discovery” tab and click the “Add…” button. Fill-in the iSCSI Server reference ; using IP or FQDN ; and enter the CHAP credentials if needed. The close the properties box and rescan the adapter. Click the “Refresh” and/or the “Rescan All” button to see the iSCSI LUN.
From the “Storage” section, click the “Add Storage…” button. Select the “Disk/LUN” storage type. Select the LUN that was shared and click “Next”. Select the filesystem version according to your environment ; I used VMFS-5. Enter the datastore name and capacity. Click “Finish” to complete.
The datastore is now ready to use.
One not so nice thing is that, from the Nexenta shell, you don’t have access to the zVol’s content ; although you have access to information about it.
# zfs list -r tank NAME USED AVAIL REFER MOUNTPOINT tank 36.4G 193G 40.5K /volumes/tank tank/vmware 32.3G 193G 32.3G /volumes/tank/vmware tank/vmware_iscsi 3.60G 193G 3.60G - # ls tank/vmware_iscsi ls: tank/vmware_iscsi: No such file or directory # zfs get used,available,referenced,compressratio,reservation,volsize,usedbydataset tank/vmware_iscsi NAME PROPERTY VALUE SOURCE tank/vmware_iscsi used 3.60G - tank/vmware_iscsi available 193G - tank/vmware_iscsi referenced 3.60G - tank/vmware_iscsi compressratio 2.15x - tank/vmware_iscsi reservation none default tank/vmware_iscsi volsize 128G local tank/vmware_iscsi usedbydataset 3.60G -
The nice thing though is that iSCSI over ZFS provides compression, deduplication, thin provisionning and replication features!
That’s All Folks!