Unable to set custom 'dev_loss_tmo' value in RHEL7
Environment
- Red Hat Enterprise Linux 7
Issue
-
The value of
dev_loss_tmois set to20but still getting the50in the output of below command:$ less /etc/multipath.conf [...] defaults { user_friendly_names yes fast_io_fail_tmo 10 dev_loss_tmo 20 ### } [...] $ for f in /sys/class/fc_remote_ports/rport-*/dev_loss_tmo; do d=$(dirname $f); echo $(basename $d):$(cat $d/node_name):$(cat $f); done rport-7:0-2:0x50020e8020144afa:50 <--- rport-7:0-3:0x50020e8020144af2:50 <--- rport-8:0-2:0x50020e8020144afb:50 <--- rport-8:0-3:0x50020e8020144af3:50 <--- -
How is the value of
dev_loss_tmocalculated in RHEL 7 ?
Resolution
-
In order to allow device-mapper-multipath to set
dev_loss_tmoto a low value, please ensure thatno_path_retry*polling_interval<=dev_loss_tmo. For example if the desireddev_loss_tmois 20,no_path_retrycan be 4 andpolling_interval5. Also, please note that loweringpolling_intervalbelow 5 is not recommended, especially in environments with multiple LUNs and paths. As an example, the following configuration will allow settingdev_loss_tmoto 20:defaults { user_friendly_names yes fast_io_fail_tmo 10 dev_loss_tmo 20 polling_interval 5 ### } devices { device { vendor "HITACHI" product "DF.*" path_grouping_policy multibus path_checker tur features "1 queue_if_no_path" no_path_retry 4 ### } }Note: In environments with large numbers of paths and LUNs, the
polling_intervalmay need to be increased to avoid a load overhead caused by too frequent checker commands. In such cases and if thedev_loss_tmocannot be equally increased,no_path_retrywill need to be reduced in order to keepno_path_retry*polling_interval<=dev_loss_tmo. As an example, the settings above, could be adjusted topolling_interval 10andno_path_retry 2. -
Then reload the
multipathdservice:$ systemctl reload multipathd
Root Cause
-
device-mapper-multipathin RHEL7 refuses to delete the paths sooner thanno_path_retryvalue. This is because once those paths are gone, no retries could be done on affected paths. So, with above new changes, the minimum allowed value of thedev_loss_tmocalculated as below:Minimum allowed 'dev_loss_tmo' by dm-multipath = 'no_path_retry' * 'polling_interval' <----- Minimum value of the 'dev_loss_tmo'
Diagnostic Steps
-
The following loop can reveal the rport, its WWPN, the corresponding scsi target number (if any) and the dev_loss_tmo:
# for i in /sys/class/fc_remote_ports/rport-*; \ do echo -e "$(basename $i)\t$(cat $i/port_name) $(cat $i/dev_loss_tmo) $(cat $i/scsi_target_id)"; \ done -
Setting
verbosity 3, or higher, inmultipath.confand restarting multipathd withsystemctl restart multipathdwill be printing in the logs messages similar to the following, indicating the mismatch between the configuration and the actual settings applied by multipathd:Oct 19 16:41:48 hostname multipathd: <LUN name or WWID>: dev_loss_tmo = 20 (config file default) ... Oct 19 16:41:48 hostname multipathd: <LUN name or WWID>: update dev_loss_tmo to 50The messages will be printed at the moment multipathd restarts. The
verbositysetting inmultipath.confcan be deleted (or set to the default 2) and multipathd can be restarted once again, right after the test, in order to avoid continuous messages in the logs that are printed when multipathd runs withverbosity 3or higher.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.