Como Instalar e Configurar iSCSI Storage Server no CentOS 7

Fonte:
https://linuxhint.com/install_iscsi_storage_server_centos7/

Como cria o InitiatorName?

  1. Execute:
    echo "InitiatorName=`/sbin/iscsi-iname`" >/etc/iscsi/initiatorname.iscsi
    Arquivo /etc/iscsi/initiatorname.iscsi:
    InitiatorName=iqn.1988-12.com.oracle:da17ba9170ec
  2. Edite o arquivo /etc/iscsi/initiatorname.iscsi; altere 1988-12.com.oracle para AAAA-MM.FQDN, onde:
  3. Pare e inicie os serviços iscsi e iscsid:
    service iscsi stop
    service iscsid stop
    service iscsid start
    service iscsi start
InitiatorName deve ser único por servidor.

No servidor iscsi, arquivo /etc/iscsi/initiatorname.iscsi:
InitiatorName=iqn.2021-02.iscsi.curingapneus.intranet:da17ba9170ec

No servidor dbrac1, arquivo /etc/iscsi/initiatorname.iscsi:
InitiatorName=iqn.2021-02.dbrac1.curingapneus.intranet:8d8e948ae76

No servidor dbrac2, arquivo /etc/iscsi/initiatorname.iscsi:
InitiatorName=iqn.2021-02.dbrac2.curingapneus.intranet:ec443426a9c

No servidor iscsi:
root_iscsi:/root> systemctl enable target
root_iscsi:/root> systemctl start target
root_iscsi:/root> targetcli
...
/backstores/block> /
/> backstores/block create asm /dev/iscsi/asm
Created block storage object asm using /dev/iscsi/asm.
/> backstores/block create dados /dev/iscsi/dados
Created block storage object dados using /dev/iscsi/dados.
/> backstores/block create sys /dev/iscsi/sys
Created block storage object sys using /dev/iscsi/sys.
/> iscsi/ create iqn.2021-02.iscsi.curingapneus.intranet:da17ba9170e
Created target iqn.2021-02.iscsi.curingapneus.intranet:da17ba9170e.
Created TPG 1.
Global pref auto_add_default_portal=true
Created default portal listening on all IPs (0.0.0.0), port 3260.
/> cd iscsi/iqn.2021-02.iscsi.curingapneus.intranet:da17ba9170e/tpg1
/iscsi/iqn.20...7ba9170e/tpg1> luns/ create /backstores/block/asm
Created LUN 0.
/iscsi/iqn.20...7ba9170e/tpg1> luns/ create /backstores/block/dados
Created LUN 1.
/iscsi/iqn.20...7ba9170e/tpg1> luns/ create /backstores/block/sys
Created LUN 2.
/iscsi/iqn.20...7ba9170e/tpg1> acls/ create iqn.2021-02.dbrac1.curingapneus.intranet:8d8e948ae76
Created Node ACL for iqn.2021-02.iscsi.curingapneus.intranet:da17ba9170e
Created mapped LUN 2.
Created mapped LUN 1.
Created mapped LUN 0.
/iscsi/iqn.20...7ba9170e/tpg1> set attribute demo_mode_write_protect=0
Parameter demo_mode_write_protect is now '0'.
/iscsi/iqn.20...7ba9170e/tpg1> acls/ create iqn.2021-02.dbrac2.curingapneus.intranet:ec443426a9c
Created Node ACL for iqn.2021-02.iscsi.curingapneus.intranet:da17ba9170e
Created mapped LUN 2.
Created mapped LUN 1.
Created mapped LUN 0.
/iscsi/iqn.20...7ba9170e/tpg1> set attribute demo_mode_write_protect=0
Parameter demo_mode_write_protect is now '0'.
/iscsi/iqn.20...7ba9170e/tpg1> 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

IP
35.172.217.174