Bug 2081676 - --log-size option does not limit the size of the logs from the hypervisor
Summary: --log-size option does not limit the size of the logs from the hypervisor
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-log-collector
Classification: oVirt
Component: General
Version: 4.4.5
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ovirt-4.5.2
: 4.4.6
Assignee: Lev Veyde
QA Contact: Barbora Dolezalova
URL:
Whiteboard:
Depends On:
Blocks: 2104831
TreeView+ depends on / blocked
 
Reported: 2022-05-04 10:57 UTC by Barbora Dolezalova
Modified: 2022-09-08 18:24 UTC (History)
4 users (show)

Fixed In Version: ovirt-log-collector-4.4.7
Doc Type: Bug Fix
Doc Text:
Previously, when two mutually exclusive sos report options were used in the ovirt-log-collector, the log size limit was ignored. In this release, the limit on the size of the log per plugin works as expected.
Clone Of:
Environment:
Last Closed: 2022-08-30 08:47:42 UTC
oVirt Team: Integration
Embargoed:
pm-rhel: ovirt-4.5?
gdeolive: testing_ack+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github oVirt ovirt-log-collector pull 17 0 None open ovirt-log-collector: Clarified the --log-size option meaning 2022-05-31 14:26:50 UTC
Github oVirt ovirt-log-collector pull 21 0 None open Bz2081676 2022-06-20 19:43:24 UTC
Red Hat Issue Tracker RHV-45934 0 None None None 2022-05-04 11:02:27 UTC

Description Barbora Dolezalova 2022-05-04 10:57:19 UTC
Description of problem:

If --log-size option is specified with different values there is always the same size of the archive with log files in MiB.
When collecting information from 3 hypervisors the size of the logs is independent on --log-size parameter.

Version-Release number of selected component (if applicable): 
ovirt-log-collector-4.4.5-1.el8ev.noarch

How reproducible: 
Always


Steps to Reproduce:
a. /usr/bin/ovirt-log-collector --log-size=0
b. /usr/bin/ovirt-log-collector --log-size=5
c. /usr/bin/ovirt-log-collector --log-size=10

Actual results:
The sha256 for this file is 45239b1c0fb37c81166ac20420e6b7a722e7e6e5904ef33c32752b8ecaf4f4e0 and its size is 104.1M

