Overview
Hooks are subscriptions to predefined events. With hooks, you can get notified when a specific event is triggered and can react accordingly. There are different context of events, so called event topics, to which you can subscribe.
For example, by using hooks that subscribe the Machine lifecycle and Machine provisioning event topic, you can be notified when a workload is starting, rebooting, etc., or is in a particular state during the deployment (e.g. customizing).
Event Topics
The different event topics are listed in the following table:
Event Topic Name | Description | Service |
---|---|---|
Blueprint component completed | A blueprint component that is part of a composite blueprint finishes provisioning. The component is any blueprint that is part of a composite blueprint. | composition-service |
Blueprint component requested | A blueprint component that is part of a composite blueprint is requested. The component is any blueprint that is part of a composite blueprint. | composition-service |
Blueprint configuration | A blueprint is created, updated, or deleted. | composition-service |
Business group configuration | A business group is created, updated, or deleted. | identity |
Catalog item request completed | A composite blueprint finished provisioning. This event topic includes all blueprint components. It does not include standalone XaaS blueprints. | composition-service |
Catalog item requested | A composite blueprint is requested. This event topic does not include XaaS blueprints. | composition-service |
Component action completed | An action ran on a deployed blueprint component when a deployment action was requested. | composition-service |
Component action requested | An action to run on a deployed blueprint component is requested when a deployment action was requested. | composition-service |
Deployment action completed | An action on a deployed blueprint finished running, including running all the component actions. | composition-service |
Deployment action requested | An action on a deployed blueprint is requested. | composition-service |
EventLog default event | A standard entry is added to the event log. | eventlog-service. The log entry is not distributed to subscribers. |
IPAM IP lifecycle event completion | An IP allocation or deallocation request is finished. | ipam-service |
Machine lifecycle | A provided IaaS action is run on a provisioned machine. | iaas-service |
Machine provisioning | An IaaS machine is in the process of being provisioned. | iaas-service |
Orchestration server configuration | A vRealize Orchestrator server configuration is created, updated, deleted, or modified to use a different default instance. | o11n-gateway-service |
Orchestration server configuration (XaaS) - Obsolete | A vRealize Orchestrator server configuration is created, updated, deleted, or modified to use a different default instance. | advanced-designer-service |
Post Approval | A post-approval policy level is configured to use the event subscription option. | approval-service |
Pre Approval | A pre-approval policy level is configured to use the event subscription option. | approval-service |
Resource reclamation completion event | A resource lease expired and the resources are reclaimed. | management-service |
Events
Once the hooks are active, the events are available to be caught. You have to provide an endpoint (REST) where you want to receive the data payload (JSON) of the event.
Machine lifecycle / Machine provisioning
Using those hooks you can get notification about events regarding your workload (virtual machine) activities. The following is the standard structure of the event data payload that you will receive:
{
machine: {
id: STRING, /* IaaS machine ID */
name: STRING, /* machine name */
externalReference: STRING, /* machine ID on the hypervisor */
owner: STRING, /* machine owner */
type: INTEGER, /* machine type: 0 - virtual machine; 1 - physical machine; 2 - cloud machine */
properties: Properties /* machine properties, see notes below how to expose virtual machine properties */
},
blueprintName: STRING, /* blueprint name */
componentId: STRING, /* component id */
componentTypeId: STRING, /* component type id */
endpointId: STRING, /* endpoint id */
requestId: STRING, /* request id */
nicsInfo: ARRAY, /* IP, MAC for each interface */
lifecycleState: { /* see Life Cycle State Definitions*/
state: STRING,
phase: STRING,
event: STRING
},
virtualMachineEvent: STRING, /* fire an event on that machine - only processed by Manager Service as consumer */
workflowNextState: STRING, /* force the workflow to a specific state - only processed by Manager Service as consumer */
virtualMachineAddOrUpdateProperties: Properties, /* properties on the machine to add/update - only processed by Manager Service as consumer */
virtualMachineDeleteProperties: Properties /* properties to remove from the machine - only processed by Manager Service as consumer */
}
The first important information in the payload is the "lifecycleState" element. This contains information like state, phase and the event.
Property | Description | Format and Values | Examples |
---|---|---|---|
state | Contains workflow name and state name | {workflowName}.{stateName} | VMPSMasterWorkflow32.Requested VMPSMasterWorkflow32.MachineActivated BasicVmWorkflow.BuildComplete |
phase | Contains the phase that triggered a message | PRE, POST, EVENT | PRE. An event is published when entering this state. POST. An event is published when exiting this state. EVENT. An event is published when an IaaS event is received in this state.. |
event | Contains the event. This property is optional and exists only when the phase is EVENT | {workflowName}.{stateName}.EVENT.{eventName} | VMPSMasterWorkflow32.Requested.EVENT.OnProvisionMachine VMPSMasterWorkflow32.VMPSMasterWorkflow32.EVENT.OnBuildSuccess BasicVmWorkflow.CreatingMachine.EVENT.OnCreatingMachineComplete |
Per default, all the available events are triggered.
The table VMPSMasterWorkflow32 States and Events of the official VMware documentation shows the possible catchable events.