schedulers should set instance to error state
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Medium
|
Kevin L. Mitchell |
Bug Description
A recent change went in where compute/api will create instance DB entry directly if zone routing is off... instead of waiting for the scheduler to do it. So now, if the scheduler raises NoValidHost or errors out in some way... it needs to make sure to set the vm_state on the instance to ERROR... otherwise it's left in BUILD state forever.
Something like this is needed (Note this is untested... and this example is for distributed_
--- a/nova/
+++ b/nova/
@@ -36,6 +36,7 @@ from nova import log as logging
from nova import rpc
from nova.compute import api as compute_api
+from nova.compute import vm_states
from nova.scheduler import api
from nova.scheduler import driver
from nova.scheduler import filters
@@ -99,6 +100,8 @@ class DistributedSche
if not weighted_hosts:
+ # This is how you can tell compute/api created the instance
+ if request_
+ db.instance_
raise driver.
summary: |
- distributed_scheduler should set instance to error state + schedulers should set instance to error state |
description: | updated |
Changed in nova: | |
importance: | Undecided → Medium |
status: | New → Confirmed |
Changed in nova: | |
assignee: | nobody → Kevin L. Mitchell (klmitch) |
Changed in nova: | |
milestone: | none → essex-2 |
status: | Fix Committed → Fix Released |
Changed in nova: | |
milestone: | essex-2 → 2012.1 |
Reviewed: https:/ /review. openstack. org/1823 github. com/openstack/ nova/commit/ 21e08712d9ac557 7c27e7ea4c92713 72bc0bd3ed
Committed: http://
Submitter: Jenkins
Branch: master
status fixcommitted
done
commit 21e08712d9ac557 7c27e7ea4c92713 72bc0bd3ed
Author: Kevin L. Mitchell <email address hidden>
Date: Mon Nov 21 14:39:22 2011 -0600
Put instances in ERROR state when scheduler fails.
When the scheduler's selected driver method raises an exception, such
as NoValidHost, any affected instance must be placed into the ERROR
state. This is done by catching exceptions raised in _schedule() and,
if 'instance_id' is present in kwargs, moving the identified instance
to the ERROR state. This fixes bug 886289.
Change-Id: I5c73549e073493 701b86658569823 b9bc161291d