Bug 2182333

Summary: Cannot delete a VM immediately which is not actually boot inside
Product: Container Native Virtualization (CNV) Reporter: Guohua Ouyang <gouyang>
Component: VirtualizationAssignee: Prita Narayan <prnaraya>
Status: CLOSED MIGRATED QA Contact: Kedar Bidarkar <kbidarka>
Severity: high Docs Contact:
Priority: high    
Version: 4.13.0CC: acardace, gouyang
Target Milestone: ---   
Target Release: 4.15.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: v4.15.0.rhel9-1620 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-12-14 16:16:17 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:
Bug Depends On:    
Bug Blocks: 2027959    
Attachments:
Description Flags
VM yaml none

Description Guohua Ouyang 2023-03-28 09:19:15 UTC
Created attachment 1954119 [details]
VM yaml

Description of problem:
Create a VM which is not actually started normally inside, such as it stays on "No bootable device" page, delete this VM will hang until terminationGracePeriodSeconds is there.

It does not make sense to waste so long time to delete a VM which is actually on boot loader page. Below command does not work, maybe it should have a power-off option.
$ oc delete vm windows-aonsms --force --grace-period=0


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


How reproducible:


Steps to Reproduce:
1. create vm from the attached yaml
2. delete the vm when it's running
3.

Actual results:
it wait for 1 hour to get the VM deleted

Expected results:
The VM is deleted immediately since it's just on boot loader page

Additional info:

Comment 1 Guohua Ouyang 2023-03-29 14:18:21 UTC
More info when the VM is stucking in terminating statue:
1. the pod is stucking in terminating
2. the VMI is existing and running

It should have a way to power off the VM and then get it deleted, otherwise it's very annoying, because it wastes users one hour to delete a VM just at boot order page.

Comment 2 sgott 2023-04-05 12:30:17 UTC
The OS behavior here is not a bug. We cannot accelerate shutdown of Windows VMs because that OS applies updates on shutdown, and interrupting this process will cause unrecoverable damage to the filesystem/OS.

The part that is a bug here is that the grace-period=0 argument is not honored.