СХД: различия между версиями

Материал из ALT Linux Wiki
Нет описания правки
Нет описания правки
 
(не показаны 2 промежуточные версии 1 участника)
Строка 1: Строка 1:
[[Категория:Использование оборудования]]
[[Категория:Использование оборудования]]
<pre>
# apt-get install kernel-modules-zfs-std-def kernel-modules-qla2x00t-std-def kernel-modules-iscsi_scst-std-def zfs-utils iscsi-scst
# systemctl enable zfs.target
</pre>
<pre>
# echo "options scst scst_max_dev_cmd_mem=2048 scst_max_cmd_mem=4096" > /etc/modprobe.d/scst.conf
# echo "blacklist qla2xxx" > /etc/modprobe.d/blacklist-qla2xxx.conf
# modprobe -a scst_vdisk iscsi_scst
</pre>
<pre>
# modprobe zfs
# zpool create ZALT /dev/sdb1 /dev/sdc1
# zfs create -V 32G ZALT/pve04
</pre>
<pre>
HANDLER vdisk_blockio {
        DEVICE pve04-disk {
                filename /dev/zvol/ZALT/pve04
        }
}
TARGET_DRIVER iscsi {
        enabled 1
        TARGET iqn.2016-10.ru.basealt.office:pve04-disk {
                enabled 1
                GROUP PVE04 {
                        LUN 0 pve04-disk
                        INITIATOR iqn.2016-10.ru.basealt.office.pve04:01:289e86f45e5f
                }
        }
}
</pre>
<pre>
<pre>
# rmmod qla2xxx
# targetcli
# modprbe -a qla2xxx_scst qla2x00tgt
Warning: Could not load preferences file /root/.targetcli/prefs.bin.
# cat /sys/class/scsi_host/host*/device/fc_host/host*/port_name
targetcli shell version 2.1.fb35
</pre>
Copyright 2011-2013 by Datera, Inc and others.
For help on commands, type 'help'.


<pre>
/> qla2xxx/ info
HANDLER vdisk_blockio {
Fabric module name: qla2xxx
        DEVICE pve04-disk {
ConfigFS path: /sys/kernel/config/target/qla2xxx
                filename /dev/zvol/ZALT/pve04
Allowed WWN types: naa
        }
Allowed WWNs list: naa.5001438004c39414, naa.5001438004c39416
}
Fabric module features: acls
 
Corresponding kernel module: tcm_qla2xxx
TARGET_DRIVER qla2x00t {
/> ls
        TARGET 21:00:00:e0:8b:81:65:de {
o- / ......................................................................................................................... [...]
                HW_TARGET
  o- backstores .............................................................................................................. [...]
 
  | o- block .................................................................................................. [Storage Objects: 0]
                enabled 1
  | o- fileio ................................................................................................. [Storage Objects: 0]
 
  | o- pscsi .................................................................................................. [Storage Objects: 0]
                GROUP PVE04 {
  | o- ramdisk ................................................................................................ [Storage Objects: 0]
                        LUN 0 pve04-disk
  o- iscsi ............................................................................................................ [Targets: 0]
                        INITIATOR 21:00:00:e0:8b:81:9a:e2
  o- loopback ......................................................................................................... [Targets: 0]
                }
  o- qla2xxx .......................................................................................................... [Targets: 0]
        }
  o- vhost ............................................................................................................ [Targets: 0]
 
/> qla2xxx/ create naa.5001438004c39416
        TARGET 21:00:00:e0:8b:81:ff:e3 {
Created target naa.5001438004c39416.
                HW_TARGET
/> ls
 
o- / ......................................................................................................................... [...]
                enabled 1
  o- backstores .............................................................................................................. [...]
 
  | o- block .................................................................................................. [Storage Objects: 0]
                GROUP PVE04 {
  | o- fileio ................................................................................................. [Storage Objects: 0]
                        LUN 0 pve04-disk
  | o- pscsi .................................................................................................. [Storage Objects: 0]
                        INITIATOR 21:00:00:e0:8b:81:ee:db
  | o- ramdisk ................................................................................................ [Storage Objects: 0]
                }
  o- iscsi ............................................................................................................ [Targets: 0]
        }
  o- loopback ......................................................................................................... [Targets: 0]
}
  o- qla2xxx .......................................................................................................... [Targets: 1]
</pre>
  | o- naa.5001438004c39416 ............................................................................................. [gen-acls]
 
  |  o- acls ............................................................................................................ [ACLs: 0]
<pre>
  |  o- luns ............................................................................................................ [LUNs: 0]
