Documentation

vCenter Events

vCenter produces events that get generated in response to actions taken on an entity such as VM, Host, Datastore, etc. These events contain immutable facts documenting the entity state changes such as who initiated the change, what action was performed, which object was modified, and when was the change initiated.

Events naturally serve as auditing and troubleshooting tools, allowing an administrator to retrieve details on a specific change. Event Driven Automation builds on the construct of events and enables advanced distributed design patterns driven through Events. VMware Event Broker Appliance aims to enable this for VMware SDDC by enabling VI Administrators to write lean functions (script or code) that are triggered by vCenter Events.

Overview of the vCenter events

vCenter Events are categorized by the Objects and the actions that are allowed on these objects and are documented under the vSphere API 7.0U3 reference.

  • Event
    • ClusterEvent
      • ClusterCreatedEvent, ClusterDestroyedEvent, ClusterOvercommittedEvent…
    • DatastoreEvent
      • DatastoreCapacityIncreasedEvent, DatastoreDestroyedEvent, DatastoreDuplicatedEvent…
    • DatacenterEvent
      • DatacenterCreatedEvent, DatacenterRenamedEvent
    • HostEvent
      • HostShutdownEvent, HostAddedEvent, EnteringMaintenanceModeEvent…
    • VMEvent
      • VmNoNetworkAccessEvent, VmOrphanedEvent, VmPoweredOffEvent…

There are over 1900+ events available on an out of the box install of vCenter that are provided here. You can also get the complete list of events for your specific vCenter using the following powershell script below.

$vcNames = "hostname"

Connect-VIServer -Server $vcNames

$vcenterVersion = ($global:DefaultVIServer.ExtensionData.Content.About.ApiVersion)

$eventMgr = Get-View $global:DefaultVIServer.ExtensionData.Content.EventManager

$results = @()
foreach ($event in $eventMgr.Description.EventInfo) {
    if($event.key -eq "EventEx" -or $event.key -eq "ExtendedEvent") {
        #echo $event
        $eventId = ($event.FullFormat.toString()) -replace "\|.*",""
        $eventType = $event.key
    } else {
        $eventId = $event.key
        $eventType = "Standard"
    }
    $eventCategory = $event.Category
    $eventDescription = $event.Description

    $tmp = [PSCustomObject] @{
        EventId = $eventId;
        EventCategory = $eventCategory
        EventType = $eventType;
        EventDescription = $($eventDescription.Replace("<","").Replace(">",""));
    }

    $results += $tmp
}

Write-Host "Number of Events: $($results.count)"
$results | Sort-Object -Property EventId | ConvertTo-Csv | Out-File -FilePath vcenter-$vcenterVersion-events.csv

Write-Host "Disconnecting from vCenter Server ..."
Disconnect-VIServer * -Confirm:$false

Deploy Event-Driven Functions

Extend your vCenter seamlessly with our pre-built functions