Bug 243527 - anaconda must un-blacklist devices in multipath.conf for mpath installs
Summary: anaconda must un-blacklist devices in multipath.conf for mpath installs
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: anaconda
Version: 5.0
Hardware: All
OS: Linux
urgent
urgent
Target Milestone: ---
: ---
Assignee: David Cantrell
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 185852
TreeView+ depends on / blocked
 
Reported: 2007-06-09 13:55 UTC by Bryn M. Reeves
Modified: 2007-11-30 22:07 UTC (History)
6 users (show)

Fixed In Version: RHBA-2007-0644
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-11-07 17:21:52 UTC
Target Upstream Version:
Embargoed:


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


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2007:0644 0 normal SHIPPED_LIVE anaconda bug fix and enhancement update 2007-10-30 22:56:59 UTC

Description Bryn M. Reeves 2007-06-09 13:55:13 UTC
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):
anaconda-11.1.2.36

How reproducible:
100%

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 Program Management 2007-06-09 14:03:32 UTC
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
release.

Comment 3 David Cantrell 2007-06-11 15:34:50 UTC
Bryn,

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 18:03:57 UTC
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 23:33:38 UTC
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 15:07:11 UTC
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 20:02:40 UTC
Created attachment 156913 [details]
anaconda-243527.patch

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-15 03:25:01 UTC
Tried multipath-root installation with anaconda-11.1.2.37-2.MP.ia64.rpm.

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

E.g.,
     # 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.

E.g.,
  #blacklist {#        devnode "*"
  #}

and
  defaults {      user_friendly_names yes}##


Comment 10 David Cantrell 2007-06-15 15:54:43 UTC
Created attachment 157127 [details]
anaconda-243527.patch

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 17:45:55 UTC
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 19:42:50 UTC
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 18:20:43 UTC
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 18:13:46 UTC
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 20:18:52 UTC
(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 17:21:52 UTC
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.

http://rhn.redhat.com/errata/RHBA-2007-0644.html



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