iSCSI Target Configuration in Centos/Rhel 7.x

iSCSI Target Configuration in Centos/Rhel 7.x

Install the following packages for iSCSI Target :
#yum install -y targetcli
Enable the iSCSI server for booting :
#systemctl enable target
Execute the targetcli command :
#targetcli
You can create a fileio backstore shareddata :
/> backstores/fileio/ create shared /iscsi/disk.img 512M
You can create a block backstore :
/> backstores/block/ create block1 /dev/vg_1/lv_1
Now create an IQN called iqn.2015-26.com.example with target named iSCSI_TARGET :
/> iscsi/ create iqn.2015-26.com.example:iSCSI_TARGET
Then we can go to the newly created directory :
/> cd iscsi/iqn.2015-26.com.example:iSCSI_TARGET/tpg1/
Create an ACL rule :
/> cd iscsi/iqn.2015-26.com.example:iSCSI_TARGET/tpg1/acl
/> create iqn.2015-26.com.example:iSCSI_client
Create an lun for Fileio backstore :
/> cd iscsi/iqn.2015-26.com.example:iSCSI_TARGET/tpg1/luns
/> create /backstores/fileio/shared
Create an lun for Block backstore :
/> create /backstores/block/block1
Create an portal :
/> cd iscsi/iqn.2015-26.com.example:iSCSI_TARGET/tpg1/portal
/> create 192.168.1.3
Now exit in the iSCSI target :
/> exit
ADD the 3260 tcp port in the firewall configuration :
# firewall-cmd --permanent --add-port=3260/tcp
# firewall-cmd --permanent --reload
Now restart the target service :
#systemctl restart target

 

Leave a Reply

Your email address will not be published. Required fields are marked *