cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4782
Views
6
Helpful
1
Comments
Orf Gelbrich
Cisco Employee
Cisco Employee

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

Screen Shot 2014-12-03 at 7.34.15 AM.png

Ensure on this screen that the VM context is selected and your personal folder:

Screen Shot 2014-12-03 at 7.34.51 AM.png

There are no inputs to this workflow since it is running in the selected VM context.

Screen Shot 2014-12-03 at 7.35.04 AM.png

In the workflow editor search for power in the upper left hand panel:

Screen Shot 2014-12-03 at 7.35.49 AM.png

Drag and drop that task into the right pane.  The comment will show up in the workflow execution screen:

Screen Shot 2014-12-03 at 7.36.09 AM.png

This taks will have to run with in the context of the VM:

Screen Shot 2014-12-03 at 7.36.16 AM.png

Select Power off:

Screen Shot 2014-12-03 at 7.36.26 AM.png

Next to make sure the VM is powered off VM inventory needs to be collected:

Screen Shot 2014-12-03 at 7.36.47 AM.png

The comment will be visible in the workflow execution:

Screen Shot 2014-12-03 at 7.36.59 AM.png

Ensure the correct vCenter account is selected:

Screen Shot 2014-12-03 at 7.37.18 AM.png

Select Power VM again and place comment of Delete VM:

Screen Shot 2014-12-03 at 7.37.50 AM.png

Select the context of the VM:

Screen Shot 2014-12-03 at 7.37.57 AM.png

Select Delete VM:

Screen Shot 2014-12-03 at 7.38.08 AM.png

Option 1: The workflow should look like this:

Screen Shot 2014-12-03 at 7.38.22 AM.png

Option 2: This workflow will move on even if the VM is turned off:

Screen Shot 2017-03-08 at 11.06.08 AM.png

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.

Screen Shot 2014-12-03 at 7.38.37 AM.png

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.

Screen Shot 2014-12-03 at 7.38.51 AM.png

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.

Screen Shot 2014-12-03 at 7.39.40 AM.png

Step 3

Attach the action to a VDC:

Screen Shot 2014-12-03 at 7.40.25 AM.png

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.

Screen Shot 2014-12-03 at 7.45.45 AM.png

Select the button and execute.  In services the execution can bbs followed.

Screen Shot 2014-12-03 at 7.46.11 AM.png

The end user view of the execution of the workflow:

Screen Shot 2014-12-03 at 7.46.26 AM.png

Comments
tprayaga
Level 4
Level 4

Thanks Orf for providing this very useful tip, with detailed explanation, including snapshots. This is very very helpfu.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Quick Links