Bug 1715511 - Update README for Variable openshift_distribution to include RHV default
Summary: Update README for Variable openshift_distribution to include RHV default
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine-metrics
Classification: oVirt
Component: Generic
Version: 1.3.1
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ovirt-4.4.0
: ---
Assignee: Shirly Radco
QA Contact: Guilherme Santos
URL:
Whiteboard:
Depends On:
Blocks: 1721480
TreeView+ depends on / blocked
 
Reported: 2019-05-30 14:12 UTC by Ivana Saranova
Modified: 2020-04-16 10:36 UTC (History)
3 users (show)

Fixed In Version: rhv-4.4.0-29
Clone Of:
Environment:
Last Closed: 2020-04-16 10:36:08 UTC
oVirt Team: Metrics
Embargoed:
sbonazzo: ovirt-4.3?


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 100653 0 'None' MERGED Update README for openshift_distribution value 2020-04-03 08:42:46 UTC
oVirt gerrit 104527 0 master MERGED Update openshift_distribution variable in README 2020-04-03 08:42:47 UTC

Description Ivana Saranova 2019-05-30 14:12:27 UTC
Description of problem:
When installing metrics store the default value for openshift_distribution is wrong. Default value for openshift_distribution should be 'origin' according to the READMEs and documentation, but if you don't specify this value in the configuration file, playbook assumes you want to install RHEL VMs instead of CentOS (which should happen only if you set openshift_distribution to 'enterprise'). Also setting openshift_distribution to any value - empty, random words - passes successfully and playbook assumes you want to install RHEL VMs.

Version-Release number of selected component (if applicable):
ovirt-engine-4.3.4.1-0.1.el7.noarch
ovirt-engine-metrics-1.3.1-1.el7ev.noarch

How reproducible:
Always

Steps to Reproduce:
1. Prepare configuration files according to the documentation, don't use the  openshift_distribution variable (it's not in the configuration files by default)
2. Run the installation script

` ANSIBLE_JINJA2_EXTENSIONS="jinja2.ext.do" ./configure_ovirt_machines_for_metrics.sh --playbook=ovirt-metrics-store-installation.yml --ask-vault-pass `

3. Check that installation passed successfully.

Actual results:
Installation fails on "msg": "Template with name 'rhelguest76' and version 'None' in cluster 'cluster1' was not found'"

Expected results:
Installation is successful and playbook uses template with name 'centos76'.

Additional info:
After further inspection, the problem seems to be with the default value not being set in the proper role.

Comment 1 Shirly Radco 2019-05-30 15:10:48 UTC
Please attach ansible log

Comment 2 Ivana Saranova 2019-05-31 10:20:58 UTC
Sorry for the delay. 

After inspecting the configuration files further, I noticed that there is a file name 10-rhv_vars.yml, which is not documented in the official documentation or README for the metrics installation role and has the variable openshift_distribution set to the non default value "openshift-enterprise", causing the default value of openshift_distribution not being used. This file is in the official package. If I delete the file, the default value is used.

If I set the variable openshift_distribution to empty or anything neither 'origin' nor 'openshift-enterprise', playbook expects a RHEL template and fails. There should be some sort of validation for the correct values.


Ansible log:

TASK [oVirt.vm-infra : Wait for VMs to be added] *******************************************
[DEPRECATION WARNING]: evaluating create_openshift_bastion_vm as a bare variable, this 
behaviour will go away and you might need to add |bool to the expression in the future. 
Also see CONDITIONAL_BARE_VARS configuration toggle.. This feature will be removed in 
version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in
 ansible.cfg.
FAILED - RETRYING: Wait for VMs to be added (21 retries left).
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ValueError: Template with name 'rhelguest76' and version 'None' in cluster 'cluster1' was not found'
failed: [localhost] (item={'failed': False, u'finished': 0, u'results_file': u'/root/.ansible_async/898234832828.32349', u'ansible_job_id': u'898234832828.32349', u'started': 1, 'changed': False}) => {"ansible_job_id": "898234832828.32349", "ansible_loop_var": "item", "attempts": 2, "changed": false, "finished": 1, "item": {"ansible_job_id": "898234832828.32349", "changed": false, "failed": false, "finished": 0, "results_file": "/root/.ansible_async/898234832828.32349", "started": 1}, "msg": "Template with name 'rhelguest76' and version 'None' in cluster 'cluster1' was not found'"}

Comment 3 Shirly Radco 2019-06-03 12:20:33 UTC
In oVirt the default for openshift_distribution is "origin".
In RHV this is overridden by the 10-rhv_vars.yml that updates the variable to "openshift-enterprise".
I will update the README for this variable to explain the value for RHV.

Comment 4 Lucie Leistnerova 2019-07-16 12:59:24 UTC
We don't have capacity now to verify metrics bugs. Moving to async 4.3.5-1.

Comment 5 Jan Zmeskal 2019-07-17 16:01:24 UTC
I tried to verify this with ovirt-engine-metrics-1.3.3.2-1.el7ev.noarch.

First part of the reported issue is verified. I tested this on RHEL-based engine and I can confirm that when I did not specify openshift_distribution variable, "openshift-enterprise" was used in accordance with current README.
However, I don't think I can verify this because the reported (Ivana) also pointed out this: 

Also setting openshift_distribution to any value - empty, random words - passes successfully and playbook assumes you want to install RHEL VMs.

This is still true. In my test run, I set openshift_distibution variable to "dog" in /etc/ovirt-engine-metrics/config.yml.d/metrics-store-config.yml. However, it seems that "openshift-enterprise" was assumed nonetheless. This is caused by the logic operation on line 226 in /usr/share/ansible/roles/oVirt.metrics/roles/oVirt.origin-on-ovirt/tasks/create_openshift_bastion_vm.yml. 

As per description, this BZ should also handle cases when user provides invalid value in openshift_distribution variable. I think in that case it would be best to fail the playbook very early and inform user about what happened. 

Log from verification is attached.

Comment 7 Sandro Bonazzola 2019-08-05 07:01:24 UTC
Moving out to 4.3.6, failed QA on 4.3.5 and not worth an async.

Comment 10 Lukas Svaty 2020-04-16 10:36:08 UTC
Closing low severity bugs, based on QE capacity, if you would like to still verify this issue please reopen.


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