This is Part 3 of a series of posts explaining how to configure OpenIndiana as NAS storage device. The series is made up of the following parts:
- Background information about OpenIndiana and OS installation
- Network configuration and Setting up storage
- Presenting storage to your Hosts with iSCSI and/or NFS
- Performance testing
At the end of Part 2 we had the network set up, VMware Tools installed, additional disk space added to the VM, and a zpool created.
What we will go through in this part is:
- Configuring NFS and iSCSI services
- Creating a Volume for iSCSI
- Create an NFS folder
- Create a LUN and share it with an iSCSI
- Export NFS Volume and set export parameters
- Mount NFS and iSCSI storage
So first we need to turn on the iSCSI and NFS services. NFS is just to start a service, iSCSI has a bit more to it.
svcadm enable -r iscsi/target:default svcadm enable network/nfs/status
Now we create the target with
You can check the status with
Create the volume and the NFS folder (I will create a small 2GB Volume) and then query for status
zfs create -V 2G disk1/iscsi_1 zfs create disk1/nfs_1
Here you can see disk1 is 5GB (USED+AVAIL), disk1/iscsi_1 is 2GB is size (thin provisioned) and the disk1/nfs_1 has 3GB space left in total
Now we create the iSCSI LUN with
sbdadm create-lu /dev/zvol/rdsk/disk1/iscsi_1
and add it to the masking of the iSCSI initiator with the GUID that was just created
stmfadm add-view 600144f0ccf40a0000004fb114700002
Just to check that all is set correctly list the LUNs
List the masking
stmfadm list-view -l 600144F0CCF40A0000004FB114700002
One last thin left to do is to set the NFS export permissions with the following (you will need either the FQDN of the host or the correct IP for the export permissions)
zfs set sharenfs=on disk1/nfs_1 zfs set sharenfs=root=msaidelk-esx.maishsk.local disk1/nfs_1 zfs get mountpoint,sharenfs disk1/nfs_1
And that is it – the storage configuration is complete.
Now we go over to the ESX and mount the storage.
First the iSCSI volume
After a rescan of the adapter I now have a new 2GB LUN
On to NFS.
We now have a new NFS storage mount
There you have it a fully working storage appliance on OpenIndiana.
In Part 4 I will show some performance statistics I am getting out of this VM.