The nova.scheduler.utils Module

Utility methods for scheduling.

class GroupDetails

Bases: tuple

GroupDetails(hosts, policies)

hosts

Alias for field number 0

policies

Alias for field number 1

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_on_timeout(retries=1)

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
Returns:Decorator
retry_select_destinations(func)
set_vm_state_and_notify(context, instance_uuid, service, method, updates, ex, request_spec, db)

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.

Parameters:
  • request_spec – Request spec
  • filter_properties – Filter properties
validate_filter(filter)

Validates that the filter is configured in the default filters.

Previous topic

The nova.scheduler.scheduler_options Module

Next topic

The nova.scheduler.weights.io_ops Module

Project Source

This Page