Home Linux & Systems Cybersecurity Cloud & DevOps Networks & Infrastructure SIEM & Monitoring DFIR & Threat Intel Development & Other All categories Projects About Tools

Installation and configuration of ISCSI DM-Multipath in GNU/linux

Leer en espanol
Installation and configuration of ISCSI DM-Multipath in GNU/linux

Table of contents

iSCSI (Internet SCSI) is a standard that allows the use of the SCSI protocol over TCP/IP networks. iSCSI is a transport layer protocol defined in the specifications ===

What is iSCSI?

iSCSI (Abbreviation for SCSI Internet) es un estándar que permite el uso del protocol SCSI about networksTCP/IP. iSCSI is a transport layer protocol defined in the SCSI-3 specifications. Other protocols at the transport layer are SCSI Parallel Interface and fiber channel.

The adoption of iSCSI in corporate production environments has currently accelerated thanks to the increase in Gigabit Ethernet. The manufacturing of iSCSI-based storage (storage area network) is less expensive and is proving to be an alternative to Fiber Channel-based SAN solutions.

What is Multipathing?

Multipathing is the use of storage network components responsible for the data transfer process between the server and storage. These components include cables, adapters, and the switches and software that enables this feature.  This also allows access to a series of resources simultaneously; for certain types of devices such as iSCSI, activation of this access mode is necessary.
Multi-path is a widely used technique for connecting a server to a storage device with two connections instead of one. This provides an alternative connection path in case of failure, thus allowing greater storage availability in the event of a failure and an alternative access to it. It also provides up to twice as much data in high-access environments and offers load-balancing capability to maximize the use of each of your assigned paths.

We install the necessary software

Redhat or derivatives:

Bash
yum -y install iscsi-initiator-utils device-mapper-multipath

Debian or derivatives:

text
aptitude install open-iscsi multipath-tools

We set node.startup in automatic mode

Bash
vi /etc/iscsi/iscsid.conf
[…]

node.startup = automatic

[…]

We add the multipathd configuration

Bash
cat /etc/multipath.conf

defaults {

user_friendly_names yes

path_grouping_policy multibus

path_checker readsector0

failback immediate

}

We start the service and add it to boot

Redhat or derivatives:

Bash
service multipathd start

chkconfig multipathd on

service iscsi start

chkconfig iscsi on

Debian or derivatives:

sql
/etc/init.d/multipathd start

update.rc.d multipathd defaults

/etc/init.d/open-iscsi start

update.rc.d open-iscsi defaults

Using the iscsiadm command we use iSCSI discovery

text
iscsiadm -m discovery -t st -p 192.168.1.200

192.168.1.200,1 iqn.2013-07.com.purestorage:flasharray

10.17.24.1:3260,1 iqn.2013-07.com.purestorage:flasharray

10.17.20.2:3260,1 iqn.2013-07.com.purestorage:flasharray

10.17.24.2:3260,1 iqn.2013-07.com.purestorage:flasharray

10.17.24.3:3260,1 iqn.2013-07.com.purestorage:flasharray

10.17.20.3:3260,1 iqn.2013-07.com.purestorage:flasharray

10.17.24.4:3260,1 iqn.2013-07.com.purestorage:flasharray

10.17.20.4:3260,1 iqn.2013-07.com.purestorage:flasharray

We make the connection

text
iscsiadm -m node -L automatic

We rescan

text
iscsiadm -m session –rescan

We restart the iscsi service

Redhat or derivatives:

Bash
service iscsi restart

Debian or derivatives:

text
/etc/init.d/open-iscsi start

We check the multipath

text
multipath -ll

mpatha (3624a93708731da97f48571620001105a) dm-6 PURE ,FlashArray

size=232G features=’0′ hwhandler=’0′ wp=rw

`-+- policy=’service-time 0′ prio=1 status=active

|- 3:0:0:10 sdb 8:16 active ready running

|- 4:0:0:10 sdc 8:32 active ready running

|- 5:0:0:10 sdd 8:48 active ready running

|- 6:0:0:10 sde 8:64 active ready running

|- 7:0:0:10 sdf 8:80 active ready running

|- 10:0:0:10 sdh 8:112 active ready running

|- 8:0:0:10 sdg 8:96 active ready running

`- 9:0:0:10 sdi 8:128 active ready running

We create the volume

text
pvcreate /dev/mapper/mpatha

vgcreate vg_datos /dev/mapper/mpatha

lvcreate -l+100%FREE -n lv_datos vg_datos

We format the volume

text
mkfs.ext4 /dev/mapper/vg_datos-lv_datos

We add to /etc/fstab the disk

text
/dev/mapper/vg_datos-lv_datos /datos ext4 defaults 0 0

All the best.

:wq!

Comments