HANDLER vdisk_blockio {
  o- vhost ............................................................................................................ [Targets: 0]
        DEVICE pve04-disk {
/> qla2xxx/ create naa.5001438004c39414
                filename /dev/zvol/ZALT/pve04
Created target naa.5001438004c39414.
        }
/>
}
 
TARGET_DRIVER iscsi {
        enabled 1
 
        TARGET iqn.2016-10.ru.basealt.office:pve04-disk {
                enabled 1
 
                GROUP PVE04 {
                        LUN 0 pve04-disk
                        INITIATOR iqn.2016-10.ru.basealt.office.pve04:01:289e86f45e5f
                }
        }
}
 
TARGET_DRIVER qla2x00t {
        TARGET 21:00:00:e0:8b:81:65:de {
                HW_TARGET
 
                enabled 1
 
                GROUP PVE04 {
                        LUN 0 pve04-disk
                        INITIATOR 21:00:00:e0:8b:81:9a:e2
                }
        }
 
        TARGET 21:00:00:e0:8b:81:ff:e3 {
                HW_TARGET
 
                enabled 1
 
                GROUP PVE04 {
                        LUN 0 pve04-disk
                        INITIATOR 21:00:00:e0:8b:81:ee:db
                }
        }
}
</pre>
 
<pre>
# zfs create -V 32G ZALT/pve03
# scstadmin -open_dev pve03-disk -handler vdisk_blockio -attributes filename=/dev/zvol/ZALT/pve03
# scstadmin -add_target iqn.2016-10.ru.basealt.office:pve03-disk -driver iscsi
# scstadmin -add_group PVE03 -driver iscsi -target iqn.2016-10.ru.basealt.office:pve03-disk
# scstadmin -add_lun 0 -driver iscsi -target iqn.2016-10.ru.basealt.office:pve03-disk -group PVE03 -device pve03-disk
# scstadmin -add_init iqn.2016-10.ru.basealt.office.pve03:01::249ddda522 -driver iscsi -target iqn.2016-10.ru.basealt.office:pve03-disk -group PVE03
# scstadmin -enable_target iqn.2016-10.ru.basealt.office:pve03-disk -driver iscsi
</pre>
 
<pre>
# zfs create -V 20G ZALT/pve04-disk-1
# scstadmin -open_dev pve04-disk-1 -handler vdisk_blockio -attributes filename=/dev/zvol/ZALT/pve04-disk-1
# scstadmin -add_lun 1 -driver qla2x00t -target 21:00:00:e0:8b:81:fd:df  -group PVE04 -device pve04-disk-1
# scstadmin -add_lun 1 -driver qla2x00t -target 21:00:00:e0:8b:81:52:e4 -group PVE04 -device pve04-disk-1
# scstadmin -write_config /etc/scst.conf
</pre>


<pre>
<pre>
Строка 144: Строка 49:
</pre>
</pre>


Linux SCSI Target [http://linux-iscsi.org/wiki/Main_Page]
SCST [http://scst.sourceforge.net/]
SCST [http://scst.sourceforge.net/]
HOWTO [http://scst.sourceforge.net/SCST_Gentoo_HOWTO.txt]
HOWTO [http://scst.sourceforge.net/SCST_Gentoo_HOWTO.txt]

Текущая версия от 15:38, 22 ноября 2016

# targetcli
Warning: Could not load preferences file /root/.targetcli/prefs.bin.
targetcli shell version 2.1.fb35
Copyright 2011-2013 by Datera, Inc and others.
For help on commands, type 'help'.

/> qla2xxx/ info
Fabric module name: qla2xxx
ConfigFS path: /sys/kernel/config/target/qla2xxx
Allowed WWN types: naa
Allowed WWNs list: naa.5001438004c39414, naa.5001438004c39416
Fabric module features: acls
Corresponding kernel module: tcm_qla2xxx
/> 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- qla2xxx .......................................................................................................... [Targets: 0]
  o- vhost ............................................................................................................ [Targets: 0]
/> qla2xxx/ create naa.5001438004c39416
Created target naa.5001438004c39416.
/> 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- qla2xxx .......................................................................................................... [Targets: 1]
  | o- naa.5001438004c39416 ............................................................................................. [gen-acls]
  |   o- acls ............................................................................................................ [ACLs: 0]
  |   o- luns ............................................................................................................ [LUNs: 0]
  o- vhost ............................................................................................................ [Targets: 0]
/> qla2xxx/ create naa.5001438004c39414
Created target naa.5001438004c39414.
/>

<pre>
# echo "- - -" > /sys/class/scsi_host/host*/scan

Linux SCSI Target [1] SCST [2] HOWTO [3]