Bug 2109866

Summary: Cannot delete a Machine if a VM got stuck in ERROR
Product: OpenShift Container Platform Reporter: Maysa Macedo <mdemaced>
Component: Cloud ComputeAssignee: Maysa Macedo <mdemaced>
Cloud Compute sub component: OpenStack Provider QA Contact: Itzik Brown <itbrown>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: medium CC: akesarka, ancollin, dgautam, itbrown, juriarte, m.andre, mbooth, mdemaced, mdulko, mfedosin, pprinett
Version: 4.7Keywords: Reopened, Triaged
Target Milestone: ---   
Target Release: 4.11.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: 1921656
: 2111151 (view as bug list) Environment:
Last Closed: 2022-08-23 15:09:07 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: 2111151    
Bug Blocks: 1921656    

Comment 4 ShiftStack Bugwatcher 2022-07-27 07:08:30 UTC
Removing the Triaged keyword because:
* the QE automation assessment (flag qe_test_coverage) is missing

Comment 6 Jon Uriarte 2022-08-01 16:31:27 UTC
Verified in 4.11.0-rc.6 on top of OSP 16.2.2.

Verification steps:

1. Check the VMs in OSP and machines and nodes in OCP

$ openstack server list
+--------------------------------------+-----------------------------+--------+-------------------------------------+--------------------+-----------+
| ID                                   | Name                        | Status | Networks                            | Image              | Flavor    |
+--------------------------------------+-----------------------------+--------+-------------------------------------+--------------------+-----------+
| 6e9eb0b3-2623-4304-a573-53bc5cb74bbb | ostest-htm84-worker-0-2jx2z | ACTIVE | ostest-htm84-openshift=10.196.0.157 | ostest-htm84-rhcos | m4.xlarge |
| e44fccbc-ba7b-44be-96fe-6cf716c205b6 | ostest-htm84-worker-0-6t6sk | ACTIVE | ostest-htm84-openshift=10.196.3.147 | ostest-htm84-rhcos | m4.xlarge |
| 735a300f-6b5c-4fb8-88cf-aeaac4323496 | ostest-htm84-worker-0-s7cp6 | ACTIVE | ostest-htm84-openshift=10.196.0.116 | ostest-htm84-rhcos | m4.xlarge |
| 30da3e57-ee28-4b21-9ec4-d9f1896aa59b | ostest-htm84-master-2       | ACTIVE | ostest-htm84-openshift=10.196.3.150 | ostest-htm84-rhcos | m4.xlarge |
| c5abc209-3337-4b12-b183-7b073a585c5c | ostest-htm84-master-1       | ACTIVE | ostest-htm84-openshift=10.196.1.124 | ostest-htm84-rhcos | m4.xlarge |
| ba1684cb-1dad-459a-8e3b-bcef25fcf562 | ostest-htm84-master-0       | ACTIVE | ostest-htm84-openshift=10.196.3.197 | ostest-htm84-rhcos | m4.xlarge |
+--------------------------------------+-----------------------------+--------+-------------------------------------+--------------------+-----------+

$ oc -n openshift-machine-api get machineset
NAME                    DESIRED   CURRENT   READY   AVAILABLE   AGE
ostest-htm84-worker-0   3         3         3       3           111m

$ oc get machines -A
NAMESPACE               NAME                          PHASE     TYPE        REGION      ZONE   AGE
openshift-machine-api   ostest-htm84-master-0         Running   m4.xlarge   regionOne   nova   109m
openshift-machine-api   ostest-htm84-master-1         Running   m4.xlarge   regionOne   nova   109m
openshift-machine-api   ostest-htm84-master-2         Running   m4.xlarge   regionOne   nova   109m
openshift-machine-api   ostest-htm84-worker-0-2jx2z   Running   m4.xlarge   regionOne   nova   93m
openshift-machine-api   ostest-htm84-worker-0-6t6sk   Running   m4.xlarge   regionOne   nova   93m
openshift-machine-api   ostest-htm84-worker-0-s7cp6   Running   m4.xlarge   regionOne   nova   93m

2. Scale-up and scale-down the machineset so there is no time for the VM to go to ACTIVE Status (the
machine will be deleted while is still being created):

$ oc scale machineset ostest-htm84-worker-0 -n openshift-machine-api --replicas=4; oc scale machineset ostest-htm84-worker-0 -n openshift-machine-api --replicas=3
$ oc get machines -A
NAMESPACE               NAME                          PHASE     TYPE        REGION      ZONE   AGE
openshift-machine-api   ostest-htm84-master-0         Running   m4.xlarge   regionOne   nova   119m
openshift-machine-api   ostest-htm84-master-1         Running   m4.xlarge   regionOne   nova   119m
openshift-machine-api   ostest-htm84-master-2         Running   m4.xlarge   regionOne   nova   119m
openshift-machine-api   ostest-htm84-worker-0-2jx2z   Running   m4.xlarge   regionOne   nova   103m
openshift-machine-api   ostest-htm84-worker-0-6t6sk   Running   m4.xlarge   regionOne   nova   103m
openshift-machine-api   ostest-htm84-worker-0-7v9dw                                            0s
openshift-machine-api   ostest-htm84-worker-0-s7cp6   Running   m4.xlarge   regionOne   nova   103m

$ oc get machines -A
NAMESPACE               NAME                          PHASE      TYPE        REGION      ZONE   AGE
openshift-machine-api   ostest-htm84-master-0         Running    m4.xlarge   regionOne   nova   119m
openshift-machine-api   ostest-htm84-master-1         Running    m4.xlarge   regionOne   nova   119m
openshift-machine-api   ostest-htm84-master-2         Running    m4.xlarge   regionOne   nova   119m
openshift-machine-api   ostest-htm84-worker-0-2jx2z   Running    m4.xlarge   regionOne   nova   103m
openshift-machine-api   ostest-htm84-worker-0-6t6sk   Running    m4.xlarge   regionOne   nova   103m
openshift-machine-api   ostest-htm84-worker-0-7v9dw   Deleting                                  1s
openshift-machine-api   ostest-htm84-worker-0-s7cp6   Running    m4.xlarge   regionOne   nova   103m


3. Check the new machine is deleted (and not in a continuous Deleting status)

$ oc get machines -A
NAMESPACE               NAME                          PHASE     TYPE        REGION      ZONE   AGE
openshift-machine-api   ostest-htm84-master-0         Running   m4.xlarge   regionOne   nova   120m
openshift-machine-api   ostest-htm84-master-1         Running   m4.xlarge   regionOne   nova   120m
openshift-machine-api   ostest-htm84-master-2         Running   m4.xlarge   regionOne   nova   120m
openshift-machine-api   ostest-htm84-worker-0-2jx2z   Running   m4.xlarge   regionOne   nova   104m
openshift-machine-api   ostest-htm84-worker-0-6t6sk   Running   m4.xlarge   regionOne   nova   104m
openshift-machine-api   ostest-htm84-worker-0-s7cp6   Running   m4.xlarge   regionOne   nova   104m

Comment 9 errata-xmlrpc 2022-08-23 15:09:07 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.11.1 bug fix and security 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/RHSA-2022:6103