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

Bug 1855501 (OCPRHV-254)

Summary: OCPRHV-254: ovirt: destroy cluster should remove template
Product: OpenShift Container Platform Reporter: Douglas Schilling Landgraf <dougsland>
Component: InstallerAssignee: Douglas Schilling Landgraf <dougsland>
Installer sub component: OpenShift on RHV QA Contact: Guilherme Santos <gdeolive>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: medium CC: beth.white, rgolan
Version: 4.6Keywords: Triaged
Target Milestone: ---   
Target Release: 4.6.0   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-10-27 16:13:42 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:

Description Douglas Schilling Landgraf 2020-07-10 03:11:43 UTC
Description of problem:

The destroy cluster command do not remove the template created during the OCP deploy. It keep consuming resource from oVirt.

The issue is related to:
https://github.com/openshift/installer/blob/85092be98f2e913e3ea9b45622b73c3bc44d6e98/pkg/destroy/ovirt/destroyer.go#L120

The search uses: "name=%s" but the template is created using: TAGNAME-rhcos making the search cmd fail.

Comment 2 Roy Golan 2020-07-12 09:42:58 UTC
(In reply to Douglas Schilling Landgraf from comment #0)
> Description of problem:
> 
> The destroy cluster command do not remove the template created during the
> OCP deploy. It keep consuming resource from oVirt.
> 
> The issue is related to:
> https://github.com/openshift/installer/blob/
> 85092be98f2e913e3ea9b45622b73c3bc44d6e98/pkg/destroy/ovirt/destroyer.go#L120
> 
> The search uses: "name=%s" but the template is created using: TAGNAME-rhcos
> making the search cmd fail.

The template name ${cluster-id}-rhcos and the search is already a wildcard search. 

I think the real reason is a bug in pkg/asset/cluster/ovirt/ovirt.go which gzaidman sent a PR to not long ago
but I don't see it for some reason.

Comment 3 Roy Golan 2020-07-12 09:53:55 UTC
my bad, the UI probably adds wildcards? from the sdk wildcard are not added.

Comment 4 Guilherme Santos 2020-07-22 12:35:09 UTC
Verified on:
4.6.0-0.nightly-2020-07-22-074636

Steps:
1. # openshift-install create cluster --log-level=debug --dir=resources
2. once it's install, destroy it:
# openshift-install destroy cluster --dir=resources
3. check on engine UI is template is there (Compute -> Templates)

Results:
template created for ocp install deleted

Comment 7 errata-xmlrpc 2020-10-27 16:13:42 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 (OpenShift Container Platform 4.6 GA Images), 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/RHBA-2020:4196