Instance Scheduler Filters

Compute uses the nova-scheduler service to determine how to dispatch compute and volume requests. For example, the nova-scheduler service determines which host a VM should launch on. The term host in the context of filters means a physical node that has a nova-compute service running on it. You can configure the scheduler through a variety of options.

By default, the scheduler_driver is configured as a filter scheduler. In the default configuration, this scheduler considers hosts that meet all the following criteria:

  • Have not been attempted for scheduling purposes (RetryFilter).

  • Are in the requested availability zone (AvailabilityZoneFilter).

  • Have sufficient RAM available (RamFilter).

  • Are capable of servicing the request (ComputeFilter).

  • Satisfy the extra specs associated with the instance type (ComputeCapabilitiesFilter).

  • Satisfy any architecture, hypervisor type, or virtual machine mode properties specified on the instance's image properties. (ImagePropertiesFilter).

The most common use of Schedule filters is to control instance affinity.  By creating server groups with affinity or anti-affinity policies the requester can ensure instances are scheduled to the same host (affinity) or are scheduled to different hosts (anti-affinity).

ServerGroupAffinityFilter

The ServerGroupAffinityFilter ensures that an instance is scheduled on to a host from a set of group hosts. To take advantage of this filter, the requester must create a server group with an affinity policy, and pass a scheduler hint, using group as the key and the server group UUID as the value. Using the novacommand-line tool, use the --hint flag. For example:

$ nova server-group-create --policy affinity group-1

$ nova boot --image IMAGE_ID --flavor 1 --hint group=SERVER_GROUP_UUID server-1

ServerGroupAntiAffinityFilter

The ServerGroupAntiAffinityFilter ensures that each instance in a group is on a different host. To take advantage of this filter, the requester must create a server group with an anti-affinity policy, and pass a scheduler hint, using group as the key and the server group UUID as the value. Using the nova command-line tool, use the --hint flag. For example:

$ nova server-group-create --policy anti-affinity group-1

$ nova boot --image IMAGE_ID --flavor 1 --hint group=SERVER_GROUP_UUID server-1

Currently to leverage scheduler hints the requester must launch instances via the API or CLI.  Complete documentation on all Filters can be found in the OpenStack User Manuals

Have more questions? Submit a request
Powered by Zendesk