Bug 1799034

Summary: take into consideration all instance states when deleting a machine
Product: OpenShift Container Platform Reporter: Alberto <agarcial>
Component: Cloud ComputeAssignee: Alberto <agarcial>
Status: CLOSED ERRATA QA Contact: Milind Yadav <miyadav>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 4.4CC: jhou
Target Milestone: ---   
Target Release: 4.2.z   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1798596 Environment:
Last Closed: 2020-03-04 04:51:02 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: 1798596, 1798597, 1804596    
Bug Blocks:    

Comment 3 Milind Yadav 2020-02-20 09:51:52 UTC
Description of problem:
In aws instances with a provider state different than running might be leaked when deleting.

Version-Release number of selected component (if applicable):
TESTED ON :
NAME      VERSION                             AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.2.0-0.nightly-2020-02-19-222048   True        False         17m     Cluster version is 4.2.0-0.nightly-2020-02-19-222048




How reproducible:
100%

Steps to Reproduce:
Create a machineSet.

Expected & Actual :
Machineset created successfully 
[miyadav@miyadav bug1799034]$ oc create -f newmachineset.yml 
machineset.machine.openshift.io/miyadav-2020-c6r79-newmachine-worker-us-east-2a created


Delete the machineSet before the instances get to running.

Expected & Actual :
Machine gets terminated 

[miyadav@miyadav bug1799034]$ oc delete machineset.machine.openshift.io/miyadav-2020-c6r79-newmachine-worker-us-east-2a
machineset.machine.openshift.io "miyadav-2020-c6r79-newmachine-worker-us-east-2a" deleted
[miyadav@miyadav bug1799034]$ oc create -f newmachineset.yml 
machineset.machine.openshift.io/miyadav-2020-c6r79-newmachine-worker-us-east-2a created
[miyadav@miyadav bug1799034]$ oc get machines
NAME                                                       STATE     TYPE        REGION      ZONE         AGE
miyadav-2020-c6r79-master-0                                running   m4.xlarge   us-east-2   us-east-2a   42m
miyadav-2020-c6r79-master-1                                running   m4.xlarge   us-east-2   us-east-2b   42m
miyadav-2020-c6r79-master-2                                running   m4.xlarge   us-east-2   us-east-2c   42m
miyadav-2020-c6r79-newmachine-worker-us-east-2a-vz4jz      pending   m4.large    us-east-2   us-east-2a   5s
miyadav-2020-c6r79-worker-us-east-2a-jq9j6                 running   m4.large    us-east-2   us-east-2a   40m
...
[miyadav@miyadav bug1799034]$ oc delete machineset.machine.openshift.io/miyadav-2020-c6r79-newmachine-worker-us-east-2a
machineset.machine.openshift.io "miyadav-2020-c6r79-newmachine-worker-us-east-2a" deleted
[miyadav@miyadav bug1799034]$ oc get machines
NAME                                                       STATE     TYPE        REGION      ZONE         AGE
miyadav-2020-c6r79-master-0                                running   m4.xlarge   us-east-2   us-east-2a   42m
miyadav-2020-c6r79-master-1                                running   m4.xlarge   us-east-2   us-east-2b   42m
miyadav-2020-c6r79-master-2                                running   m4.xlarge   us-east-2   us-east-2c   42m
miyadav-2020-c6r79-worker-us-east-2a-jq9j6                 running   m4.large    us-east-2   us-east-2a   41m
....



Check aws console.
Expected & Actual :
Instance gets terminated

Comment 5 errata-xmlrpc 2020-03-04 04:51:02 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, 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:0614