summaryrefslogtreecommitdiffstats
path: root/nova/compute
diff options
context:
space:
mode:
authorBrian Lamar <brian.lamar@rackspace.com>2011-03-31 16:46:08 -0400
committerBrian Lamar <brian.lamar@rackspace.com>2011-03-31 16:46:08 -0400
commit7688cbb07ffcfd6446dc9ede60fb9eb610809c1d (patch)
treefb773a884e046bccc21c4b6b22b23c86b7514f2c /nova/compute
parent7803ee8c196f2890cd6e0bb383e79782b1248289 (diff)
Removal of instance_set_state from driver code, it shouldnt be there, but instead should be in the compute manager.
Diffstat (limited to 'nova/compute')
-rw-r--r--nova/compute/manager.py15
1 files changed, 4 insertions, 11 deletions
diff --git a/nova/compute/manager.py b/nova/compute/manager.py
index 94d4f1991..db1d6950e 100644
--- a/nova/compute/manager.py
+++ b/nova/compute/manager.py
@@ -240,21 +240,16 @@ class ComputeManager(manager.SchedulerDependentManager):
instance_id)
# TODO(vish) check to make sure the availability zone matches
- self.db.instance_set_state(context,
- instance_id,
- power_state.NOSTATE,
- 'spawning')
+ self._update_state(context, instance_id, power_state.BUILDING)
try:
self.driver.spawn(instance_ref)
self._update_launched_at(context, instance_id)
- except Exception: # pylint: disable=W0702
+ except Exception as ex: # pylint: disable=W0702
+ LOG.debug(ex)
LOG.exception(_("Instance '%s' failed to spawn. Is virtualization"
" enabled in the BIOS?"), instance_id,
context=context)
- self.db.instance_set_state(context,
- instance_id,
- power_state.SHUTDOWN)
self._update_state(context, instance_id)
@@ -1133,9 +1128,7 @@ class ComputeManager(manager.SchedulerDependentManager):
if vm_state != db_state:
LOG.info(_("DB/VM state mismatch. Changing state from "
"'%(db_state)s' to '%(vm_state)s'") % locals())
- self.db.instance_set_state(context,
- db_instance['id'],
- vm_state)
+ self._update_state(context, db_instance['id'], vm_state)
if vm_state == power_state.SHUTOFF:
# TODO(soren): This is what the compute manager does when you