middleware
middleware copied to clipboard
NAS-127357 / 24.10 / Retrieve PCI slots in a new endpoint so that they are easily consumed by UI
Context
When GPU passthrough is desired, there are essentially 2 steps which need to be done:
- Add GPU which is to be used for passthrough via
system.advanced
namespace - Create PCI devices for the GPU in question based on PCI devices it is consuming and any other which fall in the same iommu group (this happens during VM creation wizard)
For (2), we have an endpoint vm.device.get_pci_ids_for_gpu_isolation
which UI should be consuming to find out PCI devices which should be created when user says he wants X GPU to be added to a VM.
For (1) however, UI was consuming the same endpoint and passing it's return argument to system.advanced.update
which was bound to fail.
A new endpoint has been added system.advanced.get_isolate_gpu_pci_choices
which basically does the parsing UI was already doing at the moment and gives values which UI should be passing on for each GPU which is selected to system.advanced.update_gpu_pci_ids
along with unit tests to ensure consistent behavior.
Jira URL: https://ixsystems.atlassian.net/browse/NAS-127357
Only to be merged after https://github.com/truenas/middleware/pull/13301
This PR has been merged and conversations have been locked. If you would like to discuss more about this issue please use our forums or raise a Jira ticket.