Bug 2182325

Summary: VM is stucking at Terminating status when the PVC is deleted by another VM
Product: Container Native Virtualization (CNV) Reporter: Guohua Ouyang <gouyang>
Component: StorageAssignee: Adam Litke <alitke>
Status: CLOSED DUPLICATE QA Contact: Natalie Gavrielov <ngavrilo>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.13.0CC: gouyang, skagan
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 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:

Description Guohua Ouyang 2023-03-28 08:51:03 UTC
Description of problem:
Create a VM from instanceType and then clone a VM from it, due to the UI bug https://bugzilla.redhat.com/show_bug.cgi?id=2182056, the cloned VM is using the same PVC of the source VM, once the cloned VM is running, delete both of them, the cloned VM is stucking at Terminating status, could not find a way to delete it.

Version-Release number of selected component (if applicable):
v4.13.0

How reproducible:
100%

Steps to Reproduce:
1. create a VM from instanceType from UI and wait for it becomes running
2. clone a VM from it and wait for the cloned VM becomes running
3. delete both VMs

Actual results:
the cloned VM is stucking at Terminating status

Expected results:
Both VM are deleted, or there is a way to delete the VM which PVC is not found.

Additional info:

Comment 1 sgott 2023-03-29 12:21:55 UTC
Reassigning this to the storage component as this is related to PVC handling. However, it's not 100% clear this is not a KubeVirt core bug, so if this turns out to be an incorrect action, please feel free to reassign it.

Comment 2 Adam Litke 2023-03-29 12:31:43 UTC
Shelly, this seems like a problem when kubevirt is cleaning up a VM/VMI and the underlying PVC is missing/terminating.  Should be pretty easy to reproduce.  Can you please take a look?

Comment 3 Guohua Ouyang 2023-03-29 12:33:26 UTC
The VM can be deleted after clear the revisionName from the VM, it should be a duplicate bug of 2178037.

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

Comment 4 Guohua Ouyang 2023-03-29 12:33:27 UTC
The VM can be deleted after clear the revisionName from the VM, it should be a duplicate bug of 2178037.

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

Comment 5 skagan 2023-03-29 12:49:25 UTC
I'll just add a clarification: 
Eventually this bug had nothing to do with a missing PVC but rather with a missing controllerRevision.
The controllerRevision was created when the original VM was create by using instanceTypes. When deleting the original VM, the clone VM which because of UI bug also referred to the same controllerRevision couldn't be deleted. currently a work around is to remove the revisionName, but should look for https://bugzilla.redhat.com/show_bug.cgi?id=2178037 to be officially closed.