File: filter.pp

package info (click to toggle)
puppet-module-nova 25.0.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,100 kB
  • sloc: ruby: 11,433; python: 38; sh: 10; makefile: 10
file content (198 lines) | stat: -rw-r--r-- 8,712 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
# == Class: nova::scheduler::filter
#
# This class is aim to configure nova.scheduler filter
#
# === Parameters:
#
# [*host_subset_size*]
#   (optional) defines the subset size that a host is chosen from
#   Defaults to $facts['os_service_default']
#
# [*max_io_ops_per_host*]
#   (optional) Ignore hosts that have too many builds/resizes/snaps/migrations
#   Defaults to $facts['os_service_default']
#
# [*max_instances_per_host*]
#   (optional) Ignore hosts that have too many instances
#   Defaults to $facts['os_service_default']
#
# [*isolated_images*]
#   (optional) An array of images to run on isolated host
#   Defaults to $facts['os_service_default']
#
# [*isolated_hosts*]
#   (optional) An array of hosts reserved for specific images
#   Defaults to $facts['os_service_default']
#
# [*available_filters*]
#   (optional) An array with filter classes available to the scheduler.
#   Example: ['first.filter.class', 'second.filter.class']
#   Defaults to ['nova.scheduler.filters.all_filters']
#
# [*enabled_filters*]
#   (optional) An array of filters to be used by default
#   Defaults to $facts['os_service_default']
#
# [*weight_classes*]
#   (optional) Which weight class names to use for weighing hosts
#   Defaults to 'nova.scheduler.weights.all_weighers'
#
# [*track_instance_changes*]
#   (optional) Enable querying of individual hosts for instance information.
#   Defaults to $facts['os_service_default']
#
# [*ram_weight_multiplier*]
#   (optional) Ram weight multiplier ratio. This option determines how hosts
#   with more or less available RAM are weighed.
#   Defaults to $facts['os_service_default']
#
# [*cpu_weight_multiplier*]
#   (optional) CPU weight multiplier ratio. This options determines how hosts
#   with more or less available CPU cores are weighed. Negative numbers mean
#   to stack vs spread.
#   Defaults to $facts['os_service_default']
#
# [*disk_weight_multiplier*]
#   (optional) Disk weight multiplier ratio. Multiplier used for weighing free
#   disk space. Negative numbers mean to stack vs spread.
#   Defaults to $facts['os_service_default']
#
# [*io_ops_weight_multiplier*]
#   (optional) IO operations weight multiplier ratio. This option determines
#   how hosts with differing workloads are weighed
#   Defaults to $facts['os_service_default']
#
# [*soft_affinity_weight_multiplier*]
#   (optional) Multiplier used for weighing hosts for group soft-affinity
#   Defaults to $facts['os_service_default']
#
# [*soft_anti_affinity_weight_multiplier*]
#   (optional) Multiplier used for weighing hosts for group soft-anti-affinity
#   Defaults to $facts['os_service_default']
#
# [*build_failure_weight_multiplier*]
#   (optional) Multiplier used for weighing hosts that have had recent build
#   failures
#   Defaults to $facts['os_service_default']
#
# [*cross_cell_move_weight_multiplier*]
#   (optional) Multiplier used for weighing hosts during a cross-cell move
#   Defaults to $facts['os_service_default']
#
# [*num_instances_weight_multiplier*]
#   (optional) Number of instances weight multiplier ratio.
#   Defaults to $facts['os_service_default']
#
# [*hypervisor_version_weight_multiplier*]
#   (optional) Hypervisor Version weight multiplier ratio.
#   Defaults to $facts['os_service_default']
#
# [*shuffle_best_same_weighed_hosts*]
#   (optional) Enabled spreading the instances between hosts with the same
#   best weight
#   Defaults to $facts['os_service_default']
#
# [*restrict_isolated_hosts_to_isolated_images*]
#   (optional) Prevent non-isolated images from being built on isolated hosts.
#   Defaults to $facts['os_service_default']
#
# [*aggregate_image_properties_isolation_namespace*]
#   (optional) Image property namespace for use in the host aggregate
#   Defaults to $facts['os_service_default']
#
# [*aggregate_image_properties_isolation_separator*]
#   (optional) Separator character(s) for image property namespace and name
#   Defaults to $facts['os_service_default']
#
# [*pci_in_placement*]
#   (optional) Enable scheduling and claiming PCI devices in Placement.
#   Defaults to $facts['os_service_default']
#
class nova::scheduler::filter (
  $host_subset_size                               = $facts['os_service_default'],
  $max_io_ops_per_host                            = $facts['os_service_default'],
  $max_instances_per_host                         = $facts['os_service_default'],
  $isolated_images                                = $facts['os_service_default'],
  $isolated_hosts                                 = $facts['os_service_default'],
  $available_filters                              = $facts['os_service_default'],
  $enabled_filters                                = $facts['os_service_default'],
  $weight_classes                                 = $facts['os_service_default'],
  $track_instance_changes                         = $facts['os_service_default'],
  $ram_weight_multiplier                          = $facts['os_service_default'],
  $cpu_weight_multiplier                          = $facts['os_service_default'],
  $disk_weight_multiplier                         = $facts['os_service_default'],
  $io_ops_weight_multiplier                       = $facts['os_service_default'],
  $soft_affinity_weight_multiplier                = $facts['os_service_default'],
  $soft_anti_affinity_weight_multiplier           = $facts['os_service_default'],
  $build_failure_weight_multiplier                = $facts['os_service_default'],
  $cross_cell_move_weight_multiplier              = $facts['os_service_default'],
  $num_instances_weight_multiplier                = $facts['os_service_default'],
  $hypervisor_version_weight_multiplier           = $facts['os_service_default'],
  $shuffle_best_same_weighed_hosts                = $facts['os_service_default'],
  $restrict_isolated_hosts_to_isolated_images     = $facts['os_service_default'],
  $aggregate_image_properties_isolation_namespace = $facts['os_service_default'],
  $aggregate_image_properties_isolation_separator = $facts['os_service_default'],
  $pci_in_placement                               = $facts['os_service_default'],
) {

  include nova::deps

  if empty($available_filters) {
    warning('available_filters is empty. Nova is deployed without filters')
  }
  if empty($enabled_filters) {
    warning('enabled_filters is empty. Nova is deployed without filters')
  }

  nova_config {
    'filter_scheduler/host_subset_size':
      value => $host_subset_size;
    'filter_scheduler/max_io_ops_per_host':
      value => $max_io_ops_per_host;
    'filter_scheduler/max_instances_per_host':
      value => $max_instances_per_host;
    'filter_scheduler/track_instance_changes':
      value => $track_instance_changes;
    'filter_scheduler/available_filters':
      value => $available_filters;
    'filter_scheduler/weight_classes':
      value => $weight_classes;
    'filter_scheduler/enabled_filters':
      value => join(any2array($enabled_filters), ',');
    'filter_scheduler/isolated_images':
      value => join(any2array($isolated_images), ',');
    'filter_scheduler/isolated_hosts':
      value => join(any2array($isolated_hosts), ',');
    'filter_scheduler/ram_weight_multiplier':
      value => $ram_weight_multiplier;
    'filter_scheduler/cpu_weight_multiplier':
      value => $cpu_weight_multiplier;
    'filter_scheduler/disk_weight_multiplier':
      value => $disk_weight_multiplier;
    'filter_scheduler/io_ops_weight_multiplier':
      value => $io_ops_weight_multiplier;
    'filter_scheduler/soft_affinity_weight_multiplier':
      value => $soft_affinity_weight_multiplier;
    'filter_scheduler/soft_anti_affinity_weight_multiplier':
      value => $soft_anti_affinity_weight_multiplier;
    'filter_scheduler/build_failure_weight_multiplier':
      value => $build_failure_weight_multiplier;
    'filter_scheduler/cross_cell_move_weight_multiplier':
      value => $cross_cell_move_weight_multiplier;
    'filter_scheduler/num_instances_weight_multiplier':
      value => $num_instances_weight_multiplier;
    'filter_scheduler/hypervisor_version_weight_multiplier':
      value => $hypervisor_version_weight_multiplier;
    'filter_scheduler/shuffle_best_same_weighed_hosts':
      value => $shuffle_best_same_weighed_hosts;
    'filter_scheduler/restrict_isolated_hosts_to_isolated_images':
      value => $restrict_isolated_hosts_to_isolated_images;
    'filter_scheduler/aggregate_image_properties_isolation_namespace':
      value => $aggregate_image_properties_isolation_namespace;
    'filter_scheduler/aggregate_image_properties_isolation_separator':
      value => $aggregate_image_properties_isolation_separator;
    'filter_scheduler/pci_in_placement':
      value => $pci_in_placement;
  }

}