[nova][dev] Reattaching mediated devices to instance coming back from suspended state

Gustavo Faganello Santos gustavofaganello.santos at windriver.com
Thu Oct 14 18:37:43 UTC 2021


Hello, everyone!

I'm working on a solution for Nova to reattach previously used mediated
devices (vGPU instances, in my case) to VMs coming back from suspension,
which seems to have been left on hold in the past [1] because of an old
libvirt limitation, and I'm having a bit of a hard time doing so, since
I'm not too familiar with the repo.

I have tried creating a function that does the opposite of the mdev
detach function, but the get_all_devices method seems to return an empty
list when looking for mdevs at the moment of resuming the VM. Looking at
the instance's XML file, I noticed that the mdev property remains while
the VM is suspended, but it disappears AFTER the whole resume function
is executed. I'm failing to understand why the mdev list returns empty,
even though the mdev property exists in the instance's XML, and also why
the mdev is removed from the XML after the resume function is executed.

With that in mind, does anyone know if there's been any attempt to solve
this issue since it was left on hold? If not, is there anything I should
know while I attempt to do so?

Thanks in advance.
Gustavo

[1]
https://opendev.org/openstack/nova/src/branch/master/nova/virt/libvirt/driver.py#L8007



More information about the openstack-discuss mailing list