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 

Tuesday, November 17, 2015

Explain Multipath command output in Linux Server

Tuesday, November 17, 2015
When you create, modify, or list a multipath device, you get a printout of the current device setup. The format is as follows.

For each multipath device:

 action_if_any: alias (wwid_if_different_from_alias) [size][features][hardware_handler]

For each path group:

\_ scheduling_policy [path_group_priority_if_known] [path_group_status_if_known]

For each path:

\_ host:channel:id:lun devnode major:minor [path_status] [dm_status_if_known]

For example, the output of a multipath command might appear as follows:

mpath1 (3600d0230003228bc000339414edb8101) [size=10 GB][features="0"][hwhandler="0"]
\_ round-robin 0 [prio=1][active]
 \_ 2:0:0:6 sdb 8:16 [active][ready]
\_ round-robin 0 [prio=1][enabled]
 \_ 3:0:0:6 sdc 8:64 [active][ready]

If the path is up and ready for I/O, the status of the path is ready or active. If the path is down, the status is faulty or failed.


 The path status is updated periodically by the multipathd daemon based on the polling interval defined in the /etc/multipath.conf file.

The dm status is similar to the path status, but from the kernel's point of view. The dm tatus has two states: failed, which is analogous to faulty, and active which covers all other path states. Occasionally, the path state and the dm state of a device will temporarily not agree.

Friday, November 13, 2015

How to setup DM-Multipath in Linux server?

Friday, November 13, 2015 0
DM-Multipath includes compiled-in default settings that are suitable for common multipath configurations.

Setting up DM-multipath is often a simple procedure.

The basic procedure for configuring your system with DM-Multipath is as follows:

1. Install device-mapper-multipath rpm.
 
Before setting up DM-Multipath on your system, ensure that your system has been updated and includes the device-mapper-multipath package.

2. Edit the multipath.conf configuration file:

  Edit the /etc/multipath.conf file by commenting out the following lines at the top of the file. This section of the configuration   file, in its initial state, blacklists all devices. You must comment it out to enable multipathing.
     
       blacklist {
        devnode "*"
}

The default settings for DM-Multipath are compiled in to the system and do not need to be explicitly set in the /etc/multipath.conf file.

The default value of path_grouping_policy is set to failover, so in this example you do not need to change the default value.

The initial defaults section of the configuration file configures your system that the names of the multipath devices are of the  form mpathn; without this setting, the names of the multipath devices would be aliased to the WWID of the device.

Save the configuration file and exit the editor.

3. Start the multipath daemons.

modprobe dm-multipath
service multipathd start
multipath -v2

The multipath -v2 command prints out multipathed paths that show which devices are multipathed. If the command does not print anything out, ensure that all SAN connections are set up properly and the system is multipathed.

4. Execute the following command to ensure sure that the multipath daemon starts on bootup:

    chkconfig multipathd on

Since the value of user_friendly_name is set to yes in the configuration file the multipath devices will be created as /dev/mapper/mpathn