Bug 1852720

Summary: vSphere IPI - cluster destroy leaves installer tags
Product: OpenShift Container Platform Reporter: jima
Component: InstallerAssignee: Abhinav Dahiya <adahiya>
Installer sub component: openshift-installer QA Contact: jima
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: medium CC: adahiya, adeshpan, antgarci, dphillip, jima, padillon
Version: 4.5   
Target Milestone: ---   
Target Release: 4.5.z   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: The installer attempted to remove tags before all the resources with those tags were removed. Consequence: It failed to remove the tags. Fix: The installer now removes tags after resources were deleted. Result: Installer tags are removed.
Story Points: ---
Clone Of: 1846125 Environment:
Last Closed: 2020-09-08 10:54:03 UTC Type: ---
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: 1846125    
Bug Blocks:    

Description jima 2020-07-01 07:10:38 UTC
+++ This bug was initially created as a clone of Bug #1846125 +++


Description of problem:

When openshift-install destroy cluster is run the VMs and folder are deleted but any tags by the installer are left in place.

How reproducible:

Steps to Reproduce:
1. Run openshift-install create cluster
2. Run openshift-install destroy cluster
3. All tags from previous installations are still present.

https://github.com/openshift/installer/blob/master/pkg/destroy/vsphere/vsphere.go#L157-L193

Expected results:
Tags are deleted with other objects.

--- Additional comment from Brenton Leanhardt on 2020-06-18 18:09:09 UTC ---

During triage we were not able to prioritize this bug.  Deferring...

Comment 1 jima 2020-07-01 07:34:08 UTC
The impact for this issue is that when destroying the cluster, the tags on vsphere server is still there, since this is not release blocked issue, so set target release as 4.5.z.

Comment 2 Abhinav Dahiya 2020-07-10 16:35:05 UTC
Still blocked on having the bug fixed in 4.6

Comment 5 jima 2020-08-21 05:52:35 UTC
Verified on nightly build 4.5.0-0.nightly-2020-08-20-235458 and passed.
Checked on vcenter client, tags are deleted after running openshift_install destroy cluster.

time="2020-08-21T05:49:26Z" level=debug msg="OpenShift Installer 4.5.0-0.nightly-2020-08-20-235458"
time="2020-08-21T05:49:26Z" level=debug msg="Built from commit d104265b789bf49148597f7247e278a18d6919c3"
time="2020-08-21T05:49:26Z" level=debug msg="find attached objects on tag"
time="2020-08-21T05:49:27Z" level=debug msg="find VirtualMachine objects"
time="2020-08-21T05:49:27Z" level=debug msg="delete VirtualMachines"
time="2020-08-21T05:49:27Z" level=info msg=Destroyed VirtualMachine=jimavmc45-wr962-rhcos
time="2020-08-21T05:49:28Z" level=debug msg="Powered off" VirtualMachine=jimavmc45-wr962-master-1
time="2020-08-21T05:49:28Z" level=info msg=Destroyed VirtualMachine=jimavmc45-wr962-master-1
time="2020-08-21T05:49:31Z" level=debug msg="Powered off" VirtualMachine=jimavmc45-wr962-master-0
time="2020-08-21T05:49:31Z" level=info msg=Destroyed VirtualMachine=jimavmc45-wr962-master-0
time="2020-08-21T05:49:32Z" level=debug msg="Powered off" VirtualMachine=jimavmc45-wr962-master-2
time="2020-08-21T05:49:32Z" level=info msg=Destroyed VirtualMachine=jimavmc45-wr962-master-2
time="2020-08-21T05:49:33Z" level=debug msg="Powered off" VirtualMachine=jimavmc45-wr962-worker-sr996
time="2020-08-21T05:49:33Z" level=info msg=Destroyed VirtualMachine=jimavmc45-wr962-worker-sr996
time="2020-08-21T05:49:34Z" level=debug msg="Powered off" VirtualMachine=jimavmc45-wr962-worker-qgrv9
time="2020-08-21T05:49:35Z" level=info msg=Destroyed VirtualMachine=jimavmc45-wr962-worker-qgrv9
time="2020-08-21T05:49:35Z" level=debug msg="Powered off" VirtualMachine=jimavmc45-wr962-worker-6sffl
time="2020-08-21T05:49:36Z" level=info msg=Destroyed VirtualMachine=jimavmc45-wr962-worker-6sffl
time="2020-08-21T05:49:36Z" level=debug msg="find Folder objects"
time="2020-08-21T05:49:36Z" level=debug msg="delete Folder"
time="2020-08-21T05:49:36Z" level=info msg=Destroyed Folder=jimavmc45-wr962
time="2020-08-21T05:49:36Z" level=debug msg="delete tag"
time="2020-08-21T05:49:36Z" level=debug msg="Purging asset \"Metadata\" from disk"
time="2020-08-21T05:49:36Z" level=debug msg="Purging asset \"Terraform Variables\" from disk"
time="2020-08-21T05:49:36Z" level=debug msg="Purging asset \"Kubeconfig Admin Client\" from disk"
time="2020-08-21T05:49:36Z" level=debug msg="Purging asset \"Kubeadmin Password\" from disk"
time="2020-08-21T05:49:36Z" level=debug msg="Purging asset \"Certificate (journal-gatewayd)\" from disk"
time="2020-08-21T05:49:36Z" level=debug msg="Purging asset \"Cluster\" from disk"
time="2020-08-21T05:49:36Z" level=info msg="Time elapsed: 11s"

Comment 8 errata-xmlrpc 2020-09-08 10:54:03 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.5.8 bug fix 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/RHBA-2020:3510

Comment 9 Abhinav Dahiya 2020-09-28 16:29:57 UTC
*** Bug 1882844 has been marked as a duplicate of this bug. ***