RPN-SAN : Linux + Open-iSCSI

All commands have to be done as root

Installation and configuration of Open-iSCSI

install open-iscsi (for example on Ubuntu or Debian)

  apt-get update && apt-get install -y open-iscsi

Edit your /etc/iscsi/iscsid.conf

  vi /etc/iscsi/iscsid.conf

and add the following configuration lines

 node.conn[0].timeo.noop_out_interval = 0
 node.conn[0].timeo.noop_out_timeout = 0
 node.session.timeo.replacement_timeout = 86400

This change is designed to prevent your file system becomes read-only if the connection is interrupted for more than two minutes (by default) between your server and the storage server

Adjust the setting to automatic re-connection of targets

 node.startup = automatic

You can also change these settings to take advantage of the data integrity check, if available:

 node.conn[0].iscsi.HeaderDigest = CRC32C,None
 node.conn[0].iscsi.DataDigest = CRC32C,None

Discovery and connection of targets

To get a list of available targets, you need to type

  iscsiadm -m discovery -t sendtargets -p SAN_SERVER

(the SAN_SERVER is indicated in your management console)

and it should show you something in the form

  X.X.X.X:3260,1 iqn.2013-01.net.online:XXXXXXXXXXX

You can then connect to the target by typing

  iscsiadm -m node -T iqn.2013-01.net.online:XXXXXXXXXXX --login

In the kernel logs (visible by typing dmesg) you can see the following lines

  scsi25 : iSCSI Initiator over TCP/IP
  scsi 25:0:0:0: Direct-Access     IET      VIRTUAL-DISK     0    PQ: 0 ANSI: 4
  sd 25:0:0:0: Attached scsi generic sg4 type 0
  sd 25:0:0:0: [sdd] 2147483648 512-byte logical blocks: (1.09 TB/1.00 TiB)
  sd 25:0:0:0: [sdd] Write Protect is off
  sd 25:0:0:0: [sdd] Mode Sense: 77 00 00 08
  sd 25:0:0:0: [sdd] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
   sdd: sdd1
  sd 25:0:0:0: [sdd] Attached SCSI disk

In this example the disk detected is “sdd”, available at /dev/sdd - Note: the assigned device may be different, depending on your configuration.

You can now use your SAN disk as any other disk

Important Recommendations for use

As seen before, the disk is available at /dev/sdd. It is not guaranteed that on the next reboot the same letter will be used for the device, especially if you add additional targets, or if your hardware configuration changes. It is therefore not recommended using the names /dev /sdX in your configuration files.

In case of the usage of LVM

LVM uses automatically the UUID to recognize the partitions it uses.

In the case of direct formatting of the device

(This method is not recommended because you can not add more RPN-SAN storage space)

If you format the device directly or a partition of it, you should mount it using the link created by the system in /dev/disk/by-uuid/ or the fstab notation UUID=XXX-XXX…

In the case of the direct use of the device

If your application does not support (unlike LVM) the auto detection of the partitions, that are associated with the UUID, it is recomended to use the link in /dev/disk/by-id/

This is the most stable way.