Problem:
When deleting a VM in vCenter the VM needs to be turned off first before it can be deleted. From an end user perspective this is not always understood.
Solution:
Create a custom workflow that will combined the 2 steps of turning off the VM and then deleting the VM. This custom workflow is then presented as a button to the end user display. When a VM (VM Context) is selected and then the button pressed it will initiated the custom workflow.
Step one building the workflow:
Policies -> Orchestration -> Workflows -> Add Workflow
Ensure on this screen that the VM context is selected and your personal folder:
There are no inputs to this workflow since it is running in the selected VM context.
In the workflow editor search for power in the upper left hand panel:
Drag and drop that task into the right pane. The comment will show up in the workflow execution screen:
This taks will have to run with in the context of the VM:
Select Power off:
Next to make sure the VM is powered off VM inventory needs to be collected:
The comment will be visible in the workflow execution:
Ensure the correct vCenter account is selected:
Select Power VM again and place comment of Delete VM:
Select the context of the VM:
Select Delete VM:
Option 1: The workflow should look like this:
Option 2: This workflow will move on even if the VM is turned off:
Step 2 the Button:
Policies -> Orchestration -> User VM Action Policy
Either add a new action Policy or add the new action to an existing action. Here it is added to the policy called Action1.
If it is a new action then this would be action #1. In this case there are already 7 actions and this is going to be action #8.
The action label will be the name of the button the end user is going to see. Select the newly created delete VM workflow and decide who can execute / see this action on their screen.
Step 3
Attach the action to a VDC:
In the end user log in session select a VM that is in the VDC that the action policy was attached to. The button will be displayed.
Select the button and execute. In services the execution can bbs followed.
The end user view of the execution of the workflow: