Bug 2122355

Summary: vdsm plugin does not collect LVM information of RHV SDs if the host uses LVM devices
Product: Red Hat Enterprise Linux 9 Reporter: Pavel Moravec <pmoravec>
Component: sosAssignee: Pavel Moravec <pmoravec>
Status: CLOSED ERRATA QA Contact: Daniel Záležák <dzalezak>
Severity: high Docs Contact:
Priority: high    
Version: 9.1CC: agk, bmr, dzalezak, jortialc, jwboyer, mhradile, plambri, sbradley, theute
Target Milestone: rcKeywords: OtherQA, Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: sos-4.3-3.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-11-15 11:12:29 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:
Deadline: 2022-09-05   

Description Pavel Moravec 2022-08-29 20:46:55 UTC
This bug was initially created as a copy of Bug #2093993

I am copying this bug because: 

we need to have 8.7 and 9.1 in par.


Description of problem:
Since RHV 4.4 SP1, the RHV hypervisors are using LVM devices instead of filters to control the access to the block devices, see:

Bug 2012830 - [RFE] Use lvm devices instead of lvm filter on RHEL 8.6 / CentOS Stream 9 
https://bugzilla.redhat.com/show_bug.cgi?id=2012830

After this change, the vdsm plugin no longer collects the LVM information of the volume groups used for RHV storage domains.

Version-Release number of selected component (if applicable):
sos-4.2-19.el8_6.noarch

How reproducible:
Always

Steps to Reproduce:
1. In a RHV environment, upgrade a hypervisor to RHEL 8.6, vdsm-4.50.0.13-1.el8ev.x86_64
2. Verify that LVM is configured with lvmdevices

    /etc/lvm/lvm.conf:

    devices {
        use_devicesfile = 1
    }

3. Generate a sosreport.

Actual results:
These LVM commands are run:

2022-06-06 13:13:56,336 INFO: [plugin:vdsm] added cmd output 'lvm vgs -v -o +tags --config 'global { locking_type=0 metadata_read_only=1 use_lvmetad=0 } devices { preferred_names=["^/dev/mapper/"] ignore_suspended_devices=1 write_cache_state=0 disable_after_error_count=3 filter=["a|^/dev/disk/by-id/dm-uuid-mpath-|", "r|.+|"] }''
2022-06-06 13:13:56,337 INFO: [plugin:vdsm] added cmd output 'lvm lvs -v -o +tags --config 'global { locking_type=0 metadata_read_only=1 use_lvmetad=0 } devices { preferred_names=["^/dev/mapper/"] ignore_suspended_devices=1 write_cache_state=0 disable_after_error_count=3 filter=["a|^/dev/disk/by-id/dm-uuid-mpath-|", "r|.+|"] }''
2022-06-06 13:13:56,337 INFO: [plugin:vdsm] added cmd output 'lvm pvs -v -o +all --config 'global { locking_type=0 metadata_read_only=1 use_lvmetad=0 } devices { preferred_names=["^/dev/mapper/"] ignore_suspended_devices=1 write_cache_state=0 disable_after_error_count=3 filter=["a|^/dev/disk/by-id/dm-uuid-mpath-|", "r|.+|"] }''

We are only getting the information of the system VG, and not other VGs used for RHV storage domains: 

$ cat sos_commands/vdsm/lvm_lvs_-v_-o_tags_--config_global_locking_type_0_metadata_read_only_1_use_lvmetad_0_devices_preferred_names_.dev.mapper._ignore_suspended_devices_1_write_cache_state_0_disable_after_error_count_3_filter_a_.dev.disk.by-id.dm-uuid-mpath-_r 
  Reloading config files
  WARNING: locking_type (0) is deprecated, using --nolocking.
  WARNING: File locking is disabled.
  Please remove the lvm.conf filter, it is ignored with the devices file.
  LV   VG          #Seg Attr       LSize   Maj Min KMaj KMin Pool Origin Data%  Meta%  Move Cpy%Sync Log Convert LV UUID                                LProfile LV Tags
  home rhel_unused    1 -wi-ao---- 223.87g  -1  -1  253   12                                                     846ZeV-yiAs-BV6d-fcGe-lqei-yQPC-tiEpkI                 
  root rhel_unused    1 -wi-ao----  50.00g  -1  -1  253    0                                                     mGFC86-iuhN-c0Oi-emKW-TUIo-K8z0-Fga2PN                 
  swap rhel_unused    1 -wi-ao----   4.00g  -1  -1  253    1                                                     DpWVqy-d6gf-Tye2-1Quf-Hn0n-F2M5-cyanKU                 
  Reloading config files

Expected results:
Getting all the information of all existing VGs, LVs and PVs as before.

Additional info:
Having this LVM information is critical for support as it's very commonly used to debug storage issues.

The LVM command should be updated to include the option "use_devicesfile=0", for example:

lvm vgs -v -o +tags --config 'global { locking_type=0 metadata_read_only=1 use_lvmetad=0 } devices { use_devicesfile=0 preferred_names=["^/dev/mapper/"] ignore_suspended_devices=1 write_cache_state=0 disable_after_error_count=3 filter=["a|^/dev/disk/by-id/dm-uuid-mpath-|", "r|.+|"] }'
lvm lvs -v -o +tags --config 'global { locking_type=0 metadata_read_only=1 use_lvmetad=0 } devices { use_devicesfile=0 preferred_names=["^/dev/mapper/"] ignore_suspended_devices=1 write_cache_state=0 disable_after_error_count=3 filter=["a|^/dev/disk/by-id/dm-uuid-mpath-|", "r|.+|"] }'
lvm pvs -v -o +all --config 'global { locking_type=0 metadata_read_only=1 use_lvmetad=0 } devices { use_devicesfile=0 preferred_names=["^/dev/mapper/"] ignore_suspended_devices=1 write_cache_state=0 disable_after_error_count=3 filter=["a|^/dev/disk/by-id/dm-uuid-mpath-|", "r|.+|"] }'

Comment 8 errata-xmlrpc 2022-11-15 11:12:29 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 (sos bug fix and enhancement update), 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/RHEA-2022:8275