Previous topic

The nova.compute.task_states Module

Next topic

The nova.compute.vm_states Module

This Page

Psst... hey. You're reading the latest content, but it might be out of sync with code. You can read Nova 2011.2 docs or all OpenStack docs too.

The nova.compute.utils Module

Compute-related Utilities and helpers.

get_nw_info_for_instance(instance)
notify_about_instance_usage(context, instance, event_suffix, network_info=None, system_metadata=None, extra_usage_info=None, host=None)

Send a notification about an instance.

Parameters:
  • event_suffix – Event type like “delete.start” or “exists”
  • network_info – Networking information, if provided.
  • system_metadata – system_metadata DB entries for the instance, if provided.
  • extra_usage_info – Dictionary containing extra values to add or override in the notification.
  • host – Compute host for the instance, if specified. Default is FLAGS.host
notify_usage_exists(context, instance_ref, current_period=False, ignore_missing_network_data=True, system_metadata=None, extra_usage_info=None)

Generates ‘exists’ notification for an instance for usage auditing purposes.

Parameters:
  • current_period – if True, this will generate a usage for the current usage period; if False, this will generate a usage for the previous audit period.
  • ignore_missing_network_data – if True, log any exceptions generated while getting network info; if False, raise the exception.
  • system_metadata – system_metadata DB entries for the instance, if not None. NOTE: Currently unused here in trunk, but needed for potential custom modifications.
  • extra_usage_info – Dictionary containing extra values to add or override in the notification if not None.