Bug 243527 - anaconda must un-blacklist devices in multipath.conf for mpath installs
anaconda must un-blacklist devices in multipath.conf for mpath installs
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: anaconda (Show other bugs)
All Linux
urgent Severity urgent
: ---
: ---
Assigned To: David Cantrell
Depends On:
Blocks: 185852
  Show dependency treegraph
Reported: 2007-06-09 09:55 EDT by Bryn M. Reeves
Modified: 2007-11-30 17:07 EST (History)
6 users (show)

See Also:
Fixed In Version: RHBA-2007-0644
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-11-07 12:21:52 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
anaconda-243527.patch (2.22 KB, patch)
2007-06-13 16:02 EDT, David Cantrell
no flags Details | Diff
anaconda-243527.patch (2.70 KB, patch)
2007-06-15 11:54 EDT, David Cantrell
no flags Details | Diff

  None (edit)
Description Bryn M. Reeves 2007-06-09 09:55:13 EDT
Description of problem:
When anaconda sets up multipath for an mpath installation it does not comment
out the following lines in multipath.conf:

# Blacklist all devices by default. Remove this to enable multipathing
# on the default devices. 
blacklist {
        devnode "*"

Without this change, all devices are blacklisted from multipath scanning.

This means that even if the initramfs manages to bring up the root multipath
device, non-root multipaths will not be started automatically.

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

How reproducible:

Steps to Reproduce:
1. Install a multipath system using "linux mpath"
2. Create some root & non-root multipath volumes
3. Reboot
Actual results:
Multipath devices do not start due to blacklisting in multipath.conf

Expected results:
All multipath devices start correctly on boot

Additional info:
This problem did not affect the RHEL5 GA multipath boot as this ignored
multipath.conf settings for all mpaths discovered at mkinitrd time. This will
not work with the support planned for 5.1.
Comment 1 RHEL Product and Program Management 2007-06-09 10:03:32 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
Comment 3 David Cantrell 2007-06-11 11:34:50 EDT

Does anaconda handle writing out the multipath.conf file now, is it the
device-mapper tools?  I can't find anything in the anaconda source that does this.  
Comment 4 Bryn M. Reeves 2007-06-12 14:03:57 EDT
It's installed by the device-mapper-multipath RPM - to date the policy has been
to leave the blacklisting in place and the daemon disabled on package
installation, forcing the user to manually configure it.

Adding Ben to the CC as he's the device-mapper-multipath maintainer & can
probably comment on this better than I can.
Comment 5 Ben Marzinski 2007-06-12 19:33:38 EDT
As far as I can tell, anaconda leaves doesn't do anything to the
/etc/multipath.conf file.  It is exactly as the rpm installs it.  Like Bryn
said, the way the multipath package works, when you install it, it blacklists
all devices, otherwise you could suddenly see your devices get multipathed (even
devices with only one path). However when you are running root on it, you
obviously want those devices included.

The biggest problem with not fixing this is that multipathd uses the config file
to determine which devices to monitor, so even if you have your multipathed
devices, once a path group goes down, it will not be restored.
Comment 6 David Cantrell 2007-06-13 11:07:11 EDT
I think for 5.1, the better solution to this problem is to have anaconda modify
and/or write out a new multipath.conf file.  Anaconda knows if it has set up a
system with or without multipath devices.  On systems with multipath devices, we
can disable that blacklist.  Putting that knowledge in to a RPM postinstall
scriptlet seems wrong.

Thanks for the info.
Comment 7 David Cantrell 2007-06-13 16:02:40 EDT
Created attachment 156913 [details]

Patch to backend.py in anaconda to comment out the blacklist {} block in
/etc/multipath.conf.  I'm only doing this is flags.mpath is true in anaconda,
which indicates that we have set up a system with multipath devices.
Comment 9 Jun'ichi NOMURA 2007-06-14 23:25:01 EDT
Tried multipath-root installation with anaconda-

Un-blacklisting all devices doesn't work fine.
As a result, we could get multipath maps for non-multipathed device.

     # dmsetup ls --tree
     SSEAGATE_ST373207LC_3KT2EX6H00007550JXE6p2 (253:22)
       └─SSEAGATE_ST373207LC_3KT2EX6H00007550JXE6 (253:20)
          └─ (65:224)

We need to blacklist all but the devices used in installation.
Ben, is it possible to use blacklist_exception entry in multipath.conf
for this purpose?

Also, the generated multipath.conf seems lacking newlines in some places.

  #blacklist {#        devnode "*"

  defaults {      user_friendly_names yes}##
Comment 10 David Cantrell 2007-06-15 11:54:43 EDT
Created attachment 157127 [details]

Modified blacklist patch.  I decided to modify the patch to blacklist the
non-mpath devices explicitly.  The blacklist_exception method won't work if you
also blacklist by devnode, or something like that.  Adding blacklist lines for
the non-mpath devices is easy enough in anaconda.

The newline stuff is a little messed up, but I'm concerned more with
functionality right now.

This patch will go in the next anaconda build in dist-5E-multipath.
Comment 11 Ben Marzinski 2007-06-15 13:45:55 EDT
There is a way to blacklist with the blacklist_exceptions method. The issue is
that exceptions only work against a blacklist rule of the same class that they
are.  I know that this is annoying, and multipath really needs a whitelist
option, but you can work with it.

To only allow one device, I use something like this

blacklist {
        devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
        devnode "^hd[a-z]"
        devnode "^cciss!c[0-9]d[0-9]*"
        wwid "*"

blacklist_exceptions {
        wwid "3600d0230000000000e13955cc3757804"

You need to blacklist all the types of devices that you can't be multipathed at
all by devnode, because multipath has no way to get an wwid for most of them.
The first three lines of my blacklist is just the default multipath blacklist,
which excludes all non-multipathable devices.  The next line blacklists all
wwids. The result is that all devices are blacklisted, but the multipathable
devices are all blacklisted by wwid, so you can just add wwid exceptions.

The blacklist lines will always be the same, you just need to add exceptions for
the wwids that you want multipathed.  This has the benefit that if a customer
adds new storage, it won't get multipathed by default.
Comment 12 Ben Marzinski 2007-06-15 15:42:50 EDT
oops. We're adding cciss device support in RHEL5.1, so the blacklist should
actually look like this

blacklist {
        devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
        devnode "^hd[a-z]"
        wwid "*"

Comment 13 David Cantrell 2007-06-18 14:20:43 EDT
Moving state to modified.  Anaconda now changes the blacklist block to be the
one mentioned in comment #12 and then adds the mpath WWIDs it finds in the
bindings file to the blacklist_exception block.
Comment 14 Ben Marzinski 2007-06-20 14:13:46 EDT
Looking at bz# 185852, Comment #56, it appears that that the blacklist is still
not correct, it probably should be

blacklist {
        devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
        devnode "^(hd|xvd)[a-z]*"
        wwid "*"

To blacklist xenblk devices.
Comment 15 David Cantrell 2007-06-20 16:18:52 EDT
(In reply to comment #14)
> Looking at bz# 185852, Comment #56, it appears that that the blacklist is still
> not correct, it probably should be
> blacklist {
>         devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
>         devnode "^(hd|xvd)[a-z]*"
>         wwid "*"
> }
> To blacklist xenblk devices.

Thanks, updated anaconda in RHEL-5 with this change.
Comment 18 errata-xmlrpc 2007-11-07 12:21:52 EST
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.


Note You need to log in before you can comment on or make changes to this bug.