4.5. Scheduling hosts
The Compute scheduling service determines on which host (or host aggregate), an instance will be placed. As an administrator, you can influence where the scheduler will place an instance. For example, you might want to limit scheduling to hosts in a certain group or with the right RAM.
You can configure the following components:
- Filters - Determine the initial set of hosts on which an instance might be placed (see 「Configuring scheduling filters」).
- Weights - When filtering is complete, the resulting set of hosts are prioritized using the weighting system. The highest weight has the highest priority (see 「Configuring scheduling weights」).
-
Scheduler service - There are a number of configuration options in the
/var/lib/config-data/puppet-generated/<nova_container>/etc/nova/nova.conf
file (on the scheduler host), which determine how the scheduler executes its tasks, and handles weights and filters.
In the following diagram, both host 1 and 3 are eligible after filtering. Host 1 has the highest weight and therefore has the highest priority for scheduling.
4.5.1. Configuring scheduling filters
You define the filters you want the scheduler to use by adding or removing filters from the NovaSchedulerDefaultFilters
parameter in your Compute environment file.
The default configuration runs the following filters in the scheduler:
- RetryFilter
- AvailabilityZoneFilter
- ComputeFilter
- ComputeCapabilitiesFilter
- ImagePropertiesFilter
- ServerGroupAntiAffinityFilter
- ServerGroupAffinityFilter
Some filters use information in parameters passed to the instance in:
-
The
nova boot
command. - The instance’s flavor (see 「Updating flavor metadata」)
- The instance’s image (see 付録A Image configuration parameters).
The following table lists all the available filters.
Filter | Description |
---|---|
| Only passes hosts in host aggregates whose metadata matches the instance’s image metadata; only valid if a host aggregate is specified for the instance. For more information, see 「Creating an image」. |
| Metadata in the host aggregate must match the host’s flavor metadata. For more information, see 「Updating flavor metadata」. |
This filter can only be specified in the same
| |
|
A host with the specified 注記 The tenant can still place instances on other hosts. |
| Passes all available hosts (however, does not disable other filters). |
| Filters using the instance’s specified availability zone. |
|
Ensures Compute metadata is read correctly. Anything before the |
| Passes only hosts that are operational and enabled. |
|
Enables an instance to build on a host that is different from one or more specified hosts. Specify |
| Only passes hosts that match the instance’s image properties. For more information, see 「Creating an image」. |
|
Passes only isolated hosts running isolated images that are specified using |
| Recognises and uses an instance’s custom JSON filters:
|
The filter is specified as a query hint in the
| |
|
Use this filter to limit scheduling to Compute nodes that report the metrics configured by using To use this filter, add the following configuration to your Compute environment file: parameter_defaults: ComputeExtraConfig: nova::config::nova_config: DEFAULT/compute_monitors: value: 'cpu.virt_driver'
By default, the Compute scheduling service updates the metrics every 60 seconds. To ensure the metrics are up-to-date, you can increase the frequency at which the metrics data is refreshed using the parameter_defaults: ComputeExtraConfig: nova::config::nova_config: DEFAULT/update_resources_interval: value: '2' |
| Filters out hosts based on its NUMA topology. If the instance has no topology defined, any host can be used. The filter tries to match the exact NUMA topology of the instance to those of the host (it does not attempt to pack the instance onto the host). The filter also looks at the standard over-subscription limits for each NUMA node, and provides limits to the compute host accordingly. |
|
Filters out hosts that have failed a scheduling attempt; valid if |
|
Passes one or more specified hosts; specify hosts for the instance using the |
| Only passes hosts for a specific server group:
|
| Only passes hosts in a server group that do not already host an instance:
|
|
Only passes hosts on the specified IP subnet range specified by the instance’s cidr and
|