diff --git a/manila/scheduler/drivers/filter.py b/manila/scheduler/drivers/filter.py index 9b44dc8d29..f27e82ab81 100644 --- a/manila/scheduler/drivers/filter.py +++ b/manila/scheduler/drivers/filter.py @@ -531,8 +531,12 @@ class FilterScheduler(base.Scheduler): context, filter_properties, request_spec) hosts = self.host_manager.get_all_host_states_share(elevated) + filter_class_names = None + if request_spec.get('is_share_extend', None): + filter_class_names = CONF.scheduler_default_extend_filters hosts, last_filter = self.host_manager.get_filtered_hosts( - hosts, filter_properties) + hosts, filter_properties, + filter_class_names=filter_class_names) hosts = self.host_manager.get_weighed_hosts(hosts, filter_properties) for tgt_host in hosts: diff --git a/manila/scheduler/host_manager.py b/manila/scheduler/host_manager.py index bc3e984c91..bca77c362e 100644 --- a/manila/scheduler/host_manager.py +++ b/manila/scheduler/host_manager.py @@ -69,6 +69,14 @@ host_manager_opts = [ ], help='Which filter class names to use for filtering hosts ' 'creating share group when not specified in the request.'), + cfg.ListOpt( + 'scheduler_default_extend_filters', + default=[ + 'CapacityFilter', + 'DriverFilter', + ], + help='Which filter class names to use for filtering hosts ' + 'extending share when not specified in the request.'), ] CONF = cfg.CONF diff --git a/releasenotes/notes/bug-1973621-add-scheduler-default-extend-filters-1c4f2a1863d0d95b.yaml b/releasenotes/notes/bug-1973621-add-scheduler-default-extend-filters-1c4f2a1863d0d95b.yaml new file mode 100644 index 0000000000..d844027029 --- /dev/null +++ b/releasenotes/notes/bug-1973621-add-scheduler-default-extend-filters-1c4f2a1863d0d95b.yaml @@ -0,0 +1,6 @@ +--- +upgrade: + - | + When using scheduler filters during share extend, only few filters are + necessary. To provide those configurable list of filters for share extend, + added new option `scheduler_default_extend_filters`.