Bug 1474566 - [sos plugin] lvm commands need syntax change
[sos plugin] lvm commands need syntax change
Status: VERIFIED
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: vdsm (Show other bugs)
4.1.3
x86_64 Linux
high Severity high
: ovirt-4.2.0
: ---
Assigned To: Ala Hino
Avihai
: ZStream
Depends On:
Blocks: 1483328
  Show dependency treegraph
 
Reported: 2017-07-24 20:54 EDT by Germano Veit Michel
Modified: 2017-10-01 08:11 EDT (History)
12 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: Incorrect lvm config. Consequence: Incorrect lvm output. Fix: Provide correct lvm config. Result: The correct lvm output is generated. The name of generated files will be: lvm_lvs_-v_-o_tags_--config_global_locking_type_0_use_lvmetad_0_devices_preferred_names_.dev.mapper._ignore_suspended_devices_1_write_cache_state_0_disable_after_error_count_3_filter_a_.dev.mapper.._r lvm_pvs_-v_-o_all_--config_global_locking_type_0_use_lvmetad_0_devices_preferred_names_.dev.mapper._ignore_suspended_devices_1_write_cache_state_0_disable_after_error_count_3_filter_a_.dev.mapper.._r lvm_vgs_-v_-o_tags_--config_global_locking_type_0_use_lvmetad_0_devices_preferred_names_.dev.mapper._ignore_suspended_devices_1_write_cache_state_0_disable_after_error_count_3_filter_a_.dev.mapper.._r
Story Points: ---
Clone Of:
: 1483328 (view as bug list)
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: Storage
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 80452 master MERGED sos-plugin: Introduce collectLVMCommand helper 2017-08-21 17:45 EDT
oVirt gerrit 80453 master POST sos-plugin: Add lvm configuration when executing lvm commands 2017-08-17 15:15 EDT
oVirt gerrit 81722 ovirt-4.1 POST sos-plugin: Introduce collectLVMCommand helper 2017-09-13 16:41 EDT
oVirt gerrit 81723 ovirt-4.1 POST sos-plugin: Add lvm configuration when executing lvm commands 2017-09-13 16:42 EDT
oVirt gerrit 81725 master POST sos-plugin: Better format lvm configuration 2017-09-14 00:28 EDT
oVirt gerrit 81872 master MERGED sos-plugin: Add lvm configuration when executing lvm commands 2017-09-17 09:23 EDT

  None (edit)
Description Germano Veit Michel 2017-07-24 20:54:22 EDT
Description of problem:

The VDSM SOS plugin, in vdsm/lib/sos/vdsm.py.in currently (even in master) does this for capture sosreport LVM information:

self.collectExtOutput("/sbin/lvm vgs -v -o +tags")
self.collectExtOutput("/sbin/lvm lvs -v -o +tags")
self.collectExtOutput("/sbin/lvm pvs -v -o +all")

With the recent changes on lvm filter and lvmetad, this needs to be reviewed so that sosreports contain correct and meaningful data.

At least two things concern me:
1) In 4.0.6 and lower, lvmetad might be running. This can yield in the sosreport showing cached, old LVM metadata, leading to incorrect support decisions.
2) Where customer manually setup lvm filtering (as recommended), or in the future where the filter might be automagic, these commands may fail to capture relevant data.

See also https://gerrit.ovirt.org/#/c/79698/
Comment 1 Yaniv Kaul 2017-08-06 04:16:04 EDT
Is this on track to 4.1.5?
Comment 2 Germano Veit Michel 2017-08-07 19:28:22 EDT
Hi Ala,

Following up from your email...

I think we need:
1) lvmetad=0 on each command, so that we don't ready stale metadata in RHV 4.0.6 and older.
2) filter to add the devices of the RHV Storage Domains (because the host will be blacklisting them in lvm.conf).

Otherwise sosreports might miss important data and we need to ask the customer again.

I think we need to add something similar to what VDSM does on each LVM command (in LVMCONF_TEMPLATE in vdsm/storage/lvm.py). As an example, I think each of those 3 commands in comment #0 should have a config like the below appended:
--config 'devices { filter = [ \'a|<RHV LUNS HERE?>', \'r|.*|\' ] } global {use_lvmetad=0}'

Or maybe use a "add all" filter to simplify it in case it won't cause problems.

I hope this clarifies the BZ.

Thanks
Comment 3 Ala Hino 2017-08-09 06:56:36 EDT
Thanks Germano.

I uploaded two patches targeting these requirements.
Comment 4 Allon Mureinik 2017-08-10 08:09:37 EDT
If there's another 4.1.5 this should be included in it, but I won't block on it.
Comment 9 Ala Hino 2017-09-26 08:42:14 EDT
After this fix, the output files will still be created under sos_commands dir with the following names:

/var/tmp/sosreport-rich-el73-host02.usersys.redhat.com-20170917173254/sos_commands/vdsm $ ll lvm*

-rw-r--r--. 1 root root 13867 Sep 17 17:33 lvm_lvs_-v_-o_tags_--config_global_locking_type_0_use_lvmetad_0_devices_preferred_names_.dev.mapper._ignore_suspended_devices_1_write_cache_state_0_disable_after_error_count_3_filter_a_.dev.mapper.._r

-rw-r--r--. 1 root root 17886 Sep 17 17:33 lvm_pvs_-v_-o_all_--config_global_locking_type_0_use_lvmetad_0_devices_preferred_names_.dev.mapper._ignore_suspended_devices_1_write_cache_state_0_disable_after_error_count_3_filter_a_.dev.mapper.._r

-rw-r--r--. 1 root root  5927 Sep 17 17:33 lvm_vgs_-v_-o_tags_--config_global_locking_type_0_use_lvmetad_0_devices_preferred_names_.dev.mapper._ignore_suspended_devices_1_write_cache_state_0_disable_after_error_count_3_filter_a_.dev.mapper.._r
Comment 10 Avihai 2017-10-01 08:11:06 EDT
verified on 4.19.33-1 .


ll lvm*
-rw-r--r--. 1 root root 10186 Oct  1 14:55 lvm_lvs_-v_-o_tags_--config_global_locking_type_0_use_lvmetad_0_devices_preferred_names_.dev.mapper._ignore_suspended_devices_1_write_cache_state_0_disable_after_error_count_3_filter_a_.dev.mapper.._r
-rw-r--r--. 1 root root 13531 Oct  1 14:55 lvm_pvs_-v_-o_all_--config_global_locking_type_0_use_lvmetad_0_devices_preferred_names_.dev.mapper._ignore_suspended_devices_1_write_cache_state_0_disable_after_error_count_3_filter_a_.dev.mapper.._r
-rw-r--r--. 1 root root  5335 Oct  1 14:55 lvm_vgs_-v_-o_tags_--config_global_locking_type_0_use_lvmetad_0_devices_preferred_names_.dev.mapper._ignore_suspended_devices_1_write_cache_state_0_disable_after_error_count_3_filter_a_.dev.mapper.._r

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