Bug 1727546

Summary: [RFE] Add cleanup option to oVirt metrics playbook
Product: [oVirt] ovirt-engine-metrics Reporter: Shirly Radco <sradco>
Component: RFEsAssignee: Shirly Radco <sradco>
Status: CLOSED CURRENTRELEASE QA Contact: Guilherme Santos <gdeolive>
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: amashah, bugs, emarcus, eslutsky, mgoldboi, pelauter
Target Milestone: ovirt-4.3.8Flags: sradco: ovirt-4.3?
Target Release: 1.3.6.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovirt-engine-metrics-1.3.6.1 Doc Type: Enhancement
Doc Text:
Feature: Add cleanup option to oVirt metrics playbook Reason: User that desided to remove the metrics store requires disabling Collectd, Fluentd (if in 4.2) and setting Rsyslog to default settings or they will get errors for these services on all hosts and engine, once they delete the Metrics store VM. Result: It is now possible to run playbook for handling the services: ./configure_ovirt_machines_for_metrics.sh --playbook=cleanup-ovirt-metrics.yml -vvv
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-01-27 12:56:00 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Metrics RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1761046, 1772506, 1779587    

Description Shirly Radco 2019-07-07 09:01:14 UTC
Description of problem:
Add cleanup option to oVirt metrics playbook.
The cleanup would revert Rsyslog to default conf, stop and disable Collectd service.
If host is 4.2 Fluentd service will be stopped and disabled as well.

Comment 1 Evgeny Slutsky 2019-07-07 09:14:09 UTC
the cleanup script also should handle:
- remove all the created VMs (bastion + Master)
- clean the engine /etc/hosts

Comment 2 Shirly Radco 2019-07-07 09:24:10 UTC
This RFE is about cleaning Collectors configurations.
I believe both removing all the created VMs (bastion + Master)
and cleaning the engine and hosts /etc/hosts are dangerous and should be done manually.

Comment 3 Shirly Radco 2019-11-10 16:13:59 UTC
This can already be done by the following steps:

1. Run:
   # cd /usr/share/ovirt-engine-metrics/
   # ./configure_ovirt_machines_for_metrics.sh  --playbook=manage-ovirt-metrics-services.yml -e "service_state=stopped service_enabled=false service_name=['collectd','fluentd']"


2. Manually stop and delete the metrics store vms

Peter, is adding this to the documentation sufficient?

Comment 4 Shirly Radco 2019-11-17 13:37:52 UTC
Added a playbook for disabling Collectd, Fluentd
and for setting Rsyslog configurations back to default.

Please run:
./configure_ovirt_machines_for_metrics.sh --playbook=cleanup-ovirt-metrics.yml -vvv

Comment 5 Guilherme Santos 2020-01-15 02:18:34 UTC
Verified on:
ovirt-engine-metrics-1.3.6.1-1.el7ev.noarch

Steps:
1. ssh on an engine with metrics configured and running
2. # cd /usr/share/ovirt-engine-metrics
3. # ./configure_ovirt_machines_for_metrics.sh --playbook=cleanup-ovirt-metrics.yml -vvv
4. # ll /etc/rsyslog.d
5. # systemctl status collectd
6. Check Kibana dashboards/discovery

Results:
3. Playbook runs successfully with no errors or failed tasks
4. Rsyslog back to default configuration 
5. collectd service stopped
6. No information about the targeted engine and its hosts on kibana dashboards/discovery

Comment 6 Sandro Bonazzola 2020-01-27 12:56:00 UTC
This bugzilla is included in oVirt 4.3.8 release, published on January 27th 2020.

Since the problem described in this bug report should be
resolved in oVirt 4.3.8 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.

Comment 7 Shirly Radco 2020-02-10 12:24:46 UTC
*** Bug 1799314 has been marked as a duplicate of this bug. ***