Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1451490 - [RFE] Ansible should check if Fluentd and Collectd packages are installed and install if missing
[RFE] Ansible should check if Fluentd and Collectd packages are installed and...
Status: CLOSED CURRENTRELEASE
Product: ovirt-engine-metrics
Classification: oVirt
Component: RFEs (Show other bugs)
unspecified
Unspecified Unspecified
high Severity high
: ovirt-4.1.5
: ---
Assigned To: Shirly Radco
Lukas Svaty
: FutureFeature
Depends On:
Blocks: oVirt-Metrics-and-Logs
  Show dependency treegraph
 
Reported: 2017-05-16 15:09 EDT by Shirly Radco
Modified: 2017-08-28 22:37 EDT (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
This release adds the list of required collectd and fluentd packages to the metrics script, and installs them if missing. Previously, there were cases where the packages were available in the repository and required for the metrics setup script, but were not installed, causing the configuration to fail. Now, the missing packages are installed.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-08-23 04:04:42 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: Metrics
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
rule-engine: ovirt‑4.1+
ylavi: planning_ack+
sradco: devel_ack+
pstehlik: testing_ack+


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 78332 master MERGED Check and install missing collectd and fluentd packages 2017-07-06 04:44 EDT
oVirt gerrit 79095 master MERGED ansible: update package installation to run first 2017-07-09 09:57 EDT

  None (edit)
Description Shirly Radco 2017-05-16 15:09:46 EDT
Description of problem:
We require the Collectd and Fluentd packages as well as the plugins to be installed and latest for running the Ansible script that deploys the configurations.

We need the ansible script to verify that the packages are installed and latest and install/upgrade if not.
Comment 1 Sandro Bonazzola 2017-06-05 03:40:26 EDT
(In reply to Shirly Radco from comment #0)

> We need the ansible script to verify that the packages are installed and
> latest and install/upgrade if not.

when should this script be executed?
Comment 2 Shirly Radco 2017-06-07 09:13:01 EDT
(In reply to Sandro Bonazzola from comment #1)
> (In reply to Shirly Radco from comment #0)
> 
> > We need the ansible script to verify that the packages are installed and
> > latest and install/upgrade if not.
> 
> when should this script be executed?

I was thinking to add this as a separate playbook, since I see that we have a problem in the install/upgrade process and not all of the packages that we expect to have are indeed installed on the hosts.

If this would be fixed then we can later deprecate it.
Comment 3 Yaniv Lavi 2017-06-11 09:40:15 EDT
This seems like the wrong design to me.
The main issue is that infra and integration need to agree on one place where the list of required packages are installed/updated per arch per version.
I think this should be the host, but any design that solves this would be acceptable. Sandro, can you please work with Martin on a suggestion to solve the current mess?
Comment 4 Sandro Bonazzola 2017-06-12 03:56:23 EDT
(In reply to Yaniv Lavi from comment #3)
> Sandro, can you please work with Martin on a suggestion to solve
> the current mess?

I'm on it.
Comment 5 Shirly Radco 2017-06-12 04:07:31 EDT
I have now opened Bug 1460609, Please review it and add additional info as required.
Comment 6 Martin Perina 2017-06-12 04:56:55 EDT
IMO BZ1460609 will solve this issue for 4.2, so it it's needed also to solve in 4.1.z, then we need to fix that with some temporary solution
Comment 7 Yaniv Lavi 2017-06-12 06:44:53 EDT
(In reply to Martin Perina from comment #6)
> IMO BZ1460609 will solve this issue for 4.2, so it it's needed also to solve
> in 4.1.z, then we need to fix that with some temporary solution

Do we prefer to do a different fix or backport BZ1460609 ? 
We have a lot of issues around this topic.
Comment 8 Martin Perina 2017-06-12 06:47:27 EDT
(In reply to Yaniv Lavi from comment #7)
> (In reply to Martin Perina from comment #6)
> > IMO BZ1460609 will solve this issue for 4.2, so it it's needed also to solve
> > in 4.1.z, then we need to fix that with some temporary solution
> 
> Do we prefer to do a different fix or backport BZ1460609 ? 
> We have a lot of issues around this topic.

From my point of view BZ1460609 and BZ1380498 are to huge changes to backport to 4.1.z
Comment 9 Shirly Radco 2017-06-18 03:37:21 EDT
I will add a separate ansible script that will install/update the required packages for 4.1.z. We can later deprecate it.
Comment 10 Shirly Radco 2017-06-20 08:53:08 EDT
Comment to QE, I used the same code as in centos-opstools/opstools-ansible and the code checks if the packages are installed and install if missing. It does not upgrade already installed packages.
Comment 11 Shirly Radco 2017-06-20 08:56:55 EDT
In order for the ansible playbook to check and install missing packages and plugins, it is required to add in the command line:
--extra-vars "manage_packages=true"
Comment 12 Shirly Radco 2017-07-05 05:17:01 EDT
Comment #11 is not relevant anymore.

The metrics setup script will now try to install the packages required to fluentd and collectd, if they are missing, it will not update existing packages.

The package installation can be disabled by adding to the config.yml:
manage_packages: false
Comment 13 Lukas Svaty 2017-07-18 12:26:40 EDT
There is unwanted scenario here. When packages are not available on host and nor in the repositories (no subscription) Playbook will fail and wont continue to other hosts and engine setup.

tested in ovirt-engine-metrics-1.0.5-1.el7ev.noarch


There is unwanted scenario here. When packages are not available on host and nor in the repositories (no subscription) Playbook will fail and wont continue to other hosts and engine setup.

Desired scenario would be, fail the single host playbook, and continue setting up other resources.

tested in ovirt-engine-metrics-1.0.5-1.el7ev.noarch

[root@ls-engine1 ~]# /usr/share/ovirt-engine-metrics/setup/ansible/configure_ovirt_machines_for_metrics.sh 

PLAY [Configure Fluentd on nodes] ********************************************************************************

TASK [Gathering Facts] ********************************************************************************
ok: [1.2.3.4]

TASK [ovirt_fluentd/read_local_ca_cert : Check if local fluentd certificate exists] ********************************************************************************
ok: [1.2.3.4 -> localhost]

TASK [ovirt_fluentd/read_local_ca_cert : Read fluentd certificate] ********************************************************************************
ok: [1.2.3.4]

TASK [ovirt_fluentd/ovirt_host_packages : Install fluentd host plugins] ********************************************************************************
failed: [1.2.3.4] (item=fluentd) => {"changed": false, "failed": true, "item": "fluentd", "msg": "There are no enabled repos.\n Run \"yum repolist all\" to see the repos you have.\n To enable Red Hat Subscription Management repositories:\n     subscription-manager repos --enable <repo>\n To enable custom repositories:\n     yum-config-manager --enable <repo>\n", "rc": 1, "results": []}
failed: [1.2.3.4] (item=rubygem-fluent-plugin-collectd-nest) => {"changed": false, "failed": true, "item": "rubygem-fluent-plugin-collectd-nest", "msg": "There are no enabled repos.\n Run \"yum repolist all\" to see the repos you have.\n To enable Red Hat Subscription Management repositories:\n     subscription-manager repos --enable <repo>\n To enable custom repositories:\n     yum-config-manager --enable <repo>\n", "rc": 1, "results": []}
failed: [1.2.3.4] (item=rubygem-fluent-plugin-rewrite-tag-filter) => {"changed": false, "failed": true, "item": "rubygem-fluent-plugin-rewrite-tag-filter", "msg": "There are no enabled repos.\n Run \"yum repolist all\" to see the repos you have.\n To enable Red Hat Subscription Management repositories:\n     subscription-manager repos --enable <repo>\n To enable custom repositories:\n     yum-config-manager --enable <repo>\n", "rc": 1, "results": []}
failed: [1.2.3.4] (item=rubygem-fluent-plugin-secure-forward) => {"changed": false, "failed": true, "item": "rubygem-fluent-plugin-secure-forward", "msg": "There are no enabled repos.\n Run \"yum repolist all\" to see the repos you have.\n To enable Red Hat Subscription Management repositories:\n     subscription-manager repos --enable <repo>\n To enable custom repositories:\n     yum-config-manager --enable <repo>\n", "rc": 1, "results": []}
failed: [1.2.3.4] (item=rubygem-fluent-plugin-viaq_data_model) => {"changed": false, "failed": true, "item": "rubygem-fluent-plugin-viaq_data_model", "msg": "There are no enabled repos.\n Run \"yum repolist all\" to see the repos you have.\n To enable Red Hat Subscription Management repositories:\n     subscription-manager repos --enable <repo>\n To enable custom repositories:\n     yum-config-manager --enable <repo>\n", "rc": 1, "results": []}

PLAY RECAP ********************************************************************************
1.2.3.4               : ok=3    changed=0    unreachable=0    failed=1
Comment 14 Red Hat Bugzilla Rules Engine 2017-07-18 13:42:00 EDT
Target release should be placed once a package build is known to fix a issue. Since this bug is not modified, the target version has been reset. Please use target milestone to plan a fix for a oVirt release.
Comment 15 Shirly Radco 2017-07-19 08:50:21 EDT
Please attach the full playbook output.
Comment 16 Lukas Svaty 2017-07-19 08:52:21 EDT
see commenr#13
Comment 17 Shirly Radco 2017-07-19 09:12:08 EDT
This lists only 1 host.

Please run with several hosts and have only one missing repository
and see if the playbook fails or continues to run for the other hosts.

If it only fails for the host that is missing the packages then this is required result.
Comment 18 Lukas Svaty 2017-07-19 09:52:35 EDT
I dont see engine being configured.
Comment 19 Shirly Radco 2017-07-27 04:12:00 EDT
I believe that the reason that caused the qa test to fail is due to a different issue and not an issue with this patch.

Please have the repository available for the node to be able to install update the packages.

Opened Bug #1475707. It is expected that if such a case happens, the user will fix the issues in the node and will run the script again.
Comment 20 Lukas Svaty 2017-08-03 11:52:05 EDT
verified in ovirt-engine-metrics-1.0.6-1.el7ev.noarch

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