From db3989586a8d5bbbcf857b9294a124ecc5fc57e8 Mon Sep 17 00:00:00 2001 From: Brent Eagles Date: Thu, 6 Jun 2013 15:33:42 -0230 Subject: Refresh volume connections when starting instances This patches adds network and block device information to the signature of the power_on method on the virtualization driver. The relevant call sites are also modified to provide the required information. The libvirt implementation of power_on has been altered to re-establish network and volume related connections. Fixes bug: 1188326 Change-Id: If617b570e082e3aa321414a2680a3aa0754f6153 --- nova/compute/manager.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'nova/compute') diff --git a/nova/compute/manager.py b/nova/compute/manager.py index 22881f5bd..a242a121d 100755 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -1540,7 +1540,14 @@ class ComputeManager(manager.SchedulerDependentManager): def start_instance(self, context, instance): """Starting an instance on this host.""" self._notify_about_instance_usage(context, instance, "power_on.start") - self.driver.power_on(instance) + + network_info = self._get_instance_nw_info(context, instance) + block_device_info = self._get_instance_volume_block_device_info( + context, instance) + self.driver.power_on(context, instance, + self._legacy_nw_info(network_info), + block_device_info) + current_power_state = self._get_power_state(context, instance) instance.power_state = current_power_state instance.vm_state = vm_states.ACTIVE @@ -1595,7 +1602,12 @@ class ComputeManager(manager.SchedulerDependentManager): except NotImplementedError: # Fallback to just powering on the instance if the hypervisor # doesn't implement the restore method - self.driver.power_on(instance) + network_info = self._get_instance_nw_info(context, instance) + block_device_info = self._get_instance_volume_block_device_info( + context, instance) + self.driver.power_on(context, instance, + self._legacy_nw_info(network_info), + block_device_info) current_power_state = self._get_power_state(context, instance) instance = self._instance_update(context, instance['uuid'], power_state=current_power_state, -- cgit