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.host_filter Module

The Host Filter classes are a way to ensure that only hosts that are appropriate are considered when creating a new instance. Hosts that are either incompatible or insufficient to accept a newly-requested instance are removed by Host Filter classes from consideration. Those that pass the filter are then passed on for weighting or other process for ordering.

Filters are in the ‘filters’ directory that is off the ‘scheduler’ directory of nova. Additional filters can be created and added to that directory; be sure to add them to the filters/__init__.py file so that they are part of the nova.schedulers.filters namespace.

nova.scheduler.host_filter.choose_host_filter(filter_name=None)

Since the caller may specify which filter to use we need to have an authoritative list of what is permissible. This function checks the filter name against a predefined set of acceptable filters.