Bug 2170740

Summary: Deleting vm with --cascade=orphan is not working properly
Product: Container Native Virtualization (CNV) Reporter: ffossemo
Component: VirtualizationAssignee: ffossemo
Status: CLOSED ERRATA QA Contact: zhe peng <zpeng>
Severity: high Docs Contact:
Priority: unspecified    
Version: 4.13.0CC: acardace
Target Milestone: ---   
Target Release: 4.13.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: hco-bundle-registry-container-v4.13.0.rhel9-1639 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-18 02:57:49 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:
Embargoed:

Description ffossemo 2023-02-17 07:24:46 UTC
Description of problem:
By default, deleting a running vm results in the deletion of the vm and the associated vmi.
When `--cascade=orphan` is used, it should result in the deletion of the vm, but the associated vmi should be left running.

Version-Release number of selected component (if applicable):
4.1.13

How reproducible:
100%

Steps to Reproduce:
1. Create a vm and start it
2. Delete the vm with `kubectl delete vm <vm_name> --cascade=orphan`
3.

Actual results:
The vmi disappears

Expected results:
The vmi should not be deleted

Additional info:

Comment 1 zhe peng 2023-03-06 03:28:59 UTC
verify with build: CNV-v4.13.0.rhel9-1639

step: 
1: create a vm and start it
$ oc get vm
NAME        AGE   STATUS    READY
vm-fedora   12m   Running   True

2: Delete the vm with `kubectl delete vm <vm_name> --cascade=orphan`
$ kubectl delete vm vm-fedora --cascade=orphan
virtualmachine.kubevirt.io "vm-fedora" deleted

$ oc get vmi
NAME        AGE   PHASE     IP             NODENAME                             READY
vm-fedora   12m   Running   10.129.2.155   c01-zpeng-413-sv526-worker-0-8dp6m   True

try to connect vmi with console, it worked. 
move to verified.

Comment 3 errata-xmlrpc 2023-05-18 02:57:49 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 Virtualization 4.13.0 Images 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.

https://access.redhat.com/errata/RHSA-2023:3205