Saturday, 6 October 2018

Configuring Multipath for redhat (centos7-3.10.0-862.el7.x86_64) in simple straight forward steps for ISCSI LUN on ONTAP 9

Straight forward steps from installing multi-path module to configuring multipath.conf file as per NetApp ISCSI redhat recommendation:

[root@redhat ~]#  yum install device-mapper-multipath   [download the multipath module binary]
[root@redhat ~]# modprobe dm-multipath     [insert the module]
[root@redhat ~]# lsmod | grep dm_mod         [list the module to confirm]
dm_mod   123941  11 dm_multipath,dm_log,dm_mirror


One of the good feature of Linux is the ability to 'load' modules while the kernel is running: Each piece of code that can be added to the kernel at run-time is called a module. Each module is made up of object code that can be dynamically linked to the running kernel by the insmod (modprobe) program and can be unlinked by the rmmod program.

Next...
[root@redhat /]# mpathconf --enable --with_multipathd y

The command above will create the multipath.conf file, if it does not already exists.

Next...
Blacklist - Non-NetApp devices from multi-path probe:
If there are non-NetApp SCSI devices to exclude, enter the worldwide identifier (WWID) for the devices in the blacklist section of the multipath.conf file.

For example, if /dev/sda is the non-NetApp SCSI device that you want to exclude, you would enter the following:
[root@redhat /]# /lib/udev/scsi_id -gud /dev/sda
3600508e000000000753250f933cc4606 [Just an example, in your system it may be different, this you can copy and paste in the multipath.conf file:]

blacklist {
 wwid 3600508e000000000753250f933cc4606
 devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
 devnode "^hd[a-z]"
 devnode "^cciss.*"
}

Next...
[root@redhat /]# rdloaddriver=scsi_dh_alua
[root@redhat /]# service multipathd restart

[root@redhat /]# service multipathd restart [bounce it]
Redirecting to /bin/systemctl restart multipathd.service
[root@redhat /]# service multipathd status  [use status command to ensure it's up correctly]
Redirecting to /bin/systemctl status multipathd.service
● multipathd.service - Device-Mapper Multipath Device Controller
   Loaded: loaded (/usr/lib/systemd/system/multipathd.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2018-10-08 20:19:15 BST; 8s ago
  Process: 49811 ExecStart=/sbin/multipathd (code=exited, status=0/SUCCESS)
  Process: 49809 ExecStartPre=/sbin/multipath -A (code=exited, status=0/SUCCESS)
  Process: 49808 ExecStartPre=/sbin/modprobe dm-multipath (code=exited, status=0/SUCCESS)
 Main PID: 49814 (multipathd)
    Tasks: 6
   CGroup: /system.slice/multipathd.service
           └─49814 /sbin/multipathd

[root@redhat ~]# multipath -ll
3600a09807770457a795d4d4179475456 dm-2 NETAPP  ,LUN C-Mode   
size=2.0G features='4 queue_if_no_path pg_init_retries 50 retain_attached_hw_handle' hwhandler='1 alua' wp=rw
`-+- policy='service-time 0' prio=50 status=active
  |- 4:0:0:0 sdb 8:16 active ready running
  `- 3:0:0:0 sdc 8:32 active ready running
[root@redhat ~]#

Note: Make sure you have discovered & logged-into ISCSI target already, otherwise you will not see any output on 'multipath -ll' command. 2 Easy commands to do that are :

[root@redhat /]# iscsiadm -m discovery -t st -p 192.168.0.x:3260
[root@redhat /]# iscsiadm -m node -l

All done!!!


No comments:

Post a Comment