The AbsractScheduler is an abstract class Scheduler for creating instances locally or across zones. Two methods should be overridden in order to customize the behavior: filter_hosts() and weigh_hosts(). The default behavior is to simply select all hosts and weight them the same.
Bases: nova.scheduler.driver.Scheduler
Base class for creating Schedulers that can work across any nova deployment, from simple designs to multiply-nested zones.
Filter the full host list returned from the ZoneManager. By default, this method only applies the basic_ram_filter(), meaning all hosts with at least enough RAM for the requested instance are returned.
Override in subclasses to provide greater selectivity.
The schedule() contract requires we return the one best-suited host for this request.
This method is called from nova.compute.api to provision an instance. However we need to look at the parameters being passed in to see if this is a request to: 1. Create a Build Plan and then provision, or 2. Use the Build Plan information in the request parameters
to simply create the instance (either in this zone or a child zone).
Select returns a list of weights and zone/host information corresponding to the best hosts to service the request. Any child zone information has been encrypted so as not to reveal anything about the children.
This version assigns a weight of 1 to all hosts, making selection of any host basically a random event. Override this method in your subclass to add logic to prefer one potential host over another.
Bases: nova.exception.NovaException