Bug 2159555

Summary: multipath.conf is modified incorrectly when MultipathdCustomConfigFile is present
Product: Red Hat OpenStack Reporter: yatanaka
Component: tripleo-ansibleAssignee: Alan Bishop <abishop>
Status: CLOSED ERRATA QA Contact: Evelina Shames <eshames>
Severity: medium Docs Contact:
Priority: medium    
Version: 16.2 (Train)CC: abishop, eharney, ifrangs, joflynn, tkajinam
Target Milestone: z5Keywords: Triaged, ZStream
Target Release: 16.2 (Train on RHEL 8.4)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: tripleo-ansible-0.8.1-2.20230302004949.0db9f93.el8ost Doc Type: Bug Fix
Doc Text:
Before this update, deploying Block Storage multipath with a custom configuration containing a "blacklist_exceptions" section failed due to an error in the multipath configuration. With this update, custom multipath configurations are handled correctly and therefore Block Storage multipath can be deployed with a custom configuration containing a "blacklist_exceptions" section.
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-04-26 12:17:32 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description yatanaka 2023-01-10 01:18:53 UTC
Description of problem:

If MultipathdCustomConfigFile is present and the multipath.conf file has blacklist or blacklist_exceptions section, tripleo-ansible modifies the multipath.conf file incorrectly like the following example:

<Original multipath.conf file configured by MultipathdCustomConfigFile>
~~~
blacklist {
    devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
    devnode "^hd[a-z]"
}

blacklist_exceptions {
    device {
        product "XXXX"
        vendor "XXXX"
    }
}
~~~

<Deployed multipath.conf file on overcloud Compute node>
~~~
blacklist {
}                    <==================(*) added incorrectly
    devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
    devnode "^hd[a-z]"
}

blacklist {          <==================(*) Changed to blacklist from blacklist_exceptions
}                    <==================(*) added incorrectly
    device {
        product "XXXX"
        vendor "XXXX"
    }
}
~~~

The above change is made by the following Ansible tasks:

  - https://github.com/openstack/tripleo-ansible/blob/stable/train/tripleo_ansible/roles/tripleo_multipathd/tasks/configure.yml#L47-L91

I think these Ansible tasks shouldn't run when MultipathdCustomConfigFile is present.



Version-Release number of selected component (if applicable):
My customer observed this issue on their RHOSP 16.2.4 environment first.
Then I reproduced the same issue on my RHOSP 16.2.4 lab.


How reproducible:
Steps to Reproduce:
1. In undercloud, create /var/lib/mistral/multipath.conf file which includes blacklist section or blacklist_exceptions section.
2. Create the following environment file.
   ~~~
   parameter_defaults:
     MultipathdCustomConfigFile: /var/lib/mistral/multipath.conf
   ~~~
3. Deploy overcloud with the following environment files
   ~~~
   $ openstack overcloud deploy \
      :
     -e /usr/share/openstack-tripleo-heat-templates/environments/multipathd.yaml
     -e <env file created by step 2>
      :
   ~~~
4. Check /etc/multipath.conf on Compute nodes.

Doc : https://access.redhat.com/documentation/en-us/red_hat_openstack_platform/16.2/html/storage_guide/assembly-configuring-the-block-storage-service_osp-storage-guide#proc-configuring-multipath-on-new-deployments_configuring-cinder


Actual results:
/etc/multipath.conf on Compute nodes retains valid contents.


Expected results:
/etc/multipath.conf is modified incorrectly.
"blacklist" section bracket is closed incorrectly.
"blacklist_exceptions" section is changed to "blacklist"

Comment 12 errata-xmlrpc 2023-04-26 12:17:32 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Red Hat OpenStack Platform 16.2.5 (Train) bug fix and enhancement advisory), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:1763