The nova.compute.resource_tracker Module

Track resources like memory and disk for a compute host. Provides the scheduler with useful information about availability through the ComputeNode model.

class ResourceTracker(host, driver, nodename)

Bases: object

Compute helper class for keeping track of resource usage as instances are built and destroyed.

abort_instance_claim(*args, **kwargs)

Remove usage from the given instance.

disabled
drop_move_claim(*args, **kwargs)

Remove usage for an incoming/outgoing migration.

instance_claim(*args, **kwargs)

Indicate that some resources are needed for an upcoming compute instance build operation.

This should be called before the compute node is about to perform an instance build operation that will consume additional resources.

Parameters:
  • context – security context
  • instance_ref (nova.objects.instance.Instance object) – instance to reserve resources for.
  • limits – Dict of oversubscription limits for memory, disk, and CPUs.
Returns:

A Claim ticket representing the reserved resources. It can be used to revert the resource usage if an error occurs during the instance build.

rebuild_claim(*args, **kwargs)

Create a claim for a rebuild operation.

resize_claim(*args, **kwargs)

Create a claim for a resize or cold-migration move.

update_available_resource(context)

Override in-memory calculations of compute node resource usage based on data audited from the hypervisor layer.

Add in resource claims in progress to account for operations that have declared a need for resources, but not necessarily retrieved them from the hypervisor layer yet.

update_usage(*args, **kwargs)

Update the resource usage and stats after a change in an instance

Previous topic

The nova.compute.power_state Module

Next topic

The nova.compute.resources.base Module

Project Source

This Page