August 2, 2014(888) 750-3907info@perftuning.comOracle Performance Tuning and Microsoft SQL Server Performance Tuning Experts!

iSCSI Setup on OEL6

Home / Ed Whalen / iSCSI Setup on OEL6

Recently I had to set up iSCSI on an OEL 6.4 system.  This is a fairly straight-forward process.  It does take a little bit of effort, but it can be done fairly quickly and efficiently.  The basic process is to follow these steps:

  1. Install packages.
  2. Configure iSCSI

Install packages

There are two packages that need to be installed.  Use Yum to install the iscsi-initiator-utils and device-mapper-multipath packages (multipath is recommended but not required).

# yum install iscsi-initiator-utils

# yum install device-mapper-multipath

Enable iSCSI

The ckconfig on enables systems services to run by default when the system reboots.  In order to see what is configured to run (at what run-level) use chkconfig –list.  Use chkconfig <service> on to enable the iscsi services.  Use service <service> start to start that service.

[root@oracle1 ~]# chkconfig iscsi on

[root@oracle1 ~]# chkconfig iscsid on

[root@oracle1 ~]# service iscsi start

[root@oracle1 ~]# service iscsid start

Configure iSCSI

In order to start the configuration process you must first find the initiator name.  This is something that is set up internally, but is associated with the name of the server.  In this example, the name of the host is oracle1.  Thus the oracle designation in the iSCSI initiator name.

[root@oracle1 ~]# cat /etc/iscsi/initiatorname.iscsi

InitiatorName=iqn.1988-12.com.oracle:6660117bdfa8

Take note of the initiator name.  Using the iscsiadm command you can now broadcast the iSCSI initiator information to your iSCSI storage system.  In this case, I am using a Tegile Zebi storage system.  In the following example the iscsi storage system is on an internal network subnet 1.1.1.x.

[root@oracle1 ~]# iscsiadm -m discovery -t sendtargets -p 1.1.1.34

Starting iscsid:                                           [  OK  ]
1.1.1.34:3260,2 iqn.2013-09.com.tegile.iscsi:test

[root@oracle1 ~]# iscsiadm -m node -L automatic

Logging in to [iface: default, target: iqn.2013-09.com.tegile.iscsi:test, portal: 1.1.1.34,3260] (multiple)

Login to [iface: default, target: iqn.2013-09.com.tegile.iscsi:test, portal: 1.1.1.34,3260] successful.

Initiate the iSCSI session

[root@oracle1 ~]# iscsiadm -m session

tcp: [1] 1.1.1.34:3260,2 iqn.2013-09.com.tegile.iscsi:test

Configure Multipath

In order to have some High Availablity (HA) enable multipath.  This allows multiple paths to storage to act as one.  Do this via first running the /sbin/mpathconf program to validate the system.

# /sbin/mpathconf

multipath is enabled

find_multipaths is disabled

user_friendly_names is enabled

dm_multipath module is loaded

multipathd is chkconfiged on

If you add more devices, after the original configuration you can always rescan the SCSI bus using the rescan-scsi-bus.sh script.

# rescan-scsi-bus.sh

Add new devices to multipath by running the multipath command.

# multipath

Sep 12 08:24:13 | mpatha: ignoring map

create: mpathf (3600144f0c42b4f0000005231be0c0005) undef TEGILE,ZEBI-ISCSI

size=5.0G features='0' hwhandler='0' wp=undef

`-+- policy='round-robin 0' prio=1 status=undef

`- 7:0:0:4 sdh 8:112 undef ready  running

create: mpathg (3600144f0c42b4f0000005231be280006) undef TEGILE,ZEBI-ISCSI

size=5.0G features='0' hwhandler='0' wp=undef

`-+- policy='round-robin 0' prio=1 status=undef

`- 7:0:0:5 sdi 8:128 undef ready  running

create: mpathh (3600144f0c42b4f0000005231be420007) undef TEGILE,ZEBI-ISCSI

size=5.0G features='0' hwhandler='0' wp=undef

`-+- policy='round-robin 0' prio=1 status=undef

`- 7:0:0:6 sdj 8:144 undef ready  running

create: mpathi (3600144f0c42b4f0000005231be570008) undef TEGILE,ZEBI-ISCSI

size=5.0G features='0' hwhandler='0' wp=undef

`-+- policy='round-robin 0' prio=1 status=undef

`- 7:0:0:7 sdk 8:160 undef ready  running

create: mpathj (3600144f0c42b4f0000005231be6c0009) undef TEGILE,ZEBI-ISCSI

size=5.0G features='0' hwhandler='0' wp=undef

`-+- policy='round-robin 0' prio=1 status=undef

`- 7:0:0:8 sdl 8:176 undef ready  running

create: mpathk (3600144f0c42b4f0000005231be81000a) undef TEGILE,ZEBI-ISCSI

size=5.0G features='0' hwhandler='0' wp=undef

`-+- policy='round-robin 0' prio=1 status=undef

`- 7:0:0:9 sdm 8:192 undef ready  running

Managing Multipath

Use multipath –l to list devices and validate that you have all of them.

# multipath -l

mpathe (3600144f0c42b4f000000523106d30004) dm-6 TEGILE,ZEBI-ISCSI

size=5.0G features='0' hwhandler='0' wp=rw

`-+- policy='round-robin 0' prio=0 status=active

`- 7:0:0:3 sdg 8:96  active undef  running

<lines removed>…..

Of course it is more efficient to set up a more friendly naming structure for your multipath devices.  This is easily accomplished by editing the /etc/multipath.conf file.  Under the mutipaths{} section add the following section for each iSCSI LUN.

multipath {

wwid    3600144f0c42b4f0000005231068f0001

alias   data01

}

The wwid can be found from the storage system or by running the multipath program as shown above.  Do this for each of the iSCSI devices.  This friendly name or alias will be the device seen in the /dev/mapper directory.

Running multipath –l will show the new device names.  Reloading the maps can be done with multipath –r if needed.

Note:  To change a multipath name or add a new path edit /etc/multipath.conf and run multipath –r.

Using Multipath Devices

The devices that should be used are the devices in /dev/mapper.  These devices are persistent and will not change even if more devices are added.  These devices can be used for ASM.  If you are using ASMLIB, change the ORACLEASM_SCANORDER="multipath" in /etc/sysconfig/oracleasm.

Note:  It is recommended to leave the ASM_DISKSTRING parameter set to the default (NULL) value when using multipath.

Summary

As you have seen here.  It is not very difficult to setup iSCSI and multipath under OEL 6.4.  Just follow a few simple steps and you are on your way.

Recommended Posts
Contact Us

In a hurry? You can send us an email and we'll get back to you, asap.