Bug 2005219 - Deployment fails if LVMFilterEnabled is true but LVMFilterAllowList is empty
Summary: Deployment fails if LVMFilterEnabled is true but LVMFilterAllowList is empty
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: tripleo-ansible
Version: 16.1 (Train)
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: z8
: 16.1 (Train on RHEL 8.2)
Assignee: Giulio Fidente
QA Contact: Tzach Shefi
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-09-17 07:29 UTC by Takashi Kajinami
Modified: 2024-12-20 21:06 UTC (History)
4 users (show)

Fixed In Version: tripleo-ansible-0.5.1-1.20220114163452.902c3c8.el8ost
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-03-24 11:01:35 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Launchpad 1944743 0 None None None 2021-09-23 16:04:28 UTC
OpenStack gerrit 810714 0 None MERGED Allow LVM filter to work when either allowlist or denylist are empty 2022-01-14 14:31:24 UTC
OpenStack gerrit 812568 0 None MERGED Allow LVM filter to work when either allowlist or denylist are empty 2022-01-14 14:31:26 UTC
Red Hat Issue Tracker OSP-9654 0 None None None 2021-11-15 12:48:48 UTC
Red Hat Product Errata RHBA-2022:0986 0 None None None 2022-03-24 11:01:58 UTC

Description Takashi Kajinami 2021-09-17 07:29:14 UTC
Description of problem:

# This feature is TP in RHOSP16.1 and RHOSP16.2 but I'm reporting this bug
# because its implementation is available in RHOSP16.y and stable/train.

When LVMFilterEnabled: true is set in a template file, overcloud deployment always fails at the following task.

~~~
TASK [tripleo_lvmfilter : collect in-use lvm2 devices list] ******************** 
~~~

It seems the tripleo_lvmfilter role doesn't handle an empty list properly
and put an invalid filter definition

[heat-admin@compute-0 ~]$ sudo cat /etc/lvm/lvm.conf
...

devices {
        ...
        global_filter=["","r|.*|"]
        ...
}

...
~~~


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

How reproducible:
Always

Steps to Reproduce:
1. Deploy overcloud with LVMFilterEnabled: true

Actual results:
Deployment fails at the tripleo_lvmfilter role

Expected results:
Deployment succeeds without any error

Additional info:

Comment 1 Giulio Fidente 2021-09-23 14:41:55 UTC
hello, I think [1] is only setting in the lvm global_filter any a|| item if at least one item is in the allowed_devices list; our best option is probably to default LVMFilterAllowlist parameter to ['.*'] instead

can you confirm the above to be working for you when set in a custom env file? as a result the lvm conf should look like:

  global_filter=["a|.*|","r|.*|"]

1. https://github.com/openstack/tripleo-ansible/blob/master/tripleo_ansible/roles/tripleo_lvmfilter/tasks/main.yml#L47

Comment 4 Takashi Kajinami 2021-10-07 15:47:12 UTC
Hi Giulio,

Unfortunately I don't have a handy deployment to test the whole deployment so could not yet test usage of the template parameter

I have tested the minimum steps implemented in tripleo_lvmfilter but it seems that deny rule is ignored when LVMFilterAllowlist: ['.*'] is set
and we need to get rid of that allow expression.

[heat-admin@controller-0 ~]$ sudo vi /etc/lvm/lvm.conf
...
devices {
        global_filter=["","r|.*|"]                             <==== This is what is set by default now
}
...
[heat-admin@controller-0 ~]$ sudo vgscan
  Configuration setting "devices/global_filter" invalid. It cannot be set to an empty value.
  Pattern must begin with 'a' or 'r'.
  Invalid filter pattern "".
  Failed to create global regex device filter                  <==== The vgscan command fails
[heat-admin@controller-0 ~]$ sudo vi /etc/lvm/lvm.conf
...
devices {
        global_filter=["a|.*|","r|.*|"]                        <==== Add both rules
}
...
[heat-admin@controller-0 ~]$ sudo vgscan
  Found volume group "cinder-volumes" using metadata type lvm2 <==== LVM is still detected
[heat-admin@controller-0 ~]$ sudo lvs
  LV                  VG             Attr       LSize  Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  cinder-volumes-pool cinder-volumes twi-a-tz-- 15.20g             0.00   10.57                           
[heat-admin@controller-0 ~]$ sudo vgs
  VG             #PV #LV #SN Attr   VSize   VFree  
  cinder-volumes   1   1   0 wz--n- <16.00g 780.00m

[heat-admin@controller-0 ~]$ sudo vi /etc/lvm/lvm.conf
...
devices {
        global_filter=["r|.*|"]                                <==== define only deny rule
}
...
[heat-admin@controller-0 ~]$ sudo vgscan
[heat-admin@controller-0 ~]$                                   <==== LVM is no longer detected
[heat-admin@controller-0 ~]$ sudo lvs
[heat-admin@controller-0 ~]$

Comment 5 Giulio Fidente 2021-10-07 15:59:52 UTC
hi, thanks for pinging back; I think I have a working patch in https://review.opendev.org/812568

Comment 15 errata-xmlrpc 2022-03-24 11:01:35 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.1.8 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-2022:0986


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