From 99b5e96795b8475f14d53bbc3845e7bace730963 Mon Sep 17 00:00:00 2001 From: Rafi Khardalian Date: Tue, 4 Sep 2012 13:37:46 +0000 Subject: Allow VMs to be resumed after a hypervisor reboot Fixes bug 1052696. Update the compute manager to pass network_info and block_device_info to the driver.resume() and update all virtualization drivers to accept the new arguments. For libvirt, change resume() to use _create_domain_and_network() rather than _create_domain(). This eliminates the assumption that the network and block device connections remained in place from the period between the VM being suspended and resumed. Instead, all the networking and block connections will be rebuilt on resume (in case they are missing) as is the case after a hypervisor reboot. Change-Id: I6e19ec42f7e929678abce8f276c0a6e91f1fa8af --- nova/compute/manager.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'nova/compute') diff --git a/nova/compute/manager.py b/nova/compute/manager.py index 7484a9252..7ee55a930 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -2145,7 +2145,13 @@ class ComputeManager(manager.SchedulerDependentManager): """Resume the given suspended instance.""" context = context.elevated() LOG.audit(_('Resuming'), context=context, instance=instance) - self.driver.resume(instance) + + network_info = self._get_instance_nw_info(context, instance) + block_device_info = self._get_instance_volume_block_device_info( + context, instance['uuid']) + + self.driver.resume(instance, self._legacy_nw_info(network_info), + block_device_info) current_power_state = self._get_power_state(context, instance) self._instance_update(context, -- cgit