Saturday, May 16, 2015

How to Use Openfiler Linux as an iSCSI Target


Openfiler is an easy-to-configure Linux distribution as an iSCSI target but as its community is not active, it is not recommended to be used other than in lab environment. For production environments try other solutions like freeNAS.

1. installation is as easy as older versions of CentOS /RHEL as it uses Anaconda as its installer. After installation you may see such a page:



Which tells you you can access the web admin UI via system's IP address and port 446. 

2. Open a browser and enter https://<host ip>:446
The default username is openfiler and password is password.

3. After login, immediately go to Accounts > Admin Password and change the default password. 

4. Go to Services and enable and run the iSCSI service. 



5. We are reserve and use the 2nd NIC with IP range of 172.16.X.X in an isolated network just for the purpose of storage so go to System > Network Setup and do the proper changes(if you haven't done in Anaconda)




6. Go to Volumes > Block Devices and create a partition on the 2nd hard drive by clicking on /dev/sdb
We assume that you have two physical hard drives, 1st drive is reserved for OS and the 2nd drive is for setting up iSCSI target. 
Click on create in order to create a partition on the drive:



7. The PV is now ready. You should create a VG and then create as many LV as you like inside the VG. 
Click on Volumes > Volume Groups, name your VG and check the /dev/sdb volume and click on Add volume group as the following screenshot:
8. We create LV by choosing Volumes > Add Volume fill the fields and click on Create



And do the same to create 2nd LV:





9. Add an iSCSI target by going to Volumes > iSCSI Targets. Then name your target IQN or accept the default name and click on Add. Then go to LUN Mapping on top and click on Map buttons for all LVs in order to map them as LUN 0 and LUN 1. You may face such a picture: 



10. Go to Network ACL on top to set Access Control List. You may see such a message: "A list of networks have not been created yet.You cannot configure network access control unless you create a list of networks in the Local Networks section. Until that time, this iSCSI target will be unavailable."
If you haven't configured ACL in Local Networks section, go ahead and configure:


Go back to Volumes > iSCSI Targets > Network ACL and change the value to allow then click on Update.

Your IP Storage is now ready to use.

Labels: , ,