Compute-related Utilities and helpers.
-
finish_instance_usage_audit(context, begin, end, host, errors, message)
-
get_device_name_for_instance(context, instance, device)
Validates (or generates) a device name for instance.
If device is not set, it will generate a unique device appropriate
for the instance. It uses the block device mapping table to find
valid device names. If the device name is valid but applicable to
a different backend (for example /dev/vdc is specified but the
backend uses /dev/xvdc), the device name will be converted to the
appropriate format.
-
get_nw_info_for_instance(instance)
-
has_audit_been_run(context, host, timestamp=None)
-
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.
|
-
start_instance_usage_audit(context, begin, end, host, num_instances)