Bug 1512308

Summary: [downstream clone - 4.1.8] [RFE] option to collect logs from one host per cluster
Product: Red Hat Enterprise Virtualization Manager Reporter: rhev-integ
Component: ovirt-log-collectorAssignee: Ala Hino <ahino>
Status: CLOSED ERRATA QA Contact: Lukas Svaty <lsvaty>
Severity: medium Docs Contact:
Priority: high    
Version: 2.1.0CC: ahino, bgraveno, bugs, danken, gveitmic, mkalinin, ylavi
Target Milestone: ovirt-4.1.8Keywords: FutureFeature, Rebase, ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovirt-log-collector-4.1.7-1.el7ev Doc Type: Rebase: Enhancements Only
Doc Text:
This is a rebase of the package to version 4.1.7. A notable enhancement is an option has been added to collect logs from one host per cluster.
Story Points: ---
Clone Of: 1490447 Environment:
Last Closed: 2017-12-12 09:26:16 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Integration RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On: 1490447    
Bug Blocks:    

Description rhev-integ 2017-11-12 15:14:28 UTC
+++ This bug is a downstream clone. The original bug is: +++
+++   bug 1490447 +++
======================================================================

Description of problem:
ovirt-log-collector collects logs from all hosts, which makes its output too big to handle. Specifying a list of hypervisors by name is tedious and error-prone. People tend to be using --no-hypervisor and miss the purpose.

This RFE is about adding a midway --one-hypervisor-per-cluster. When supplied to the script, the script would choose one host per cluster, and collect its logs. The current SPM and the current host of a self-hosted-engine should be included as well.

(Originally by danken)

Comment 1 rhev-integ 2017-11-12 15:14:34 UTC
We would like to backport this to 3.6-els, to ease log collection prior to upgrade.

(Originally by danken)

Comment 3 rhev-integ 2017-11-12 15:14:41 UTC
We would like to backport this to 3.6-els, to ease log collection prior to upgrade.

(Originally by danken)

Comment 5 rhev-integ 2017-11-12 15:14:49 UTC
My 2 cents:
1. If this will be turned off by default, customers won't be using it / will keep using --no-hypervisor
2. "--one-hypervisor-per-cluster" name is too long, I would prefer something shorter and more user-friendly such as 
3. Easy way to fix 1. would be to ask question on --no-hypervisor to include at least 1 or if user is sure that hypervisors should be omitted

QS:
What host do we choose? SPM? With PM? First host? Random host? Does it matter for DEV on debugging side?

(Originally by Lukas Svaty)

Comment 8 Yaniv Kaul 2017-11-14 16:23:08 UTC
Why is the bug still on new state?

Comment 10 Lukas Svaty 2017-11-28 16:09:31 UTC
did not make it to 4.1.8:

ovirt-log-collector-4.1.6-1.el7ev.noarch

Comment 11 Sandro Bonazzola 2017-11-29 08:57:55 UTC
4.1.7 built and attached to errata

Comment 12 Lukas Svaty 2017-11-30 11:07:21 UTC
verified ovirt-log-collector-4.1.7-1.el7ev.noarch

[root@system-ge-1 ~]# ovirt-log-collector --help | grep hypervisor-per-cluster -A 2
    --hypervisor-per-cluster
                        Collect data only from a hypervisor per cluster;
                        choose the SPM if found in a cluster.


[root@system-ge-1 ~]# ovirt-log-collector --hypervisor-per-cluster
This command will collect system configuration and diagnostic
information from this system.
The generated archive may contain data considered sensitive and its
content should be reviewed by the originating organization before
being passed to any third party.
No changes will be made to system configuration.
Please provide the REST API password for the admin@internal oVirt Engine user (CTRL+D to skip): 
INFO: Gathering oVirt Engine information...
INFO: Gathering PostgreSQL the oVirt Engine database and log files from localhost...
About to collect information from 1 hypervisors. Continue? (Y/n): Y
INFO: Gathering information from selected hypervisors...
INFO: collecting information from system-ge-host-2.example.com
INFO: finished collecting information from system-ge-host-2.example.com
Creating compressed archive...
INFO: Log files have been collected and placed in /tmp/sosreport-LogCollector-20171130123726.tar.xz.
The MD5 for this file is 19208ae134df9b1dd76d7af542c8e05a and its size is 24.4M


Archive contains sosreport from single host.

Testing with empty clusters/data centers -> ignored.

Testing with 2 clusters (2 and 1 hosts) -> success

Testing with 2 dcs (2 hosts and 1 host) -> success

Comment 15 errata-xmlrpc 2017-12-12 09:26:16 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, 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-2017:3436