Bug 1535179 - [RFE][S-3] CloudForms UI log collection to have option to collect automate model & service dialogs
Summary: [RFE][S-3] CloudForms UI log collection to have option to collect automate mo...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: UI - OPS
Version: 5.9.0
Hardware: All
OS: All
unspecified
medium
Target Milestone: MVP
: 5.10.0
Assignee: Joe Rafaniello
QA Contact: Dmitry Misharov
URL:
Whiteboard:
Depends On:
Blocks: 1555371
TreeView+ depends on / blocked
 
Reported: 2018-01-16 19:23 UTC by Josh Carter
Modified: 2019-02-07 23:01 UTC (History)
10 users (show)

Fixed In Version: 5.10.0.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-02-07 23:00:57 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2019:0212 0 None None None 2019-02-07 23:01:10 UTC

Comment 2 Joe Rafaniello 2018-05-07 14:59:10 UTC
hey Greg,

What is the typical way you'd want the automate model and service dialogs exported?  Are there rake tasks to run?  What do we typically ask users to do to provide this information?

Thanks,
Joe

Comment 3 Tina Fitzgerald 2018-05-08 15:07:59 UTC
Hi Joe,

The Automate model and Service dialogs can be exported through the UI as well as through a rake task. The rake tasks would be useful here.

1. Automate Models
Normally, we'd ask the customer to provide all of the Automate domains, so using the backup rake task makes more sense than the export task which is for a single domain.   
To see what's available:
bin/rake evm:automate:usage
backup:
rake evm:automate:backup BACKUP_ZIP_FILE=filename OVERWRITE=false

2. Service Dialogs
It's probably easier to get all of the Service Dialogs. Instructions and samples here: https://github.com/ManageIQ/manageiq/pull/17241


Let me know if you have any questions.

Thanks,
Tina

Comment 4 Joe Rafaniello 2018-05-10 15:29:05 UTC
+ Jared

I chatted with Jared and it sounds like we have a few options:
1) automatically collect all the domains and dialogs by default with no option
2) one checkbox (collect all the domain and dialogs) (defaulted to checked)
3) one checkbox (collect all the domain and dialogs) (defaulted to unchecked)
4) two checkboxes (one for domains and one for dialogs) (defaulted to checked)
5) two checkboxes (one for domains and one for dialogs) (defaulted to unchecked)

If we add checkbox(es), we'll need to add them to the single server and single zone screens.

If we do 1), I don't think there's any work to do in the UI at all but then the user doesn't have an option about sharing the domains and dialogs.

If we do 2), we should guarantee that most users would gather both the dialogs and domains by default since they won't forget to check the checkbox.  They would still have an option to uncheck it if they really don't want it.

Comment 5 Jared Deubel 2018-05-10 18:06:03 UTC
Adding to what Joe said, I believe that we should stick with option 2 as it will guarantee that we collect the automate domain as well as the diaglogs. If the customer wishes they can uncheck that option. Since this file is small it should not be a problem to collect by default. This will ensure that we have everything that we need and avoid having to drag the case out.

Comment 6 Joe Rafaniello 2018-05-17 21:03:48 UTC
Step 1 refactoring PR is up:  https://github.com/ManageIQ/manageiq/pull/17437

Comment 8 Joe Rafaniello 2018-05-17 21:47:35 UTC
Step 2 refactoring:  consolidate LogFile#name and destination_file_name so we can correctly name the "future" automate dialog/models zips that will be uploaded to the depot:  https://github.com/ManageIQ/manageiq/pull/17438

Comment 9 Joe Rafaniello 2018-05-18 20:33:54 UTC
There's a bug in exporting automate dialogs, we're tracking that here:
https://github.com/ManageIQ/manageiq/issues/17443

Comment 10 Joe Rafaniello 2018-05-18 21:04:06 UTC
Step 3 PR: https://github.com/ManageIQ/manageiq/pull/17445
Honors flag to .synchronize_logs(:export_automate_models_and_dialogs => true)

Comment 11 CFME Bot 2018-05-21 17:10:57 UTC
New commit detected on ManageIQ/manageiq/master:

