This Blog is to share our knowledge and expertise on Linux System Administration and VMware Administration

Showing posts with label DM Multipath. Show all posts
Showing posts with label DM Multipath. Show all posts

Monday, October 23, 2017

Multipath Queries & Multipath Command Options in Linux Server

Monday, October 23, 2017 0
You can use the -l and -ll options of the multipath command to display the current multipath configuration.

The -l option displays multipath topology gathered from information in sysfs and the device mapper.

The -ll option displays the information the -l displays in addition to all other available components of the system.

When displaying the multipath configuration, there are three verbosity levels you can specify with the -v option of the multipath command. Specifying -v0 yields no output. Specifying -v1 outputs the created or updated multipath names only, which you can then feed to other tools such as kpartx. Specifying -v2 prints all detected paths, multipaths, and device maps.

The following example shows the output of a multipath -l command.

# multipath -l

3600d0230000000000e13955cc3757800 dm-1 WINSYS,SF2372
size=269G features='0' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=1 status=active
| `- 6:0:0:0 sdb 8:16  active ready  running
`-+- policy='round-robin 0' prio=1 status=enabled
  `- 7:0:0:0 sdf 8:80  active ready  running

The following example shows the output of a multipath -ll command.

# multipath -ll

3600d0230000000000e13955cc3757801 dm-10 WINSYS,SF2372
size=269G features='0' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=1 status=enabled
| `- 19:0:0:1 sdc 8:32  active ready  running
`-+- policy='round-robin 0' prio=1 status=enabled
  `- 18:0:0:1 sdh 8:112 active ready  running
