Bug 1858418

Summary: [OCPonRHV] OpenShift installer fails when Blank template is missing in oVirt/RHV
Product: OpenShift Container Platform Reporter: ldenny
Component: InstallerAssignee: Janos Bonic <jpasztor>
Installer sub component: OpenShift on RHV QA Contact: Michael Burman <mburman>
Status: CLOSED ERRATA Docs Contact:
Severity: low    
Priority: low CC: dougsland, jpasztor, mburman, rcernin
Version: 4.3.z   
Target Milestone: ---   
Target Release: 4.11.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-08-10 10:35:34 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2082283    
Bug Blocks:    

Description ldenny 2020-07-17 21:30:37 UTC
Description of problem:

When running `openshift-install create cluster` I get the following error:
~~~
ERROR Error: your query returned no results, please change your search criteria and try again 
ERROR                                              
ERROR   on ../../../../tmp/openshift-install-530802440/template/main.tf line 11, in data "ovirt_templates" "osImage": 
ERROR   11: data "ovirt_templates" "osImage" {
~~~

Looking at `data/data/ovirt/template/main.tf`[1] we can see it is looking for a template named `name=${var.openstack_base_image_name}` OR `name=Blank`

I don't have a template named Blank, in my environment mine is named Blank1 and this is not captured in the above search criteria.

Changing `name=Blank` to `name=Blank*` captures my template name and allows the install to complete.

I believe the template named `Blank` is the default in Ovirt, I am not sure how mine ended up as 'Blank1' but it seems to be a pretty easy issue to mitigate.

[1]https://github.com/openshift/installer/blob/30682e748f91c47b2f612fee65cc19926ca59965/data/data/ovirt/template/main.tf#L11-L16


Version-Release number of the following components:
~~~
$ openshift-install version
openshift-install 4.5.0-0.okd-2020-07-14-153706-ga

[root@ovirt ~]# rpm -q ansible
ansible-2.9.10-1.el7.noarch

[root@ovirt ~]# ansible --version
ansible 2.9.10

[root@ovirt ~]# rpm -q ovirt-engine
ovirt-engine-4.3.10.4-1.el7.noarch
~~~

How reproducible:
Every time. It can be manually worked around by creating a template called "Blank" in Ovirt.

Comment 1 Sandro Bonazzola 2020-09-14 09:31:32 UTC
Douglas is not available, re-assigning and re-evaluating for upcoming sprint.

Comment 2 Sandro Bonazzola 2020-10-22 11:36:01 UTC
due to capacity constraints we will be revisiting this bug in the upcoming sprint

Comment 3 Sandro Bonazzola 2020-12-03 12:50:10 UTC
Need to understand in what situation make sense to not have blank template around.

Comment 8 Gal Zaidman 2021-01-27 08:52:25 UTC
due to capacity constraints we will be revisiting this bug in the upcoming sprint

Comment 11 Sandro Bonazzola 2021-03-09 12:10:14 UTC
Moving back to NEW, no relevant patch open for this bug.

Comment 12 Gal Zaidman 2021-03-30 13:38:08 UTC
due to capacity constraints, we will be revisiting this bug in the upcoming sprint

Comment 13 Gal Zaidman 2021-05-10 12:29:30 UTC
due to capacity constraints, we will be revisiting this bug in the upcoming sprint

Comment 14 Janos Bonic 2021-07-01 11:07:49 UTC
Still an issue, will be fixed when we switch to the new client library and add template finding logic.

Comment 15 Gal Zaidman 2021-07-05 12:40:16 UTC
(In reply to Janos Pasztor from comment #14)
> Still an issue, will be fixed when we switch to the new client library and
> add template finding logic.

Will be fixed by https://github.com/openshift/installer/pull/5034

Comment 17 Janos Bonic 2021-11-24 20:03:09 UTC
Added a PR in go-ovirt-client that attempts to resolve this issue by scanning templates if they are truly blank.

Comment 21 Janos Bonic 2022-06-21 07:09:03 UTC
Fixed in 2082283

Comment 22 Michael Burman 2022-06-21 08:28:34 UTC
(In reply to Janos Bonic from comment #21)
> Fixed in 2082283

Fixed in bz 2082283

Comment 23 Michael Burman 2022-06-23 13:00:16 UTC
The issue is gone.
Such terraform errors no longer visible in the installer.

Also important to state that it's no longer possible to delete the 'Blank' Template from the RHV manager. 
It is possible to change the name to 'Blank1' or to any other name. Edit the the template's description and comment.
Installation with blank template called 'Blank1' is successful now. 

Verified on - 4.11.0-0.nightly-2022-06-22-235234 and rhvm-4.5.1.2-0.11.el8ev.noarch

Comment 25 errata-xmlrpc 2022-08-10 10:35:34 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 (Important: OpenShift Container Platform 4.11.0 bug fix and security update), 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-2022:5069