Operating System - HP-UX
1758581 Members
1880 Online
108872 Solutions
New Discussion

FYI: Managing LVM multi-path behavior with pvchange

 
robert black
Occasional Contributor

FYI: Managing LVM multi-path behavior with pvchange

Abstract

The results when performing an immediate path switch using 'pvchange -s' while autoswitchback is enabled, can seem
unpredictable. When manually switching paths, autoswitchback should be disabled.

Background

LVM provides multipathing support for multiported devices. LVM's multipath support uses only one active path where the other path(s) are on standby. When the current path becomes unavailable, LVM will switch to the first available standby path. The paths are selected in the order they were configured.
The pvchange command provides several options for managing LVM behavior with paths:
•The -s (lower case s) option (immediate switch) requests that the specified path be used for all future I/O.
•The -S (upper case s) option (autoswitchback) when set (default value), tells LVM to automatically switch to the
best available path. When autoswitchback is disabled, LVM will still switch paths when the current path becomes unavailable, but it will not switch back to a higher priority
path that returns. The pvdisplay command will show the current autoswitchback setting.

Make note that the best available path is determined based on the order the paths were configured into the volume group (using vgcreate, vgextend, vgimport or vgscan). The order can be determined by using vgdisplay or pvdisplay and changed using vgreduce and vgextend.

When performing an immediate link switch (using pvchange -s), LVM's behavior will vary depending upon the autoswitchback (-S)
setting.
•When autoswitchback (-S) is disabled, LVM will switch paths as directed by pvchange -s (immediate switch) and continue to use this path until it becomes unavailable or another manual switch is performed.
•When autoswitchback (-S) is enabled, LVM will switch to the selected path as directed by pvchange -s. However to comply with the autoswitchback setting, LVM will switch back to the best available path.

Recent Improvements

With patch PHKL_34518(11.11)/ PHKL_34094(11.23), LVM improved its monitoring of path health. LVM now proactively monitors the health of all configured paths. If autoswitchback is enabled, LVM is far more responsive in returning to a better path when it becomes available.

With patches PHCO_35955 and PHKL_35970(11.11) / PHCO_35524 and PHKL_35965(11.23), proactive path monitoring can be configured
with pvchange -p. LVM's proactive polling is on by default and can be displayed using pvdisplay.

Conclusion

If you want to manually select a path using pvchange -s, autoswitchback should be disabled first.
1 REPLY 1
Florian Heigl (new acc)
Honored Contributor

Re: FYI: Managing LVM multi-path behavior with pvchange

Nice post, I'll print that out for reference.

One addition: don't use autopolling in conjunction with active/passive toys like EMC^2 Clariion, especially if you use snapclone.
Otherwise it'll trespass luns and at some point blow up, eventually.
yesterday I stood at the edge. Today I'm one step ahead.