You can manage expired deployments and their resources by using the Expire
action alongside existing event topics.
After a deployment lease in your environment expires, you can use extensibility event topics to perform tasks, such as stopping the back up or monitoring of any deployment resources. To perform these day 2 operations, the
vRealize Automation API uses a system-level
Expire
action. This action is triggered automatically by the system whenever a deployment lease in your organization expires. The
Expire
action trigger precedes the power off event for any resources associated with that deployment.
Note: In previous product releases, the power off event was triggered at the deployment level after lease expiry. Now the power off event is triggered at the resource level for each deployment resource that is in the powered on state.
The
Expire
action is included in the payload of existing event topics, such as
Deployment action requested and
Deployment action completed, and uses the
deploymentid
parameter to perform pre-expiry and post-expiry tasks associated with the deployment resources.
Note: The
Expire
action is triggered approximately 10 to 15 minutes after your deployment lease expires. The system does not trigger lease expiry events prior to the actual lease expiry. The
Expire
action is a system-level action and users cannot trigger the events associated with it manually.
For the current use case, you are using the Deployment action requested event topic along with the Expire
action to back up a virtual machine in your deployment as a template. For this case, the back up is performed by using a vRealize Orchestrator workflow but the same task can also be performed by using an extensibility action as the runnable item of the subscription.
Procedure
What to do next
After the extensibility subscription is triggered by the lease expiry event and the workflow run is successful, navigate to the vSphere Web Client and validate that your virtual machine is converted to a template.