summaryrefslogtreecommitdiffstats
path: root/nova/compute
diff options
context:
space:
mode:
authorVishvananda Ishaya <vishvananda@gmail.com>2010-12-23 00:14:57 +0000
committerTarmac <>2010-12-23 00:14:57 +0000
commite69f5f90200850db6ffb3210133d361b720be7e9 (patch)
tree1d0ab0c28d6865a26e341e7611050fca650bc618 /nova/compute
parenta49bca309734415cc8fb0d2701c306d02388a0f9 (diff)
parenta7e5a4a39b93b32974ca82b77391368c4f01cdd8 (diff)
Fixes reboot (and rescue) to work even if libvirt doesn't know about the instance and the network doesn't exist.
Diffstat (limited to 'nova/compute')
-rw-r--r--nova/compute/manager.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/nova/compute/manager.py b/nova/compute/manager.py
index de114bdeb..ff8202cca 100644
--- a/nova/compute/manager.py
+++ b/nova/compute/manager.py
@@ -205,8 +205,8 @@ class ComputeManager(manager.Manager):
def reboot_instance(self, context, instance_id):
"""Reboot an instance on this server."""
context = context.elevated()
- instance_ref = self.db.instance_get(context, instance_id)
self._update_state(context, instance_id)
+ instance_ref = self.db.instance_get(context, instance_id)
if instance_ref['state'] != power_state.RUNNING:
logging.warn(_('trying to reboot a non-running '
@@ -220,6 +220,7 @@ class ComputeManager(manager.Manager):
instance_id,
power_state.NOSTATE,
'rebooting')
+ self.network_manager.setup_compute_network(context, instance_id)
self.driver.reboot(instance_ref)
self._update_state(context, instance_id)
@@ -235,6 +236,7 @@ class ComputeManager(manager.Manager):
instance_id,
power_state.NOSTATE,
'rescuing')
+ self.network_manager.setup_compute_network(context, instance_id)
self.driver.rescue(instance_ref)
self._update_state(context, instance_id)