Previous topic

The nova.scheduler.driver Module

Next topic

The nova.scheduler.filters.affinity_filter Module

This Page

Psst... hey. You're reading the latest content, but it might be out of sync with code. You can read Nova 2011.2 docs or all OpenStack docs too.

The nova.scheduler.filter_scheduler Module

The FilterScheduler is for creating instances locally. You can customize this scheduler by specifying your own Host Filters and Weighing Functions.

class FilterScheduler(*args, **kwargs)

Bases: nova.scheduler.driver.Scheduler

Scheduler that can be used for filtering and weighing.

get_cost_functions(topic=None)

Returns a list of tuples containing weights and cost functions to use for weighing hosts

populate_filter_properties(request_spec, filter_properties)

Stuff things into filter_properties. Can be overriden in a subclass to add more data.

schedule(context, topic, method, *args, **kwargs)

The schedule() contract requires we return the one best-suited host for this request.

NOTE: We’re only focused on compute instances right now, so this method will always raise NoValidHost().

schedule_prep_resize(context, request_spec, *args, **kwargs)

Select a target for resize.

Selects a target host for the instance, post-resize, and casts the prep_resize operation to it.

schedule_run_instance(context, request_spec, *args, **kwargs)

This method is called from nova.compute.api to provision an instance. We first create a build plan (a list of WeightedHosts) and then provision.

Returns a list of the instances created.