Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1678275

Summary: ovirt-metrics-store-installation.yml fails on creating a bastion VM
Product: [oVirt] ovirt-engine-metrics Reporter: Jan Zmeskal <jzmeskal>
Component: GenericAssignee: Shirly Radco <sradco>
Status: CLOSED CURRENTRELEASE QA Contact: Ivana Saranova <isaranov>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 1.2.0.2CC: bugs, lleistne, sradco
Target Milestone: ovirt-4.3.3Keywords: Regression
Target Release: ---Flags: sradco: ovirt-4.3?
lleistne: testing_ack+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-04-16 13:58:31 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: 1631193    

Description Jan Zmeskal 2019-02-18 12:09:07 UTC
Description of problem:
When you run
/usr/share/ovirt-engine-metrics/configure_ovirt_machines_for_metrics.sh --playbook=ovirt-metrics-store-installation.yml
it fails with the following error: http://pastebin.test.redhat.com/716709

I think I know where the problem is. If you take a look at roles/oVirt.metrics-store-installation/defaults/mainl.yml, you can see that variable template_cluster is set to value of variable ovirt_cluster_name (line 12). 
Then, if user specifies different value for ovirt_cluster_name in their config.yml (which I did), the default value ("Default") is overridden. However, that does not happen for the template_cluster variable. 
Therefore, when oVirt.image-template role gets to the point where it tries to create VM, it's attempting to create it in an invalid cluster ("Default") which does not exist in my environment.

Workaround for this is to go to roles/oVirt.metrics-store-installation/tasks/main.yml, go to this task:

- name: Include oVirt image-template role
  include_role:
    name: oVirt.image-template

And expand it like this:

- name: Include oVirt image-template role
  include_role:
    name: oVirt.image-template
  vars:
    template_cluster: <my_cluster_name>

Then the creation of bastion VM works correctly.


Version-Release number of selected component (if applicable):
ovirt-engine-metrics-1.2.1-0.0.master.20190217232716.el7.noarch.rpm (built from patch set 37 of https://gerrit.ovirt.org/#/c/97643/)

How reproducible:
100 %

Steps to Reproduce:
1. Use this config.yml: http://pastebin.test.redhat.com/716722
2. Run ovirt-metrics-store-installation.yml playbook

Additional info:
- This is a regression since I have not had this issue in version ovirt-engine-metrics-1.2.1-0.0.master.20190214134529.el7.noarch.rpm (built from patchset 29).
- Log from failed attempt is attached to this bug

Comment 2 Jan Zmeskal 2019-02-20 15:50:57 UTC
Shirly, I believe this is already fixed, am I right? If yes, please reference the patch fixing it and put it in ON_QA.

Comment 3 Jan Zmeskal 2019-02-25 13:34:34 UTC
Moving to POST since the patch this BZ depends on (https://gerrit.ovirt.org/#/c/97643/) has not been merged yet. Once it's merged, this can be moved to MODIFIED. Once it's a part of consumable package, this can be moved to ON_QA and verified by QA.

Comment 4 Sandro Bonazzola 2019-03-12 12:54:23 UTC
4.3.1 has been released, please re-target this bug as soon as possible.

Comment 5 Ivana Saranova 2019-04-02 15:58:41 UTC
Steps:
1) set ovirt_cluster_name to cluster which is not Default
2) Run ovirt-metrics-store-installation.yml playbook

Results:
VM is created in correct cluster, playbook ends successfully.

Verified in: 
ovirt-engine-4.2.8.5-0.1.el7ev.noarch
ovirt-engine-metrics-1.2.1.3-1.el7ev.noarch

Also verified in:
ovirt-engine-4.3.3.1-0.1.el7.noarch
ovirt-engine-metrics-1.2.1.3-1.el7ev.noarch

Comment 6 Sandro Bonazzola 2019-04-16 13:58:31 UTC
This bugzilla is included in oVirt 4.3.3 release, published on April 16th 2019.

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