The nova.scheduler.utils Module

Utility methods for scheduling.

class GroupDetails

Bases: tuple

GroupDetails(hosts, policies, members)


Alias for field number 0


Alias for field number 2


Alias for field number 1

build_filter_properties(scheduler_hints, forced_host, forced_node, instance_type)

Build the filter_properties dict from data in the boot request.

build_request_spec(ctxt, image, instances, instance_type=None)

Build a request_spec for the scheduler.

The request_spec assumes that all instances to be scheduled are the same type.

parse_options(opts, sep='=', converter=<type 'str'>, name='')

Parse a list of options, each in the format of <key><sep><value>. Also use the converter to convert the value into desired type.

Params opts:list of options, e.g. from oslo_config.cfg.ListOpt
Params sep:the separator
Params converter:
 callable object to convert the value, should raise ValueError for conversion failure
Params name:name of the option
Returns:a lists of tuple of values (key, converted_value)
populate_filter_properties(filter_properties, host_state)

Add additional information to the filter properties after a node has been selected by the scheduling process.

populate_retry(filter_properties, instance_uuid)

Retry the call in case a MessagingTimeout is raised.

A decorator for retrying calls when a service dies mid-request.

Parameters:retries – Number of retries
set_vm_state_and_notify(context, instance_uuid, service, method, updates, ex, request_spec)

changes VM state and notifies.

setup_instance_group(context, request_spec, filter_properties)

Add group_hosts and group_policies fields to filter_properties dict based on instance uuids provided in request_spec, if those instances are belonging to a group.

  • request_spec – Request spec
  • filter_properties – Filter properties

Validates that the filter is configured in the default filters.


Validates that the weigher is configured in the default weighers.

Previous topic

The nova.scheduler.scheduler_options Module

Next topic

The nova.scheduler.weights.affinity Module

Project Source

This Page