Bug 2123586 - vGPU wasn't deleted automatically when deleting the instance that allocated vGPU
Summary: vGPU wasn't deleted automatically when deleting the instance that allocated vGPU
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-nova
Version: 16.2 (Train)
Hardware: x86_64
OS: Linux
unspecified
urgent
Target Milestone: ---
: ---
Assignee: OSP DFG:Compute
QA Contact: OSP DFG:Compute
URL:
Whiteboard:
Depends On: 2109450
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-09-02 02:55 UTC by Chorong Park
Modified: 2023-03-21 19:58 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-10-19 10:20:09 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 2109450 0 high CLOSED libvirt doesn't catch mdevs created thru sysfs 2023-09-08 05:52:46 UTC
Red Hat Issue Tracker OSP-18519 0 None None None 2022-09-02 03:13:57 UTC

Description Chorong Park 2022-09-02 02:55:45 UTC
Description of problem:

this issue is remained the mediated device (mdev) after deleting the instance that allocated vGPU 
According to them, mdev is remained when checking the CLI `mdevctl list` after shelving the instance but it is deallocated when checking the CLI `nvidia-smi vgpu`

I'm very wondering that why mdev is remained after deleting/shelving the instance that allocated vGPU 
Do we need to manually delete mdev if deleting/shelving the instance that allocated vGPU?

They do delete the instance using the CLI `nova force-delete`  to immediately delete the instance because they are using soft-delete due to their company policy

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


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:
vGPU was't deleted automatically when deleting the instance that allocated vGPU

Expected results:
vGPU is deleted automatically when deleting the instance that allocated vGPU

Additional info:

Comment 3 Sylvain Bauza 2022-09-05 09:08:39 UTC
(In reply to Chorong Park from comment #0)

> Expected results:
> vGPU is deleted automatically when deleting the instance that allocated vGPU


No, FWIW, this isn't an expected result.
When creating an instance, Nova verifies whether there are mdevs that are not used by other instances, and if so, uses one of them for the new instance [1]
If there are no existing created mdevs that are not used by some guests, then Nova will directly ask sysfs to create one mdev [2]

When deleting an instance, then we just remove the guest so the mdev that was created is no longer used.


[1] https://github.com/openstack/nova/blob/58be0ca8b8204bce6cbb6747d46ca595c5843a30/nova/virt/libvirt/driver.py#L8449-L8455
[2] https://github.com/openstack/nova/blob/58be0ca8b8204bce6cbb6747d46ca595c5843a30/nova/virt/libvirt/driver.py#L8343-L8372 and https://github.com/openstack/nova/blob/58be0ca8b8204bce6cbb6747d46ca595c5843a30/nova/privsep/libvirt.py#L195-L203


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