https://github.com/ManageIQ/manageiq/commit/53f2b84eec2e71cd4ffe71fa8b506c9739f33f75
commit 53f2b84eec2e71cd4ffe71fa8b506c9739f33f75
Author:     Joe Rafaniello <jrafanie>
AuthorDate: Wed May 16 17:16:40 2018 -0400
Commit:     Joe Rafaniello <jrafanie>
CommitDate: Wed May 16 17:16:40 2018 -0400

    Consolidate destination_file_name into LogFile#name

    https://bugzilla.redhat.com/show_bug.cgi?id=1535179

    Builds on top of the refactoring of current/historical log collection
    found in:
    https://github.com/ManageIQ/manageiq/pull/17437

    LogFile#name was generating a name that was similar but yet different
    than the destination_file_name.  This name is not displayed or used in
    the UI, so we can push the logic of building the destination_file_name
    into the name of the LogFile, which is exactly the place we need it to
    differentiate current/historical/automate models/automate dialogs.

 app/models/log_file.rb | 13 +-
 app/models/miq_server/log_management.rb | 15 +-
 spec/models/file_depot_ftp_spec.rb | 4 +-
 spec/models/miq_server/log_management_spec.rb | 10 +-
 4 files changed, 24 insertions(+), 18 deletions(-)

Comment 12 Joe Rafaniello 2018-05-23 15:24:16 UTC
PR to add include_automate_models_and_dialogs 
 to Settings: https://github.com/ManageIQ/manageiq/pull/17467

Comment 13 CFME Bot 2018-05-25 18:31:32 UTC
New commit detected on ManageIQ/manageiq/master:

https://github.com/ManageIQ/manageiq/commit/6fbad9f838f86f650a24517f25dd64fbd4e3589a
commit 6fbad9f838f86f650a24517f25dd64fbd4e3589a
Author:     Joe Rafaniello <jrafanie>
AuthorDate: Thu May 17 11:21:36 2018 -0400
Commit:     Joe Rafaniello <jrafanie>
CommitDate: Thu May 17 11:21:36 2018 -0400

    Export via export_automate_models_and_dialogs flag

    https://bugzilla.redhat.com/show_bug.cgi?id=1535179

 app/models/miq_server/log_management.rb | 56 +-
 app/models/zone.rb | 9 +-
 spec/models/log_file_spec.rb | 9 +-
 spec/models/miq_server/log_management_spec.rb | 97 +-
 spec/support/examples_group/shared_examples_for_log_collection.rb | 6 +-
 5 files changed, 109 insertions(+), 68 deletions(-)

Comment 14 Joe Rafaniello 2018-05-25 21:05:17 UTC
QE:

By default, this option is enabled.  Collecting logs will choose one of the active servers in the list (if you do Zone collect logs, if you pick a server collect logs, it's the only server) and bundle up the automate dialogs and models/domains along with the the regular current/archive logs.

It will look like this in the log depot:

[root@localhost vmdb]# ls -l /home/test/ftp/files/default_1/EVM_1/
total 6740
-rw-r--r--. 1 test test 3911379 May 18 16:56 Archive_region_0_default_1_EVM_1_20171114_132136_20180516_195707.zip
-rw-r--r--. 1 test test  889927 May 18 16:56 Archive_region_0_default_1_EVM_1_20180516_195713_20180517_032559.zip
-rw-r--r--. 1 test test  284611 May 18 16:56 Archive_region_0_default_1_EVM_1_20180517_032602_20180518_134950.zip
-rw-r--r--. 1 test test 1297150 May 18 16:56 Current_region_0_default_1_EVM_1_20180518_152247_20180518_165608.zip
-rw-r--r--. 1 test test    2719 May 18 16:56 Dialogs_region_0_default_1_EVM_1.zip
-rw-r--r--. 1 test test  506811 May 18 16:56 Models_region_0_default_1_EVM_1.zip


To disable this feature

1) you can do it in the advanced settings of each server by changing the value from true to false in log/collection/include_automate_models_and_dialogs  OR by script:

bin/rails c
rb(main):001:0> MiqServer.my_server.id
=> 4253000000000001

./tools/configure_server_settings.rb -s 4253000000000001 -p log/collection/include_automate_models_and_dialogs -v false -t boolean -f --dry-run

Confirm the changes look ok:
Change [log/collection/include_automate_models_and_dialogs], old class: [TrueClass], new class: [FalseClass]
Setting [log/collection/include_automate_models_and_dialogs], old value: [true], new value: [false]

Then run it without the dry run option to set it:
./tools/configure_server_settings.rb -s 4253000000000001 -p log/collection/include_automate_models_and_dialogs -v false -t boolean -f


This can be scripted for all servers by doing something like this:

bin/rails c

> MiqServer.all.each {|s| `#{Rails.root.join("tools", "configure_server_settings.rb")} -s #{s.id} -p log/collection/include_automate_models_and_dialogs -v false -t boolean -f` }

Comment 15 Dmitry Misharov 2018-07-18 07:51:36 UTC
Verified in 5.10.0.4.20180712211305_e6e4542. "include_automate_models_and_dialogs" is presented in advanced settings and respectful logs are collected.

Comment 16 errata-xmlrpc 2019-02-07 23:00:57 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/RHSA-2019:0212


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