Bug 2170740 - Deleting vm with --cascade=orphan is not working properly
Summary: Deleting vm with --cascade=orphan is not working properly
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: Virtualization
Version: 4.13.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: 4.13.0
Assignee: ffossemo
QA Contact: zhe peng
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-02-17 07:24 UTC by ffossemo
Modified: 2023-05-18 02:58 UTC (History)
1 user (show)

Fixed In Version: hco-bundle-registry-container-v4.13.0.rhel9-1639
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-05-18 02:57:49 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github kubevirt kubevirt pull 9259 0 None open Fix vm deletion with --cascade=orphan 2023-02-17 07:25:43 UTC
Github kubevirt kubevirt pull 9276 0 None open [release-0.59] Add VirtualMachine foreground finalizer 2023-02-22 09:04:51 UTC
Red Hat Issue Tracker CNV-25716 0 None None None 2023-02-17 07:27:38 UTC
Red Hat Product Errata RHSA-2023:3205 0 None None None 2023-05-18 02:58:01 UTC

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


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