Since libvirt doesn't allow us to hot-unplug mediated devices, we need to
short-circuit the suspend action if the instance has mediated devices
and set it back to the ACTIVE state.
Change-Id: I01147bb3c66d94fdecb76395e5205767a905d18a
When we reboot a guest (like when stopping/starting it), we recreate the guest
XML. Since we need to know the existing mediated devices before destroying
the guest, let's pass them when recreating the XML.
NOTE: I'm also amending the reno file to exactly mention what has been tested
and fully functional and what is not working for all the instance actions.
I'm also considering that change as the last patch that makes the feature
production-ready as most of the left quirks can be easily worked around by
either rebuilding the instance (for example when you resize) or just shelving
the instance instead of suspending it.
Next changes in the series will address those issues but won't be identified
as part of the blueprint itself.
Change-Id: Idba99f3f9b4abe77c042a6edaf9f5fe5c75ac32c
Implements: blueprint add-support-for-vgpu
There is a lacking feature in libvirt (due to the nature of what is mediated
device as just a sysfs file) that mediated devices are not persisted.
When you reboot your host, you loose all of them which can be a big pain for
operators having allocated guests using vGPUs.
This change will iterate over all the instances, see if they have a nested
vGPU, check if the related mediated device exists, and if not, rebalance
between physical GPUs to find a proper one which can fit.
Note that due to the fact we don't persist neither in Nova the mediated device
information, mediated devices can be created on different physical devices that
they were before the reboot. That's not a big deal since we only support one
type at the moment, but that could become a problem later as we would need to
figure out which type the mediated device was before the reboot.
Partially-Implements: blueprint add-support-for-vgpu
Change-Id: Ie6c9108808a461359d717d8a9e9399c8a407bfe9
If an allocation is asking for a VGPU, then libvirt will look at the
available mediated devices and call the sysfs to create one of them if
needed.
Please note I commented in the relnote all the caveats we currently have
with mediated devices in libvirt, but I'll provide some workarounds for
those in the next changes.
Change-Id: Ibf210dd27972fed2651d6c9bd73a0bcf352c8bab
Partially-Implements: blueprint add-support-for-vgpu