Bug 1846125

Summary: vSphere IPI - cluster destroy leaves installer tags
Product: OpenShift Container Platform Reporter: davis phillips <dphillip>
Component: InstallerAssignee: Abhinav Dahiya <adahiya>
Installer sub component: openshift-installer QA Contact: jima
Status: CLOSED ERRATA Docs Contact:
Severity: low    
Priority: medium CC: adahiya, choag, jima
Version: 4.5   
Target Milestone: ---   
Target Release: 4.6.0   
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:
: 1852720 (view as bug list) Environment:
Last Closed: 2020-10-27 16:06:32 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:    
Bug Blocks: 1852720    

Description davis phillips 2020-06-10 20:35:10 UTC
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.

Comment 5 jima 2020-08-03 01:54:06 UTC
Verified on nightly build 4.6.0-0.nightly-2020-07-31-062158, during destroying cluster, the log show that tag is deleted. Checked from vsphere client, related tag has been removed.
level=debug msg="OpenShift Installer 4.6.0-0.nightly-2020-08-02-091622"
level=debug msg="Built from commit 2f8b52e8e950cdb1f0575f7a58cb53d7166f2955"
level=debug msg="find attached objects on tag"
level=debug msg="find VirtualMachine objects"
level=debug msg="delete VirtualMachines"
level=info msg=Destroyed VirtualMachine=jima46ipi-7ncdv-rhcos
level=debug msg="Powered off" VirtualMachine=jima46ipi-7ncdv-master-0
level=info msg=Destroyed VirtualMachine=jima46ipi-7ncdv-master-0
level=debug msg="Powered off" VirtualMachine=jima46ipi-7ncdv-master-1
level=info msg=Destroyed VirtualMachine=jima46ipi-7ncdv-master-1
level=debug msg="Powered off" VirtualMachine=jima46ipi-7ncdv-master-2
level=info msg=Destroyed VirtualMachine=jima46ipi-7ncdv-master-2
level=debug msg="Powered off" VirtualMachine=jima46ipi-7ncdv-worker-m5k8q
level=info msg=Destroyed VirtualMachine=jima46ipi-7ncdv-worker-m5k8q
level=debug msg="Powered off" VirtualMachine=jima46ipi-7ncdv-worker-kqjw8
level=info msg=Destroyed VirtualMachine=jima46ipi-7ncdv-worker-kqjw8
level=debug msg="find Folder objects"
level=debug msg="delete Folder"
level=info msg=Destroyed Folder=jima46ipi-7ncdv
level=debug msg="delete tag"
level=debug msg="Purging asset \"Metadata\" from disk"
level=debug msg="Purging asset \"Terraform Variables\" from disk"
level=debug msg="Purging asset \"Kubeconfig Admin Client\" from disk"
level=debug msg="Purging asset \"Kubeadmin Password\" from disk"
level=debug msg="Purging asset \"Certificate (journal-gatewayd)\" from disk"
level=debug msg="Purging asset \"Cluster\" from disk"
level=info msg="Time elapsed: 2m10s"

Comment 9 errata-xmlrpc 2020-10-27 16:06:32 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