1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
| [root@node205]# yum install -y targetcli
[root@node205]# systemctl enable --now target
[root@node205 yum.repos.d]# targetcli Warning: Could not load preferences file /root/.targetcli/prefs.bin. targetcli shell version 2.1.54 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] o- vhost ............................................................................................................ [Targets: 0] o- xen-pvscsi ....................................................................................................... [Targets: 0] /> cd backstores/ /> backstores/block create /> cd backstores/ramdisk /backstores/ramdisk> create name=rd1 size=10G Created ramdisk rd1 with size 10G. /backstores/ramdisk> cd / /> cd iscsi /iscsi> create iqn.2025-09.com.example:ram.target Created target iqn.2025-09.com.example:ram.target. Created TPG 1. Global pref auto_add_default_portal=true Created default portal listening on all IPs (0.0.0.0), port 3260. /iscsi> ls o- iscsi .............................................................................................................. [Targets: 1] o- iqn.2025-09.com.example:ram.target .................................................................................. [TPGs: 1] o- tpg1 ................................................................................................. [no-gen-acls, no-auth] o- acls ............................................................................................................ [ACLs: 0] o- luns ............................................................................................................ [LUNs: 0] o- portals ...................................................................................................... [Portals: 1] o- 0.0.0.0:3260 ....................................................................................................... [OK] /iscsi> cd / /> ls o- / ......................................................................................................................... [...] o- backstores .............................................................................................................. [...] | o- block .................................................................................................. [Storage Objects: 0] | o- fileio ................................................................................................. [Storage Objects: 0] | o- pscsi .................................................................................................. [Storage Objects: 0] | o- ramdisk ................................................................................................ [Storage Objects: 1] | o- rd1 ............................................................................................... [(10.0GiB) deactivated] | o- alua ................................................................................................... [ALUA Groups: 1] | o- default_tg_pt_gp ....................................................................... [ALUA state: Active/optimized] o- iscsi ............................................................................................................ [Targets: 1] | o- iqn.2025-09.com.example:ram.target ................................................................................ [TPGs: 1] | o- tpg1 ............................................................................................... [no-gen-acls, no-auth] | o- acls .......................................................................................................... [ACLs: 0] | o- luns .......................................................................................................... [LUNs: 0] | o- portals .................................................................................................... [Portals: 1] | o- 0.0.0.0:3260 ..................................................................................................... [OK] o- loopback ......................................................................................................... [Targets: 0] o- vhost ............................................................................................................ [Targets: 0] o- xen-pvscsi ....................................................................................................... [Targets: 0] /> cd iscsi/iqn.2025-09.com.example:ram.target/tpg1/ iscsi/iqn.2025-09.com.example:ram.target/tpg1/acls/ iscsi/iqn.2025-09.com.example:ram.target/tpg1/luns/ iscsi/iqn.2025-09.com.example:ram.target/tpg1/portals/ /> cd iscsi/iqn.2025-09.com.example:ram.target/tpg1/luns /iscsi/iqn.20...get/tpg1/luns> create /backstores/ramdisk/rd1 Created LUN 0. /iscsi/iqn.20...get/tpg1/luns> cd /iscsi/iqn.2025-09.com.example:ram.target/tpg1/acls /iscsi/iqn.20...get/tpg1/acls> create iqn.2025-09.com.example:initiator01 Created Node ACL for iqn.2025-09.com.example:initiator01 Created mapped LUN 0. /iscsi/iqn.20...get/tpg1/acls> cd /iscsi/iqn.2025-09.com.example:ram.target/tpg1/portals/ /iscsi/iqn.20.../tpg1/portals> delete 0.0.0.0 ip_address= ip_port= /iscsi/iqn.20.../tpg1/portals> delete 0.0.0.0 3260 Deleted network portal 0.0.0.0:3260 /iscsi/iqn.20.../tpg1/portals> create 10.152.1.205 3260 Using default IP port 3260 Created network portal 10.152.1.205:3260. /iscsi/iqn.20.../tpg1/portals> cd / /> saveconfig 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
|