How to add new Cinder scheduler filter?
I followed devref tutorial to implement FooFilter. I inherited filters.BaseHostFilter class and appended my class name to scheduler_default_filters
of cinder.conf
. However, when I create a volume I get an error saying "Scheduler Host Filter FooFilter could not be found" (see full stack trace).
Also, I am not sure which folder I should put my foo_filter.py
. There seem to be two options (1) cinder/openstack/common/scheduler/filters/foo_filter.py
and (2) cinder/scheduler/filters/foo_filter.py
I get the same error regardless of the location. Am I missing something?
I got this resolved after manually adding my class path
FooFilter = cinder.scheduler.filters.foo_filter.FooFilter
to the /usr/lib/python2.7/dist-packages/cinder-<version>.egg-info/entry_points.txt. Is this the right way to do this? I wonder if entry_points.txt is auto-generated.