Comment 2 Lev Veyde 2022-05-19 12:07:14 UTC
(In reply to Barbora Dolezalova from comment #0)
> Description of problem:
> 
> If --log-size option is specified with different values there is always the
> same size of the archive with log files in MiB.
> When collecting information from 3 hypervisors the size of the logs is
> independent on --log-size parameter.
> 
> Version-Release number of selected component (if applicable): 
> ovirt-log-collector-4.4.5-1.el8ev.noarch
> 
> How reproducible: 
> Always
> 
> 
> Steps to Reproduce:
> a. /usr/bin/ovirt-log-collector --log-size=0
> b. /usr/bin/ovirt-log-collector --log-size=5
> c. /usr/bin/ovirt-log-collector --log-size=10
> 
> Actual results:
> The sha256 for this file is
> 45239b1c0fb37c81166ac20420e6b7a722e7e6e5904ef33c32752b8ecaf4f4e0 and its
> size is 104.1M

The --log-size parameter is equivalent to the same parameter of the sos report. I think that the manual may be a bit confusing if not read carefully.


From sos 4.1.x man page:
       --log-size
              Places a global limit on the size (in MiB) of any collected set of logs. The limit is applied separately for each set of logs collected by any plugin.


The man page of the sos 4.2.x clarifies it a bit:
       --log-size
              Places a limit on the size of collected logs and output in MiB. Note that this causes sos to capture the last X amount of the file or command output collected.

              By default, this is set to 25 MiB and applies to all files and command output collected with the exception of journal collections, which are limited to 100 MiB.

              Setting this value to 0 removes all size limitations, and any files or commands collected will be collected in their entirety, which may drastically increase the size of  the  final  sos
              report tarball and the memory usage of sos during collection of commands, such as very large journals that may be several GiB in size.



Note that it's a limit on the size of the each individual sos plugin, not a limit on the final size of the report.
I think a world "global" may have been confusing a bit, since it's meaning is "a global configuration setting" used for all plugins, NOT a global limit on the total size of the combined report.


Generally speaking, implementing a limit on the combined size of the report doesn't make much sense, as what is the best option to cut the combined output size so it will fit into the limit?
Is it to simply pack the data until the limit is reached? That will include data only from some of the plugins.
Is it to cut the logs proportionally? May be cut only logs above certain size? Etc. etc.
In practice it will require implementing a set of configuration options to control this downsizing process, and this is probably why it hasn't been implemented in sos.

So the only thing we can do, is to clarify the help messages of the ovirt-log-collector, so it won't confuse people that don't know all the sos's fine details (or confuse them less).

Comment 3 Barbora Dolezalova 2022-06-13 14:33:49 UTC
Thanks Lev for clarification.
So did I got it right there supposed to be a cut of all log files from hosts e.g. vdsm log or messages log? Because it failed for me.

Tested with ovirt-log-collector-4.4.6-1.el8ev.noarch

I did run ovirt-log-collector --log-size=1 and it contained:
-rw-------. 1 root root 2.1M Jun 13 17:08 ./sosreport-10-37-138-22-2022-06-13-wfiolxu/var/log/messages
-rw-r--r--. 1 vdsm kvm 2.2M Jun 13 16:45 ./sosreport-10-37-138-22-2022-06-13-uadtxuc/var/log/vdsm/vdsm.log

Comment 4 Lev Veyde 2022-06-20 09:21:04 UTC
(In reply to Barbora Dolezalova from comment #3)
> Thanks Lev for clarification.
> So did I got it right there supposed to be a cut of all log files from hosts
> e.g. vdsm log or messages log? Because it failed for me.
> 
> Tested with ovirt-log-collector-4.4.6-1.el8ev.noarch
> 
> I did run ovirt-log-collector --log-size=1 and it contained:
> -rw-------. 1 root root 2.1M Jun 13 17:08
> ./sosreport-10-37-138-22-2022-06-13-wfiolxu/var/log/messages
> -rw-r--r--. 1 vdsm kvm 2.2M Jun 13 16:45
> ./sosreport-10-37-138-22-2022-06-13-uadtxuc/var/log/vdsm/vdsm.log

That is weird... It's looks like as if the --log-size option is somehow wasn't properly passed by us to the sos report, or it ignored it for some reason.
I'll check if we can add a bit more debugging there.

Comment 5 Lev Veyde 2022-06-20 19:42:07 UTC
Looks like we have a real issue here, as the --log-size option is conflicting with the --all-logs option.

I sent a new PR that fixes that issue, as well as implements some additional logic for enabling the logs plugin only in case the --log-size value is 100 (MB) or more.

Comment 6 Lucie Leistnerova 2022-06-23 10:41:22 UTC
RC build for 4.5.1 already done, not containing the fix. Moving to 4.5.2

Comment 7 Sandro Bonazzola 2022-07-05 13:31:41 UTC
Moving back to MODIFIED as per comment #6

Comment 8 Sandro Bonazzola 2022-07-07 08:54:42 UTC
Lev can you please fill DocText if this fix needs to be documented?

Comment 9 Lev Veyde 2022-07-07 10:13:14 UTC
Filled the DocText

Comment 11 Barbora Dolezalova 2022-08-08 08:45:20 UTC
Verified in ovirt-log-collector-4.4.7-1.el8ev.noarch

Comment 12 Sandro Bonazzola 2022-08-30 08:47:42 UTC
This bugzilla is included in oVirt 4.5.2 release, published on August 10th 2022.
Since the problem described in this bug report should be resolved in oVirt 4.5.2 release, it has been closed with a resolution of CURRENT RELEASE.
If the solution does not work for you, please open a new bug report.


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