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(instance)

Remove usage from the given instance.

abort_resize_claim(instance_uuid, instance_type)

Remove usage for an incoming migration.

confirm_resize(context, migration, status='confirmed')

Cleanup usage for a confirmed resize.

disabled
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 – 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.

resize_claim(*args, **kwargs)

Indicate that resources are needed for a resize operation to this compute host. :param context: security context :param instance_ref: instance to reserve resources for :param instance_type: new instance_type being resized to :param limits: Dict of oversubscription limits for memory, disk,

and CPUs.
Returns:A Claim ticket representing the reserved resources. This should be turned into finalize a resource claim or free resources after the compute operation is finished.
revert_resize(context, migration, status='reverted')

Cleanup usage for a reverted resize.

update_available_resource(*args, **kwargs)

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.rpcapi Module

This Page