Bug 160227

Summary: multipath/kpartx integration
Product: [Fedora] Fedora Reporter: Axel Thimm <axel.thimm>
Component: device-mapper-multipathAssignee: Ben Marzinski <bmarzins>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: agk, bmarzins, dwysocha, jbacik, jhedstro, junichi.nomura, mbroz, prockai, rkenna, sdavies, wmealing
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
URL: https://www.redhat.com/archives/fedora-devel-list/2005-May/msg00445.html
Whiteboard:
Fixed In Version: f7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-10-29 19:47:14 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
call kpartx from rc.sysinit for dm-multipath devices
none
call kpartx from hotplug script for dm-multipath none

Description Axel Thimm 2005-06-13 17:26:35 UTC
Description of problem:
The device-mapper-multipath package provides the tools to do multipath and lvm
partitions on device mapper generated devices, but they are not used during dm
and lvm setup.

Version-Release number of selected component (if applicable):


How reproducible:
always

Steps to Reproduce:
1.Plug multipath devices with lvm volumes
2.
3.
  
Actual results:
- multipaths are not grouped
- partitions on dm devices are not identified
- lvm volumes are not activated

Expected results:
System should modprobe for dm-multipath, and run kpartx on all dm devices before
lvm initialization.

Additional info:
See also post in the URL above.
The following can be used in /etc/rc.local as a workaround:

# multipath
modprobe dm-multipath
multipath
# dm partitions
for x in /dev/dm*; do
  kpartx -va $x
done
# lvm rescan
vgscan --mknodes
vgchange -aly

It would be nice to integrate this within initscripts.

Comment 1 Alasdair Kergon 2005-06-13 17:30:45 UTC
There is work in progress to integrate this into the initrd, to support a dm
multipath root device.

Comment 6 Alasdair Kergon 2005-10-03 14:25:50 UTC
Two proposed patches to initscripts for you to try out if you wish.

Comment 7 Alasdair Kergon 2005-10-03 14:27:35 UTC
Created attachment 119548 [details]
call kpartx from rc.sysinit for dm-multipath devices

Comment 8 Alasdair Kergon 2005-10-03 14:28:38 UTC
Created attachment 119549 [details]
call kpartx from hotplug script for dm-multipath

Comment 9 Bill Nottingham 2005-10-03 18:02:31 UTC
dev.d is deprecated in favor of direct udev rules, FWIW.

Comment 10 Bill Nottingham 2005-10-03 18:57:03 UTC
(That is, deprecated in the post-FC4 world.)

Comment 11 Bill Nottingham 2005-10-03 19:18:21 UTC
Added to initscripts CVS, will be in 8.17-1. Bouncing over to udev.

Comment 12 Christophe Varoqui 2005-10-03 19:35:35 UTC
FYI, upstream uses the following rules file :

1 #
2 # multipath and multipath partitions nodes are created in /dev/mapper/
3 # this file should be installed in /etc/udev/rules.d
4 #
5 # !! udev must not discard DM events !!
6 # !! check the other installed rules !!
7 #
8
9 # lookup the devmap name
10 #ACTION=="add", SUBSYSTEM=="block", KERNEL=="dm-*", \
11 # PROGRAM="/sbin/devmap_name %M %m"
12 ACTION=="add", SUBSYSTEM=="block", KERNEL=="dm-*", \
13 PROGRAM="/sbin/dmsetup -j %M -m %m --noopencount --noheadings -c -o name info"
14
15 # take care of devmap partitioning
16 ACTION=="add", SUBSYSTEM=="block", KERNEL=="dm-*", \
17 RUN+="/sbin/kpartx -a /dev/mapper/%c"
18
19 # insert new paths in multipath topology
20 ACTION=="add", SUBSYSTEM=="block", KERNEL!="dm-*", \
21 RUN+="/sbin/multipath -v0 %r/%k"
22


Comment 13 Alasdair Kergon 2005-10-03 20:03:11 UTC
And that's not ideal for a distribution because it assumes you're using
multipath on your system.  Most people will have the package installed, but not
actually be using it, and the impact on their systems needs to be as close to
nothing as possible.

1) I only want to run kpartx against dm multipath devices not other types of
device-mapper devices: see the dmsetup options used in the script.

2) I don't want to run /sbin/multipath whenever a new device appears on the
system if I'm not using multipath.  And if I am, I just want to notify the
daemon using mpath_ctl, and let the daemon take care of things.


Comment 14 Alasdair Kergon 2005-10-03 20:05:12 UTC
For 2, this is the sort of thing that needs translating to udev:

if /sbin/pidof /sbin/multipathd > /dev/null 2>&1 ; then
        if [ "${DEVPATH:7:3}" = "dm-" ] ; then
                /sbin/mpath_ctl "${ACTION} map ${DEVPATH:7}" > /dev/null 2>&1
        else
                /sbin/mpath_ctl "${ACTION} path ${DEVPATH:7}" > /dev/null 2>&1
        fi
fi


Comment 15 Alasdair Kergon 2005-10-03 20:14:40 UTC
And 'multipath' ought to go away I think: the daemon should manage everything
internally - so state is only held in one place - taking messages and returning
status info via mpath_ctl.  

[More precisely, the 'multipath' command can stay but its functionality moves
into the daemon and merges with mpath_ctl: all it does is send/receive data
to/from the daemon.  The hard-coded '1000' limit on data transfer (with buffer
overflow if exceeded) in the daemon also needs fixing so it either works out the
buffer size it needs before filling it, or else it 'reallocs' the buffer if it
needs more space.]

Comment 20 Christian Iseli 2007-01-20 00:09:41 UTC
This report targets the FC3 or FC4 products, which have now been EOL'd.

Could you please check that it still applies to a current Fedora release, and
either update the target product or close it ?

Thanks.

Comment 21 Harald Hoyer 2007-09-20 11:52:28 UTC
reassigning to device-mapper-multipath, which can provide udev rules for that.

Comment 22 Ben Marzinski 2007-10-29 19:47:14 UTC
This all works for current releases