flatten distributed scheduler
This branch removes AbstractScheduler, BaseScheduler and LeastCostScheduler and replaces it with DistributedScheduler. Now the points of extension are handled via the --default_host_filters and --least_cost_functions only. Also, greatly simplified the zone handling logic in DistibutedScheduler, mostly by removing the cryptic dicts with helper classes. Fixed up the Least Cost functions to better deal with multiple functions. (In a followup patch I will removed the normalization that occurs as this will be a problem). Tests were mostly rewritten to support this new world order. Debated removing JSONFilter since it's not accessible from the outside world, but decided to keep it as there are discussions afoot on making scheduler changes without having to redeploy code or restart services. HostFilters once again get the all the host service capabilities, but now via a HostInfo class that mostly contains read-only dicts of capabilities. Virtual resource consumption is done in the DistributedScheduler class now. The filters/weighing functions don't need to worry about this. Also, weighing functions only have to return a single host and not worry about the number of instances requested. Change-Id: I92600a4a9c58b1add775c328a18d8f48c305861e
This commit is contained in:
parent
35a2df2b55
commit
5dcf71a64b
@ -158,6 +158,11 @@ def compute_node_get(context, compute_id, session=None):
|
||||
return IMPL.compute_node_get(context, compute_id)
|
||||
|
||||
|
||||
def compute_node_get_all(context, session=None):
|
||||
"""Get all computeNodes."""
|
||||
return IMPL.compute_node_get_all(context)
|
||||
|
||||
|
||||
def compute_node_create(context, values):
|
||||
"""Create a computeNode from the values dictionary."""
|
||||
return IMPL.compute_node_create(context, values)
|
||||
|
@ -366,6 +366,16 @@ def compute_node_get(context, compute_id, session=None):
|
||||
return result
|
||||
|
||||
|
||||
@require_admin_context
|
||||
def compute_node_get_all(context, session=None):
|
||||
if not session:
|
||||
session = get_session()
|
||||
|
||||
return session.query(models.ComputeNode).\
|
||||
options(joinedload('service')).\
|
||||
filter_by(deleted=can_read_deleted(context))
|
||||
|
||||
|
||||
@require_admin_context
|
||||
def compute_node_create(context, values):
|
||||
compute_node_ref = models.ComputeNode()
|
||||
|
Loading…
x
Reference in New Issue
Block a user