How to add new Cinder scheduler filter?

asked 2016-06-14 22:47:34 -0500

Nodir gravatar image

updated 2016-06-14 22:51:46 -0500

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?

edit retag flag offensive close merge delete

Comments

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.

Nodir gravatar imageNodir ( 2016-06-17 21:07:40 -0500 )edit