Bug 1882844

Summary: [IPI on vsphere] Executing 'openshift-installer destroy cluster' leaves installer tag categories in vsphere
Product: OpenShift Container Platform Reporter: Tony Garcia <antgarci>
Component: InstallerAssignee: Jeremiah Stuever <jstuever>
Installer sub component: openshift-installer QA Contact: jima
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: high CC: adahiya
Version: 4.5Keywords: Reopened
Target Milestone: ---   
Target Release: 4.7.0   
Hardware: x86_64   
OS: Unspecified   
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of:
: 1918961 (view as bug list) Environment:
Last Closed: 2021-02-24 15:21:16 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:
Bug Depends On:    
Bug Blocks: 1918961    

Description Tony Garcia 2020-09-25 22:05:16 UTC
Description of problem:

When openshift-install destroy cluster is run the VMs and folder are deleted but any tag categories 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 tag categories from previous installations are still present.

Expected results:
Tag categories are deleted with other objects.

Comment 2 Abhinav Dahiya 2020-09-28 16:29:57 UTC

*** This bug has been marked as a duplicate of bug 1852720 ***

Comment 4 Tony Garcia 2020-09-28 16:35:43 UTC
Hi Abhinav,

I attached a screenshot of what the customer is seeing. They confirmed that tags are deleting, but tag categories are not being deleted. The question is, should the tag categories also be deleted as per the 'destroy cluster' process?

Comment 5 Abhinav Dahiya 2020-09-28 16:41:15 UTC
Hmm.. that is different from just the tags. Yeah I think the destroy code should remove the categories too since these are created for the cluster 
seeing here https://github.com/openshift/installer/blob/527e3beb3609be50551b4019282ece14cce1ecce/data/data/vsphere/main.tf#L54-L64

re opening and set the fix version to 4.7 we will back port this back up to 4.5.
(since this is not a new regression in 4.6 we cannot set to block 4.6 and we will ship fixes in z streams..)

Comment 6 Tony Garcia 2020-09-28 16:44:18 UTC
Excellent! Thank you for the quick response. I'll update the customer.

Comment 8 jima 2020-10-23 10:35:54 UTC
verified ipi on vsphere with 4.7.0-0.nightly-2020-10-22-175439 and passed, tag category is removed checking both from cluster deletion log and vsphere UI

0-23 13:01:16  level=debug msg="OpenShift Installer 4.7.0-0.nightly-2020-10-22-175439"
10-23 13:01:16  level=debug msg="Built from commit 31dba4362530c3afaacf20e3a7971a10c1d9f288"
10-23 13:01:23  level=debug msg="find attached objects on tag"
10-23 13:02:26  level=debug msg="find VirtualMachine objects"
10-23 13:02:26  level=debug msg="delete VirtualMachines"
10-23 13:02:26  level=info msg=Destroyed VirtualMachine=jima47ipi2-8lzqk-rhcos
10-23 13:02:26  level=debug msg="Powered off" VirtualMachine=jima47ipi2-8lzqk-master-0
10-23 13:02:27  level=info msg=Destroyed VirtualMachine=jima47ipi2-8lzqk-master-0
10-23 13:02:28  level=debug msg="Powered off" VirtualMachine=jima47ipi2-8lzqk-master-1
10-23 13:02:29  level=info msg=Destroyed VirtualMachine=jima47ipi2-8lzqk-master-1
10-23 13:02:30  level=debug msg="Powered off" VirtualMachine=jima47ipi2-8lzqk-master-2
10-23 13:02:31  level=info msg=Destroyed VirtualMachine=jima47ipi2-8lzqk-master-2
10-23 13:02:32  level=debug msg="Powered off" VirtualMachine=jima47ipi2-8lzqk-worker-n9qqc
10-23 13:02:32  level=info msg=Destroyed VirtualMachine=jima47ipi2-8lzqk-worker-n9qqc
10-23 13:02:34  level=debug msg="Powered off" VirtualMachine=jima47ipi2-8lzqk-worker-bgxdd
10-23 13:02:34  level=info msg=Destroyed VirtualMachine=jima47ipi2-8lzqk-worker-bgxdd
10-23 13:02:34  level=debug msg="find Folder objects"
10-23 13:02:34  level=debug msg="delete Folder"
10-23 13:02:34  level=info msg=Destroyed Folder=jima47ipi2-8lzqk
10-23 13:02:34  level=debug msg="delete tag"
10-23 13:03:38  level=debug msg="delete tag category"
10-23 13:12:48  level=debug msg="Purging asset \"Metadata\" from disk"
10-23 13:12:48  level=debug msg="Purging asset \"Terraform Variables\" from disk"
10-23 13:12:48  level=debug msg="Purging asset \"Kubeconfig Admin Client\" from disk"
10-23 13:12:48  level=debug msg="Purging asset \"Kubeadmin Password\" from disk"
10-23 13:12:48  level=debug msg="Purging asset \"Certificate (journal-gatewayd)\" from disk"
10-23 13:12:48  level=debug msg="Purging asset \"Cluster\" from disk"
10-23 13:12:48  level=info msg="Time elapsed: 11m28s"
10-23 13:12:48  waiting for operation up to 36000 seconds..

Comment 11 errata-xmlrpc 2021-02-24 15:21:16 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 (Moderate: OpenShift Container Platform 4.7.0 security, bug fix, and enhancement 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.