3600d0230000000000e13955cc3757803 dm-2 WINSYS,SF2372
size=125G features='0' hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
  |- 19:0:0:3 sde 8:64  active ready  running
  `- 18:0:0:3 sdj 8:144 active ready  running

Useful multipath Command Options

Option                Description
-l                    Display the current multipath configuration gathered from sysfs and the   device mapper.
-ll                   Display the current multipath configuration gathered from sysfs, the device mapper, and all other available components on the system.
-f device         Remove the named multipath device.
-F                   Remove all unused multipath devices.
-w device        Red Hat Enterprise Linux 6.6 and later) Remove the wwid of the specified device from the wwids file.
-W                  Red Hat Enterprise Linux 6.6 and later) Reset the wwids file to include only the current multipath devices.

Friday, October 20, 2017

How to solve the issue with Large Number of LUNs in Linux server?

Friday, October 20, 2017 0
When a large number of LUNs are added to a node, using multipathed devices can significantly increase the time it  takes for the udev device manager to create device nodes for them. If you experience this problem, you can correct  it by deleting the following line in /etc/udev/rules.d/40-multipath.rules:

KERNEL!="dm-[0-9]*", ACTION=="add", PROGRAM=="/bin/bash -c '/sbin/lsmod | /bin/grep ^dm_multipath'", RUN+="/sbin/multipath -v0 %M:%m"


This line causes the udev device manager to run multipath every time a block device is added to the node. Even with this line removed, the multipathd daemon will still automatically create multipathed devices, and multipath will still be called during the boot process for nodes with multipathed root file systems. The only change is that multipathed devices will not be automatically created when the multipathd daemon is not running, which should not be a problem for the vast majority of multipath users.

Saturday, September 16, 2017

What are the mode, we can configure for multipath?

Saturday, September 16, 2017 0

We have 2 types of mode we can configure the multipath.

Redundancy

DM-Multipath can provide failover in an active/passive configuration. In an active/passive configuration, only half the paths are used at any time for I/O. If any element of an I/O path (the cable, switch, or controller) fails, DM-Multipath switches to an alternate path.

Improved Performance

DM-Multipath can be configured in active/active mode, where I/O is spread over the paths in a round-robin fashion. In some configurations, DM-Multipath can detect loading on the I/O paths and dynamically re-balance the load.

Wednesday, June 15, 2016

Brief - multipath Command

Wednesday, June 15, 2016 0

Use the Linux multipath command to configure and manage multipathed devices.

General syntax for the multipath command:

multipath [-v verbosity] [-d] [-h|-l|-ll|-f|-F] [-p failover|multibus|group_by_serial|group_by_prio|group_by_node_name] 

Configure multipath devices

#multipath

Configure a specific multipath device

#multipath devicename

Replace devicename

 Replace devicename with the device node name such as /dev/sdb (as shown by udev in the $DEVNAME variable), or in the major:minor format.Selectively suppress a multipath map, and its device-mapped partitions:
#multipath -f

Display potential multipath devices

Display potential multipath devices, but do not create any devices and do not update device maps (dry run):
#multipath -d

Configure multipath devices and display multipath map information

#multipath -v2  
#multipath -v3

The -v2 option in multipath -v2 -d shows only local disks. Use the -v3 option to show the full path list.lliiFor example

#multipath -v3 -d

Display the status of all multipath devices, or a specified multipath device

#multipath -ll 
#multipath -ll 

Flush all unused multipath device maps 

Flush all unused multipath device maps (unresolves the multiple paths; it does not delete the device)

#multipath -F
#multipath -F  

Set the group policy

multipath -p [failover|multibus|group_by_serial|group_by_prio|group_by_node_name] 
Group Policy Options for the multipath -p Command

Policy Option             Description
failover                        One path per priority group. You can use only one path at a time.
multibus                       All paths in one priority group.
group_by_serial           One priority group per detected SCSI serial number 
group_by_prio              One priority group per path priority value. Paths with the same priority                          are in the same priority group. Priorities are determined by callout                                           programs specified as a global, per-controller, or per-multipath                                               option in  the /etc/multipath.conf configuration file.
group_by_node_          
name                           One priority group per target node name. Target node names are                                            fetched in the /sys/class/fc_transport/target*/node_name location.

Thursday, November 19, 2015

How to Ignore the Local Disks when Generating Multipath Devices in Linux Server

Thursday, November 19, 2015
Some machines have local SCSI cards for their internal disks. DM-Multipath is not recommended for these devices.

The following procedure shows how to modify the multipath  configuration file to ignore the local disks when configuring multipath.

1.  Determine which disks are the internal disks and mark them as the ones to blacklist.

In this example, /dev/sda is the internal disk. Note that as originally configured in the default multipath configuration file, executing the multipath -v2 shows the local disk, /dev/sda, in the multipath map.

[root@test ~]# multipath -v2
create: SIBM-ESXSST336732LC____F3ET0EP0Q000072428BX1
[size=33 GB][features="0"][hwhandler="0"]
\_ round-robin 0
  \_ 0:0:0:0 sda  8:0    [---------
device-mapper ioctl cmd 9 failed: Invalid argument
device-mapper ioctl cmd 14 failed: No such device or address
create: 3600a0b80001327d80000006d43621677
[size=12 GB][features="0"][hwhandler="0"]
\_ round-robin 0
  \_ 2:0:0:0 sdb  8:16  
  \_ 3:0:0:0 sdf  8:80  
create: 3600a0b80001327510000009a436215ec
[size=12 GB][features="0"][hwhandler="0"]
\_ round-robin 0
  \_ 2:0:0:1 sdc  8:32  
  \_ 3:0:0:1 sdg  8:96  
create: 3600a0b80001327d800000070436216b3
[size=12 GB][features="0"][hwhandler="0"]
\_ round-robin 0
  \_ 2:0:0:2 sdd  8:48  
  \_ 3:0:0:2 sdh  8:112 

2. In order to prevent the device mapper from mapping /dev/sda in its multipath maps, edit the blacklist section of the /etc/multipath.conf file to include this device. Although you could blacklist the sda device using a devnode type, that would not be safe procedure since /dev/sda is not guaranteed to be the same on reboot. To blacklist individual devices, you can blacklist using the WWID of that device.
ote that in the output to the multipath -v2 command, the WWID of the /dev/sda device is SIBM-ESXSST336732LC____F3ET0EP0Q000072428BX1.
To blacklist this device, include the following in the /etc/multipath.conf file.

blacklist {
      wwid SIBM-ESXSST336732LC____F3ET0EP0Q000072428BX1
}

3. After you have updated the /etc/multipath.conf file, you must manually tell the multipathd daemon to reload the file.

The following command reloads the updated /etc/multipath.conf file.
service multipathd reload

4. Run the following commands:

multipath -F
multipath -v2
[root@test~]# multipath -F
[root@test ~]# multipath -v2

create: 3600a0b80001327d80000006d43621677
[size=12 GB][features="0"][hwhandler="0"]
\_ round-robin 0
  \_ 2:0:0:0 sdb  8:16  
  \_ 3:0:0:0 sdf  8:80  
create: 3600a0b80001327510000009a436215ec
[size=12 GB][features="0"][hwhandler="0"]
\_ round-robin 0
  \_ 2:0:0:1 sdc  8:32  
  \_ 3:0:0:1 sdg  8:96  
create: 3600a0b80001327d800000070436216b3
[size=12 GB][features="0"][hwhandler="0"]
\_ round-robin 0
  \_ 2:0:0:2 sdd  8:48  
  \_ 3:0:0:2 sdh  8:112