diff options
author | Sylvain Bauza <sbauza@redhat.com> | 2018-06-22 14:53:57 +0200 |
---|---|---|
committer | Sylvain Bauza <sbauza@redhat.com> | 2018-07-02 09:32:47 +0000 |
commit | 3163c9391ec2569f77e583bccf6163c309e45482 (patch) | |
tree | aea5e3aa7bfb528490e9a7d771cecbaac8274b1f /nova/virt | |
parent | 0c80d1c5e9f176ad0c01ac399f17bba0e968fe67 (diff) | |
download | nova-3163c9391ec2569f77e583bccf6163c309e45482.tar.gz |
libvirt: Fix the rescue race for vGPU instances
When rescuing an instance having a vGPU, we were not using the vGPU.
There would then be a race condition during the rescue where the vGPU
could be passed to another instance.
Instead, we should just make sure the vGPU would also be in the rescued
instance.
Change-Id: I7150e15694bb149ae67da37b5e43b6ea7507fe82
Closes-bug: #1762688
(cherry picked from commit 1c59397e09de5506bccba513ef31ffb8585fcdc3)
Diffstat (limited to 'nova/virt')
-rw-r--r-- | nova/virt/libvirt/driver.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py index ca4414fb70..5a0a5dca1d 100644 --- a/nova/virt/libvirt/driver.py +++ b/nova/virt/libvirt/driver.py @@ -3013,11 +3013,16 @@ class LibvirtDriver(driver.ComputeDriver): gen_confdrive = functools.partial(self._create_configdrive, context, instance, injection_info, rescue=True) + # NOTE(sbauza): Since rescue recreates the guest XML, we need to + # remember the existing mdevs for reusing them. + mdevs = self._get_all_assigned_mediated_devices(instance) + mdevs = list(mdevs.keys()) self._create_image(context, instance, disk_info['mapping'], injection_info=injection_info, suffix='.rescue', disk_images=rescue_images) xml = self._get_guest_xml(context, instance, network_info, disk_info, - image_meta, rescue=rescue_images) + image_meta, rescue=rescue_images, + mdevs=mdevs) self._destroy(instance) self._create_domain(xml, post_xml_callback=gen_confdrive) |