Bug 1889779 - error when destroying a vSphere installation that failed early
Summary: error when destroying a vSphere installation that failed early
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Installer
Version: 4.6
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: 4.7.0
Assignee: Patrick Dillon
QA Contact: jima
Depends On:
TreeView+ depends on / blocked
Reported: 2020-10-20 14:40 UTC by Joel Diaz
Modified: 2020-11-23 03:36 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed:
Target Upstream Version:

Attachments (Terms of Use)
openshift install log (74.40 KB, text/plain)
2020-10-20 14:40 UTC, Joel Diaz
no flags Details

System ID Priority Status Summary Last Updated
Github openshift installer pull 4388 None closed Bug 1889779: vSphere destroy: handle failed clusters 2020-11-23 02:59:34 UTC

Description Joel Diaz 2020-10-20 14:40:12 UTC
Created attachment 1722913 [details]
openshift install log

Thanks for opening a bug report!
Before hitting the button, please fill in as much of the template below as you can.
If you leave out information, it's harder to help you.
Be ready for follow-up questions, and please respond in a timely manner.
If we can't reproduce a bug we might close your issue.
If we're wrong, PLEASE feel free to reopen it and explain why.


$ openshift-install version
[jdiaz@minigoomba os-install-4.6-rc4]$ ./openshift-install version
./openshift-install 4.6.0-rc.4
built from commit ebdbda57fc18d3b73e69f0f2cc499ddfca7e6593
release image registry.svc.ci.openshift.org/ocp/release@sha256:2c22e1c56831935a24efb827d2df572855ccd555c980070f77c39729526037d5

Platform: vSphere

Please specify:

What happened?
Cluster installation failed while creating/importing the RHCOS image.
Attempt to destroy any resources created up to the failure to allow a second installation attempt, and the destroy command gives an error.

What did you expect to happen?

The destroy command should gracefully notice that there is nothing to delete/destroy.

How to reproduce it (as minimally and precisely as possible)?

Set up an environment where the RHCOS import fails, or just force quit the installer during the RHCOS image import. Now that we have an incomplete installation, try to run the destroy.

$ ./openshift-install destroy cluster --dir vsphere --log-level=debug 

Anything else we need to know?

Here are the logs of the end of the failed install:

DEBUG vsphereprivate_import_ova.import: Still creating... [1m40s elapsed] 
DEBUG vsphereprivate_import_ova.import: Still creating... [1m50s elapsed] 
DEBUG vsphereprivate_import_ova.import: Still creating... [2m0s elapsed] 
DEBUG vsphereprivate_import_ova.import: Still creating... [2m10s elapsed] 
ERROR Error: failed to upload: Post "": dial tcp connect: connection timed out 
ERROR   on ../../../../tmp/openshift-install-278843614/main.tf line 43, in resource "vsphereprivate_import_ova" "import": 
ERROR   43: resource "vsphereprivate_import_ova" "import" { 
FATAL failed to fetch Cluster: failed to generate asset "Cluster": failed to create cluster: failed to apply Terraform: failed to complete the change 

And here is the error when trying to 'destroy cluster':

[jdiaz@minigoomba os-install-4.6-rc4]$ ./openshift-install destroy cluster --dir vmc --log-level=debug
DEBUG OpenShift Installer 4.6.0-rc.4               
DEBUG Built from commit ebdbda57fc18d3b73e69f0f2cc499ddfca7e6593 
DEBUG find attached objects on tag                 
DEBUG find VirtualMachine objects                  
FATAL Failed to destroy cluster: object references is empty 
[jdiaz@minigoomba os-install-4.6-rc4]$ echo $?

Comment 2 Patrick Dillon 2020-11-18 16:09:02 UTC
In order to test this run a vsphere install with log-level debug. Once you start seeing "vsphereprivate_import_ova.import: Still creating... " 

Interrupt then run a delete.

Comment 4 jima 2020-11-23 03:36:02 UTC
Verified on ipi on vsphere with 4.7.0-0.nightly-2020-11-22-204912 and passed.

# ./openshift-install destroy cluster --dir ipi/ --log-level debug
DEBUG OpenShift Installer 4.7.0-0.nightly-2020-11-22-204912 
DEBUG Built from commit 68282c185253d4831514b20623b1717535c5e6f2 
DEBUG Find attached objects on tag                 
DEBUG Find VirtualMachine objects                  
DEBUG Delete VirtualMachines                       
INFO Destroyed                                     VirtualMachine=jimaipi-qwz86-rhcos
DEBUG Find Folder objects                          
DEBUG Delete Folder                                
INFO Destroyed                                     Folder=jimaipi-qwz86
DEBUG Delete tag                                   
DEBUG Delete tag category                          
DEBUG Purging asset "Metadata" from disk           
DEBUG Purging asset "Terraform Variables" from disk 
DEBUG Purging asset "Kubeconfig Admin Client" from disk 
DEBUG Purging asset "Kubeadmin Password" from disk 
DEBUG Purging asset "Certificate (journal-gatewayd)" from disk 
INFO Time elapsed: 9m33s

Note You need to log in before you can comment on or make changes to this bug.