udev breaks multipath after reboot when using LVM
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
multipath-tools (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: udev
Hello,
* Summary: I'm using an EMC Clariion CX3-10 san controller on a Dell PowerEdge M100 server., Ubuntu Server "Hardy" 8.04, amd-64 as operating System. Once the "multipath-tool" package is installed, a new device is created in /dev/mapper, after creating a "0x8E" type partition on it and creating a PV / VG / LG with LVM on this partition I have a fonctionnal LVM Logical Group working with multipath. After a reboot, the multipath configuration is lost (no failover / load-balancing).
* Step to reproduce:
- Having Ubuntu Hardy Server 8.04-amd-64 installed with packages "lvm2" and "multipath-tools"
- Create /etc/multipath.conf with and alias of the WWID for easy reading and restart the multipath-tools service
=======
# cat /etc/multipath.conf
multipaths {
multipath {
wwid 360060160712020
}
}
=======
- Check the output of "multipath -ll" ("lun3" is the alias)
=======
# multipath -ll
lun3 (36006016071202
[size=50G]
\_ round-robin 0 [prio=2][active]
\_ 3:0:1:0 sdc 8:32 [active][ready]
\_ 4:0:1:0 sde 8:64 [active][ready]
\_ round-robin 0 [prio=0][enabled]
\_ 3:0:0:0 sda 8:0 [active][ready]
\_ 4:0:0:0 sdd 8:48 [active][ready]
=======
- Check the presence of "/dev/mapper/lun3"
- Use "fdisk /dev/mapper/lun3" and create a new primary partition, change the partition's type to "0x8E" (LVM)
- Restart the "udev" service
- Check the presence of "/dev/mapper/
- Create a PV with "pvcreate /dev/mapper/
- Add the line "types = [ "device-mapper", 1 ]" in the /etc/lvm.conf file
- Add this PV on a new VG with "vgcreate vg0 /dev/mapper/
- Create a new LV on this VG with "lvcreate -l 12799 -n lv0 vg0"
- Create a new filesystem on this LV with "mkfs.ext3 /dev/vg0/lv0"
- Check the output of "multipath -ll", it should be the same as before
- Check the output of "pvdisplay"
=======
# pvdisplay
--- Physical volume ---
PV Name /dev/mapper/
VG Name vg0
PV Size 50,00 GB / not usable 3,28 MB
Allocatable yes (but full)
PE Size (KByte) 4096
Total PE 12799
Free PE 0
Allocated PE 12799
PV UUID R3lJLm-
=======
- At this point both multipating and LVM are fonctional
- reboot the server
* Actual result:
- After the reboot, the "multipath -ll" command isn't giving any output => multipathing is not functional anymore.
- The /dev/mapper/lun3 and /dev/mapper/
- The output of "pvdisplay" show that the "PV name" isn't the same as before:
=======
# pvdisplay
--- Physical volume ---
PV Name /dev/disk/
VG Name vg0
PV Size 50,00 GB / not usable 3,28 MB
Allocatable yes (but full)
PE Size (KByte) 4096
Total PE 12799
Free PE 0
Allocated PE 12799
PV UUID R3lJLm-
=======
* Expected result:
- Multipathing should work
- The /dev/mapper/lun3 and /dev/mapper/
- It looks like a mixup between the udev rules for LVM / dmsetup / multipath / kpartx
* Note:
- When removing all the LVM configuration with "lvremove", "vgremove", "pvremove" and restarting the "multipath-tools" service, the "/dev/mapper/lun3" and "/dev/mapper/
- This problem doesn't seems to affect others distrib, a RHEL How-To explains the use of Multipathing + LVM, see: https:/
- The official maintainer of the "multipath-package" talks about the use of LVM and the udev rules in the official FAQ, see: http://
Changed in multipath-tools (Ubuntu): | |
status: | Confirmed → Fix Released |
This bug's gone pretty much unnoticed I guess, but I'm experiencing the same issue. I'm scheduling downtime for next thursday (unfortunately this is a production machine) to try out some different LVM configurations, to make sure I can get it to reliably reboot with LVM scanning the multipath nodes, instead of the raw (sd*) device nodes.
Here's the configuration I'm using and expecting to work:
lvm.conf:
devices {
filter= ["a|/dev/ mapper/ mpath.* |", "r|.*|"]
cache= "/etc/lvm/ .cache"
write_ cache_state= 1
types= ["device- mapper" , 1]
sysfs_ scan=1
md_component_ detection= 1
dir="/dev"
scan="/dev"
}
Note that "types=" contains device-mapper types. IIRC this is not by default in Ubuntu, but is required for multipath support.
Also note that "filter=" is telling LVM to only scan for /dev/mapper/mpath*. This will make sure that LVM is only scanning for devices in /dev/mapper that begin with mpath. To get multipath to make devices with this prefix, edit multipath.conf:
defaults {
user_friendly_ names yes #names the devices mpath0 - mpath<n>
...
...
}
Or, optionally configure aliases for each multipath, and have them begin with "mpath".
These changes *should* force LVM to only ever look at /dev/mapper, and for multipath devices in particular, for PV's. If you use LVM for more than just mpio, change the filter line in lvm.conf to something like:
filter= ["a|/dev/ mapper/ mpath.* |", "a|^/dev/sda1$|", "a|^/dev/sdb1$|", "r|.*|"]
This will add /dev/sda1 and /dev/sdb1 in addition to the mpio devices.
I'll update this bug next thursday to say whether it works or not after a reboot.