ISCSI sharing

From V5wiki

Jump to: navigation, search

Источники:

http://www.itzgeek.com/how-tos/linux/centos-how-tos/configure-iscsi-target-initiator-on-centos-7-rhel7.html

https://www.hiroom2.com/2017/07/12/centos-7-scsi-target-utils-en/

ПОдготовка дисков:

[root@server ~]#pvcreate /dev/sdb

[root@server ~]#vgcreate share /dev/sdb

Создали группу "share"

[root@server ~]#lvcreate -n disk1 -L10G share

[root@server ~]#lvcreate -n disk2 -L10G share

Устанавливаем targetcli


[root@server ~]#sudo su

[root@server ~]# yum install targetcli -y

[root@server ~]#targetcli

[root@server ~]# /> cd backstores/block

[root@server ~]# /backstores/block> create proxmox_disk1 /dev/share/disk1

[root@server ~]# /backstores/block> create proxmox_disk2 /dev/share/disk2

[root@server ~]# cd /iscsi

[root@server ~]# /iscsi> create iqn.2017-11.local.vepp4.iscsi-server:disk1

[root@server ~]# /iscsi> create iqn.2017-11.local.vepp4.iscsi-server:disk2

[root@server ~]# cd /iscsi/iqn.2017-11.local.vepp4.iscsi-server:disk1/tpg1/acls

[root@server ~]# /iscsi/iqn.20...sk1/tpg1/acls> create iqn.2017-11.local.vepp4.iscsi-server:srv3.vepp4.local

[root@server ~]# /iscsi/iqn.20...sk1/tpg1/acls> cd iqn.2017-11.local.vepp4.iscsi-server:srv3.vepp4.local

[root@server ~]# /iscsi/iqn.20...3.vepp4.local> set auth userid=admin

[root@server ~]# /iscsi/iqn.20...3.vepp4.local> set auth password=****

[root@server ~]# /iscsi/iqn.20...3.vepp4.local> cd /iscsi/iqn.2017-11.local.vepp4.iscsi-server:disk1/tpg1/luns

[root@server ~]# /iscsi/iqn.20...sk1/tpg1/luns> create /backstores/block/proxmox_disk1

ТОже самое делается для второго диска

root@server ~]# systemctl enable target.service

[root@server ~]# systemctl restart target.service

[root@server ~]# firewall-cmd --permanent --add-port=3260/tcp

[root@server ~]# firewall-cmd --reload


для отключения аутентификации

/iscsi/iqn.20...:target1/tpg1> set attribute authentication=0

/iscsi/iqn.20...:target1/tpg1> set attribute generate_node_acls=1

/iscsi/iqn.20...:target1/tpg1> set attribute demo_mode_write_protect=0

Personal tools