Bug 977863

Summary: --local-tmp option ignored, default value for --local-tmp ignored
Product: Red Hat Enterprise Virtualization Manager Reporter: Julio Entrena Perez <jentrena>
Component: ovirt-engine-log-collectorAssignee: Kiril Nesenko <knesenko>
Status: CLOSED ERRATA QA Contact: sefi litmanovich <slitmano>
Severity: low Docs Contact:
Priority: low    
Version: 3.2.0CC: acathrow, akotov, dconsoli, dfediuck, flo_bugzilla, iheim, jentrena, jkt, knesenko, kroberts, Rhev-m-bugs, sbonazzo, ylavi
Target Milestone: ---   
Target Release: 3.3.0   
Hardware: All   
OS: Linux   
Whiteboard: integration
Fixed In Version: rhevm-log-collector-3.3.0-1.el6ev Doc Type: Bug Fix
Doc Text:
The --local-tmp option should create a tarball in the specified directory, however the tarball was always created under /tmp. Now, the --local-tmp option behaves as expected, and generates a tarball in the specified directory.
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-21 16:59:43 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:

Description Julio Entrena Perez 2013-06-25 13:38:55 UTC
Description of problem:
rhevm-log-collector ignores both specified directory in "--local-tmp" option and default output directory documented in its man page:

man rhevm-log-collector

--local-tmp=PATH
Local directory where reports are copied (default=/tmp/logcollector).
                                          ^^^^^^^^^^^^^^^^^^^^^^^^^
Output tarball file is created in /tmp.

Version-Release number of selected component (if applicable):
rhevm-log-collector-3.2.2-3.el6ev

How reproducible:
Always.

Steps to Reproduce:
1. Run "rhevm-log-collector" or "rhevm-log-collector --local-tmp=/tmp/logcollector".
2. Observe location for output tarball file.
3.

Actual results:
# rhevm-log-collector --local-tmp=/tmp/logcollector
[...]
INFO: /tmp/logcollector does not exist.  It will be created.        <-----
[...]
Creating compressed archive...
INFO: Log files have been collected and placed in /tmp/sosreport-LogCollector-20130625143213.tar.xz.
The MD5 for this file is 67d5fc7b0f2cd1fef083bdbfe1c92dbe and its size is 4.3M

Expected results:
INFO: Log files have been collected and placed in /tmp/logcollector/sosreport-LogCollector-20130625143213.tar.xz.

Additional info:

Comment 2 Sandro Bonazzola 2013-07-26 08:46:27 UTC
rhevm-log-collector-3.2.2-4.el6.noarch

# rhevm-log-collector --help
  --local-tmp=PATH      directory to copy reports to locally (default is
                        randomly generated like: /tmp/logcollector-KmyQ5Z)

the man page is outdated.

Please note that the local-tmp directory is used only for storing temporary reports gathered from hypervisors.
The final output report is always stored in $TMPDIR

We can add a --output flag for telling where to store the final report or
force the output in the same directory used for gathering tmp reports.
As workaround TMPDIR can be set in env with the desired path.

Comment 3 akotov 2013-08-20 10:47:58 UTC
Pretty dangerous outdated man page, because --local-tmp gets deleted after command is finished, therefore customers could lose other log data in their designated logoutput directory

Comment 4 Keith Robertson 2013-08-20 14:12:50 UTC
(In reply to akotov from comment #3)
> Pretty dangerous outdated man page, because --local-tmp gets deleted after
> command is finished, therefore customers could lose other log data in their
> designated logoutput directory

Sandro is correct and I think his suggestion of '--output' makes the most sense.

I do not agree with the sentiment that it is 'dangerous'.  The local-tmp was never intended to be the place from which a customer would look for the resulting SoS archive; hence, 'tmp'.  It is simply a place where the LC can collate, on disk, everything that it is preparing to compress into an uber SoS report.  A staging area if you will.

Comment 5 Sandro Bonazzola 2013-08-21 07:03:05 UTC
(In reply to Keith Robertson from comment #4)

> Sandro is correct and I think his suggestion of '--output' makes the most
> sense.

I'll fix this adding --output and updating man page and --help.
I've a few bugs with higher priority but I'll try to fix this soon as well, since we've 3 customer portal reference on this bug.

Comment 6 Sandro Bonazzola 2013-09-03 09:34:19 UTC
patch 18781 merged upstream master, needs to be backported to 3.3 branch

Comment 7 Sandro Bonazzola 2013-09-03 09:34:57 UTC
Add new --output option.
* Added --output option to store the LC report
* Update the man page accordingly

Comment 9 sefi litmanovich 2013-09-23 16:24:36 UTC
Verified on rhevm 3.3 , IS15
rhevm-log-collector-3.3.0-1.el6ev

Comment 10 Charlie 2013-11-28 01:16:55 UTC
This bug is currently attached to errata RHBA-2013:15255. If this change is not to be documented in the text for this errata please either remove it from the errata, set the requires_doc_text flag to 
minus (-), or leave a "Doc Text" value of "--no tech note required" if you do not have permission to alter the flag.

Otherwise to aid in the development of relevant and accurate release documentation, please fill out the "Doc Text" field above with these four (4) pieces of information:

* Cause: What actions or circumstances cause this bug to present.
* Consequence: What happens when the bug presents.
* Fix: What was done to fix the bug.
* Result: What now happens when the actions or circumstances above occur. (NB: this is not the same as 'the bug doesn't present anymore')

Once filled out, please set the "Doc Type" field to the appropriate value for the type of change made and submit your edits to the bug.

For further details on the Cause, Consequence, Fix, Result format please refer to:

https://bugzilla.redhat.com/page.cgi?id=fields.html#cf_release_notes 

Thanks in advance.

Comment 11 errata-xmlrpc 2014-01-21 16:59:43 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.

http://rhn.redhat.com/errata/RHBA-2014-0039.html