# yum -y install targetcli # systemctl enable target.service # systemctl start target.service
# targetcli ls / # targetcli /backstores/block create name=lun0 dev=/dev/vgdata00/lvdata00 # targetcli /iscsi create iqn.2016-12.com.example:host01 # targetcli /iscsi/iqn.2016-12.com.example:host01/tpg1/luns create /backstores/block/lun0 # cat /etc/iscsi/initiatorname.iscsi # targetcli /iscsi/iqn.2016-12.com.example:host01/tpg1/acls create iqn.1994-05.com.redhat:0fa619ccaea # targetcli ls / # targetcli saveconfig
# yum install iscsi-initiator-utils # systemctl enable iscsid.service # systemctl start iscsid.service
# iscsiadm -m discovery -t st -p xxx.xxx.xxx.xxx:3260 # lsblk -S <- check LUN
# iscsiadm -m node <- Check IQN # iscsiadm -m node -T iqn.2016-12.com.example:host01 -p xxx.xxx.xxx.xxx --logout