An Event is a data object type that contains information about state changes of managed entities and other objects on the server. Events include user actions and system actions that occur on datacenters, datastores, clusters, hosts, resource pools, virtual machines, networks, and distributed virtual switches. For example, these common system activities generate one or more
Event data objects:
In the vSphere Client, information from Event objects generated on a standalone ESXi hosts displays in the Events tab. For managed hosts, information from
Event objects displays in the Tasks & Events tab.
Persistence of Event objects depends on the system setup.
A standalone ESXi host might keep about 15 minutes worth of Event data, but this can vary depending on the processing load of the host, the number of virtual machines, and other factors.
Using an EventHistoryCollector, you can obtain information about these objects as they are being collected on a specific ESX/ESXi system, or from a specific historical period from the database. See
Using an EventHistoryCollector.
EventManager is the service interface for working with the event infrastructure.
EventManager Managed Object and Associated Objects shows
EventManager and related objects. An
EventManager has these properties:
Event subtypes define the events that the system generates.
Event Data Object and Sample Subtypes shows only a few of the subtypes that extend the
Event data object. For example,
TaskEvent inherits all
Event properties and includes an
info property that is an instance of a
TaskInfo object (see
Monitoring TaskInfo Properties).
When displayed at the console, Event data objects are not formatted and do not provide context information. You can format an
Event message using the predefined string in the
Event.fullFormattedMessage property.
You can also format an Event message based on contextual information. At runtime, the
Event data object is populated with values that contain information associated with the source of an event, for example, the
Event data object’s
computeResource,
datacenter,
ds,
dvs,
host,
net, and
vm properties.
You can use the properties of an Event object with the information in the
EventDescriptionEventDetail in
EventManager.description.eventInfo to format event messages.
The EventManager.LogUserEvent method allows you to create user log
Event objects. You can associate your custom
Event with any managed entity. User log events are useful for marking actions or status associated with the objects your application deals with.
The EventManager.EventEx method allows you to create an event that contains an arbitrary dictionary of key-value pairs. This kind of custom event allows greater flexibility to store application data that is not associated with a managed entity, and is not limited to a single string value. The custom event structure also contains more sophisticated metadata than user log events.