[[email protected] ~]# targetcli
targetcli shell version 2.1.fb46
Copyright 2011-2013 by Datera, Inc and others.
For help on commands, type ‘help‘.
/> ls
o- / .................................................................................................................... [...] o- backstores ......................................................................................................... [...] | o- block ............................................................................................. [Storage Objects: 0] | o- fileio ............................................................................................ [Storage Objects: 0] | o- pscsi ............................................................................................. [Storage Objects: 0] | o- ramdisk ........................................................................................... [Storage Objects: 0] o- iscsi ....................................................................................................... [Targets: 0] o- loopback .................................................................................................... [Targets: 0]
/> /backstores/block create mydisk1 /dev/sdb1
Created block storage object mydisk1 using /dev/sdb1.
/> /iscsi create iqn.2017-10.com.rusky:rhel1ShareDisk1
Created target iqn.2017-10.com.rusky:rhel1sharedisk1.
Created TPG 1.
Global pref auto_add_default_portal=true
Created default portal listening on all IPs (0.0.0.0), port 3260.
/> iscsi/iqn.2017-10.com.rusky:rhel1sharedisk1/tpg1/acls create iqn.2017-10.com.rusky:rhel2
Created Node ACL for iqn.2017-10.com.rusky:rhel2
/> iscsi/iqn.2017-10.com.rusky:rhel1sharedisk1/tpg1/acls create iqn.2017-10.com.rusky:rhel3
Created Node ACL for iqn.2017-10.com.rusky:rhel3
/> iscsi/iqn.2017-10.com.rusky:rhel1sharedisk1/tpg1/luns create /backstores/block/mydisk1
Created LUN 0.
Created LUN 0->0 mapping in node ACL iqn.2017-10.com.rusky:rhel3
Created LUN 0->0 mapping in node ACL iqn.2017-10.com.rusky:rhel2
/> iscsi/iqn.2017-10.com.rusky:rhel1sharedisk1/tpg1/portals create 192.168.100.1 3260
Using default IP port 3260
Could not create NetworkPortal in configFS
/> iscsi/iqn.2017-10.com.rusky:rhel1sharedisk1/tpg1/portals create 192.168.100.1 3260
Using default IP port 3260
Could not create NetworkPortal in configFS
/> iscsi/iqn.2017-10.com.rusky:rhel1sharedisk1/tpg1/portals create 192.168.100.1 3260
Using default IP port 3260
Created network portal 192.168.100.1:3260.
/> saveconfig
Last 10 configs saved in /etc/target/backup.
Configuration saved to /etc/target/saveconfig.json
/> exit
Global pref auto_save_on_exit=true
Last 10 configs saved in /etc/target/backup.
Configuration saved to /etc/target/saveconfig.json
[[email protected] ~]# systemctl restart target.service
[[email protected] ~]# systemctl enable target.service
Created symlink from /etc/systemd/system/multi-user.target.wants/target.service to /usr/lib/systemd/system/target.service.
[[email protected] ~]# targetcli
targetcli shell version 2.1.fb46
Copyright 2011-2013 by Datera, Inc and others.
For help on commands, type ‘help‘.