Saturday, June 22, 2019

Configure Multipath in linux

[root@server scsi_host]# iscsiadm -m discovery -t st -p  192.168.150.1
Starting iscsid:                                           [  OK  ]
192.168.150.1:3260,-1 iqn.2008-08.com.starwindsoftware:192.168.150.1-linuxstoragepool
[root@server scsi_host]# iscsiadm -m discovery -t st -p  192.168.150.1,3260
192.168.150.1:3260,-1 iqn.2008-08.com.starwindsoftware:192.168.150.1-linuxstoragepool
[root@server scsi_host]# iscsiadm -m node -L all
Logging in to [iface: default, target: iqn.2008-08.com.starwindsoftware:192.168.150.1-linuxstoragepool, portal: 192.168.150.1,3260] (multiple)
Login to [iface: default, target: iqn.2008-08.com.starwindsoftware:192.168.150.1-linuxstoragepool, portal: 192.168.150.1,3260] successful.

[root@server scsi_host]# multipath -ll
mpatha (2628fb3127e8f77f6) dm-3 ROCKET,IMAGEFILE
size=5.0G features='0' hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
  `- 3:0:0:0 sde 8:64 active ready running

 
 =================================================================
  Now configure 2nd network path for storage disks.
 =================================================================
[root@server scsi_host]#  iscsiadm -m discovery -t st -p  192.168.159.1
192.168.159.1:3260,-1 iqn.2008-08.com.starwindsoftware:192.168.150.1-linuxstoragepool
192.168.159.1:3260,-1 iqn.2008-08.com.starwindsoftware:192.168.159.1-linuxstoragepool
[root@server scsi_host]#  iscsiadm -m discovery -t st -p  192.168.159.1,3260
192.168.159.1:3260,-1 iqn.2008-08.com.starwindsoftware:192.168.150.1-linuxstoragepool
192.168.159.1:3260,-1 iqn.2008-08.com.starwindsoftware:192.168.159.1-linuxstoragepool


[root@server multipath]#  iscsiadm -m node -L all
Logging in to [iface: default, target: iqn.2008-08.com.starwindsoftware:192.168.159.1-linuxstoragepool, portal: 192.168.159.1,3260] (multiple)
Logging in to [iface: default, target: iqn.2008-08.com.starwindsoftware:192.168.150.1-linuxstoragepool, portal: 192.168.159.1,3260] (multiple)
Login to [iface: default, target: iqn.2008-08.com.starwindsoftware:192.168.159.1-linuxstoragepool, portal: 192.168.159.1,3260] successful.
Login to [iface: default, target: iqn.2008-08.com.starwindsoftware:192.168.150.1-linuxstoragepool, portal: 192.168.159.1,3260] successful.

==============================================================
Now in following output you can see boths disks are showing 2 paths for eachs disk
==============================================================
[root@server multipath]# multipath -ll
mpathb (26eb538fc86227b31) dm-4 ROCKET,IMAGEFILE
size=50G features='0' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=1 status=enabled
| `- 3:0:0:1 sdf 8:80  active ready running
`-+- policy='round-robin 0' prio=1 status=active
  `- 5:0:0:1 sdh 8:112 active ready running
mpatha (2628fb3127e8f77f6) dm-3 ROCKET,IMAGEFILE
size=5.0G features='0' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=1 status=enabled
| `- 3:0:0:0 sde 8:64  active ready running
`-+- policy='round-robin 0' prio=1 status=active
  `- 5:0:0:0 sdg 8:96  active ready running
[root@server multipath]#
[root@server multipath]#
[root@server multipath]#

====================================================================
Now lets try to disable one path and we should see active faulty running in multipath -ll output
====================================================================
 [root@server ~]# multipath -ll

mpathb (26eb538fc86227b31) dm-4 ROCKET,IMAGEFILE
size=50G features='0' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=0 status=enabled
| `- 3:0:0:1 sdf 8:80  active faulty running      <============ See we have one path faulty for  mpathb disk
`-+- policy='round-robin 0' prio=1 status=active
  `- 5:0:0:1 sdh 8:112 active ready running
mpatha (2628fb3127e8f77f6) dm-3 ROCKET,IMAGEFILE
size=5.0G features='0' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=0 status=enabled
| `- 3:0:0:0 sde 8:64  active faulty running
`-+- policy='round-robin 0' prio=1 status=active
  `- 5:0:0:0 sdg 8:96  active ready running

 ============================ ===========================
Now enable vmnet virtaul adapter and path should be recover by its own
=========================== ============================  
  [root@server ~]# multipath -ll
mpathb (26eb538fc86227b31) dm-4 ROCKET,IMAGEFILE
size=50G features='0' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=1 status=enabled
| `- 3:0:0:1 sdf 8:80  active ready running
`-+- policy='round-robin 0' prio=1 status=active
  `- 5:0:0:1 sdh 8:112 active ready running
mpatha (2628fb3127e8f77f6) dm-3 ROCKET,IMAGEFILE
size=5.0G features='0' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=1 status=enabled
| `- 3:0:0:0 sde 8:64  active ready running
`-+- policy='round-robin 0' prio=1 status=active
  `- 5:0:0:0 sdg 8:96  active ready running

No comments:

Post a Comment

kubernetes Pod Scheduling

 ===================   Deployment ================= 1.) Deployment without any nodeName or nodeSelector, pod will spread among all of the av...