From 7baf901fd224ff8e58c2dbc1b5b841e09def37d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Ribaud?= Date: Fri, 26 Aug 2022 17:11:47 +0200 Subject: [PATCH] Add share_info parameter to reboot method for each driver (driver part) This patch allow to pass share_info parameter to the reboot method. So it will allow to reboot instance and keep the shares attached. Manila is the OpenStack Shared Filesystems service. These series of patches implement changes required in Nova to allow the shares provided by Manila to be associated with and attached to instances using virtiofs. Implements: blueprint libvirt-virtiofs-attach-manila-shares Change-Id: I897cbd9ebc91938d0227d988b4bc833f2216618a --- nova/virt/driver.py | 2 +- nova/virt/fake.py | 2 +- nova/virt/ironic/driver.py | 2 +- nova/virt/libvirt/driver.py | 4 ++-- nova/virt/vmwareapi/driver.py | 2 +- nova/virt/zvm/driver.py | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/nova/virt/driver.py b/nova/virt/driver.py index 68b187b0c1..ef91594241 100644 --- a/nova/virt/driver.py +++ b/nova/virt/driver.py @@ -612,7 +612,7 @@ class ComputeDriver(object): def reboot(self, context, instance, network_info, reboot_type, block_device_info=None, bad_volumes_callback=None, - accel_info=None): + accel_info=None, share_info=None): """Reboot the specified instance. After this is called successfully, the instance's state diff --git a/nova/virt/fake.py b/nova/virt/fake.py index fa9bdccd4f..7e4f21e4d5 100644 --- a/nova/virt/fake.py +++ b/nova/virt/fake.py @@ -220,7 +220,7 @@ class FakeDriver(driver.ComputeDriver): def reboot(self, context, instance, network_info, reboot_type, block_device_info=None, bad_volumes_callback=None, - accel_info=None): + accel_info=None, share_info=None): # If the guest is not on the hypervisor and we're doing a hard reboot # then mimic the libvirt driver by spawning the guest. if (instance.uuid not in self.instances and diff --git a/nova/virt/ironic/driver.py b/nova/virt/ironic/driver.py index 06769e8e5d..8a95f94937 100644 --- a/nova/virt/ironic/driver.py +++ b/nova/virt/ironic/driver.py @@ -1387,7 +1387,7 @@ class IronicDriver(virt_driver.ComputeDriver): def reboot(self, context, instance, network_info, reboot_type, block_device_info=None, bad_volumes_callback=None, - accel_info=None): + accel_info=None, share_info=None): """Reboot the specified instance. NOTE: Unlike the libvirt driver, this method does not delete diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py index 1185b5f293..c434c29cc2 100644 --- a/nova/virt/libvirt/driver.py +++ b/nova/virt/libvirt/driver.py @@ -3998,7 +3998,7 @@ class LibvirtDriver(driver.ComputeDriver): def reboot(self, context, instance, network_info, reboot_type, block_device_info=None, bad_volumes_callback=None, - accel_info=None): + accel_info=None, share_info=None): """Reboot a virtual machine, given an instance reference.""" if reboot_type == 'SOFT': # NOTE(vish): This will attempt to do a graceful shutdown/restart. @@ -4019,7 +4019,7 @@ class LibvirtDriver(driver.ComputeDriver): "Trying hard reboot.", instance=instance) return self._hard_reboot(context, instance, network_info, - objects.ShareMappingList(), block_device_info, accel_info + share_info, block_device_info, accel_info ) def _soft_reboot(self, instance): diff --git a/nova/virt/vmwareapi/driver.py b/nova/virt/vmwareapi/driver.py index 8b59c4a966..0365f1def4 100644 --- a/nova/virt/vmwareapi/driver.py +++ b/nova/virt/vmwareapi/driver.py @@ -574,7 +574,7 @@ class VMwareVCDriver(driver.ComputeDriver): def reboot(self, context, instance, network_info, reboot_type, block_device_info=None, bad_volumes_callback=None, - accel_info=None): + accel_info=None, share_info=None): """Reboot VM instance.""" self._vmops.reboot(instance, network_info, reboot_type) diff --git a/nova/virt/zvm/driver.py b/nova/virt/zvm/driver.py index 603ef37aa8..274967f0de 100644 --- a/nova/virt/zvm/driver.py +++ b/nova/virt/zvm/driver.py @@ -411,7 +411,7 @@ class ZVMDriver(driver.ComputeDriver): def reboot(self, context, instance, network_info, reboot_type, block_device_info=None, bad_volumes_callback=None, - accel_info=None): + accel_info=None, share_info=None): if reboot_type == 'SOFT': self._hypervisor.guest_reboot(instance.name)