The nova.scheduler.host_manager Module

Manage hosts in the current zone.

class HostManager

Bases: object

Base HostManager class.


Deletes internal HostManager information about a specific aggregate.

delete_instance_info(*args, **kwargs)

Receives the UUID from a compute node when one of its instances is terminated.

The instance in the local view of the host’s instances is removed.


Returns a list of HostStates that represents all the hosts the HostManager knows about. Also, each of the consumable resources in HostState are pre-populated and adjusted based on data in the db.

get_filtered_hosts(hosts, spec_obj, filter_class_names=None, index=0)

Filter hosts and return only ones passing all filters.

get_weighed_hosts(hosts, spec_obj)

Weigh the hosts.

host_state_cls(host, node, **kwargs)
sync_instance_info(*args, **kwargs)

Receives the uuids of the instances on a host.

This method is periodically called by the compute nodes, which send a list of all the UUID values for the instances on that node. This is used by the scheduler’s HostManager to detect when its view of the compute node’s instances is out of sync.


Updates internal HostManager information about aggregates.

update_instance_info(*args, **kwargs)

Receives an InstanceList object from a compute node.

This method receives information from a compute node when it starts up, or when its instances have changed, and updates its view of hosts and instances with it.

class HostState(host, node)

Bases: object

Mutable and immutable information tracked for a host. This is an attempt to remove the ad-hoc data structures previously used and lock down access.


Incrementally update host state from a RequestSpec object.

update(compute=None, service=None, aggregates=None, inst_dict=None)

Update all information about a host.

class ReadOnlyDict(source=None)

Bases: UserDict.IterableUserDict

A read-only dict.

pop(key, *args)

Set updated time of HostState when consuming succeed.

Previous topic

The nova.scheduler.filters.utils Module

Next topic

The nova.scheduler.ironic_host_manager Module

Project Source

This Page