11-03-2015 04:16 AM - edited 03-01-2019 06:38 AM
Task Name | Power off many VM's |
Description |
|
Prerequisites |
|
Category | Workflow |
Components | |
User Inputs |
Instructions for Regular Workflow Use:
The request was from a very large power handler in Texas to be able to power down many VM's every Sunday.
The workflow:
Global variables and their Admin input values:
VM_Selector_Many: Contains the list of VM ID for the loop to run through
VM_ID_From_Loop: Is the loop index
Cloud: The vCenter the workflow will collect inventory from
The admin input selection:
If a admin filter is selected:
At run time this will look like this:
The result at run time in vCenter:
The case when the power off errors out since the VM is already power off:
The resulting e-mails to the submitter:
Things to point out in the e-mail task:
The internal variable ${SUBMITTER_EMAIL}
and the loop output variable
The variables in the loop:
Denote again from the global variables the variable types:
Clean run when the selected VM's are power on:
The log:
Service Request ID: 5710
Workflow Inputs:
- VM_Selector_Many
- VM_ID_From_Loop
- Cloud
Nov 03, 2015 11:25:20 UTC Request submitted
Nov 03, 2015 11:25:25 UTC Executing workflow item number 1
Nov 03, 2015 11:25:25 UTC Completed workflow item number 1, with status Completed
Nov 03, 2015 11:25:31 UTC Executing workflow item number 2
Nov 03, 2015 11:25:32 UTC Trigger context executeWorkFlowStep called
Nov 03, 2015 11:25:32 UTC Executing custom action Multi_VM_Power_OFF (Start Loop)
Nov 03, 2015 11:25:32 UTC Executing custom action Multi_VM_Power_OFF (Start Loop)
Nov 03, 2015 11:25:35 UTC Start While task execution iteration no - 1
Nov 03, 2015 11:25:41 UTC Task #1 (Multi_VM_Power_OFF (Start Loop)) completed successfully in 9 seconds
Nov 03, 2015 11:25:41 UTC Input/Output values for Task #1 (Multi_VM_Power_OFF (Start Loop)):
Nov 03, 2015 11:25:41 UTC [Local Input: List based iteration = true]
Nov 03, 2015 11:25:41 UTC [Mapped Input: Input for list based iteration = 1145,1146]
Nov 03, 2015 11:25:41 UTC [Local Input: User Input to assign iterated values = input_1_VM_ID_From_Loop29]
Nov 03, 2015 11:25:41 UTC [Local Input: Count based iteration = false]
Nov 03, 2015 11:25:41 UTC [Local Input: Number of times to loop = ]
Nov 03, 2015 11:25:41 UTC [Output: START_LOOP_OUTPUT = 1145]
Nov 03, 2015 11:25:41 UTC Completed workflow item number 2, with status Completed
Nov 03, 2015 11:25:47 UTC Executing workflow item number 3
Nov 03, 2015 11:25:47 UTC Trigger context executeWorkFlowStep called
Nov 03, 2015 11:25:47 UTC Executing custom action Multi_VM_Power_OFF (VM Power Action)
Nov 03, 2015 11:25:47 UTC Executing custom action Multi_VM_Power_OFF (VM Power Action)
Nov 03, 2015 11:25:51 UTC Executing action powerOff on VM 1145 as part of custom action Multi_VM_Power_OFF
Nov 03, 2015 11:25:51 UTC Waiting for action to complete
Nov 03, 2015 11:25:52 UTC Initiated task, waiting for completion...
Nov 03, 2015 11:25:56 UTC Task completed with status success
Nov 03, 2015 11:26:21 UTC Action Complete
Nov 03, 2015 11:26:21 UTC Task #2 (Multi_VM_Power_OFF (VM Power Action)) completed successfully in 34 seconds
Nov 03, 2015 11:26:21 UTC Input/Output values for Task #2 (Multi_VM_Power_OFF (VM Power Action)):
Nov 03, 2015 11:26:21 UTC [Mapped Input: Select VM = 1145]
Nov 03, 2015 11:26:21 UTC [Local Input: VM Action = powerOff]
Nov 03, 2015 11:26:21 UTC Completed workflow item number 3, with status Completed
Nov 03, 2015 11:26:24 UTC Executing workflow item number 4
Nov 03, 2015 11:26:24 UTC Trigger context executeWorkFlowStep called
Nov 03, 2015 11:26:24 UTC Executing custom action Multi_VM_Power_OFF (End Loop)
Nov 03, 2015 11:26:24 UTC Executing custom action Multi_VM_Power_OFF (End Loop)
Nov 03, 2015 11:26:28 UTC End While task execution iteration no - 1
Nov 03, 2015 11:26:28 UTC Task #3 (Multi_VM_Power_OFF (End Loop)) completed successfully in 3 seconds
Nov 03, 2015 11:26:28 UTC Input/Output values for Task #3 (Multi_VM_Power_OFF (End Loop)):
Nov 03, 2015 11:26:28 UTC Completed workflow item number 4, with status
Nov 03, 2015 11:26:30 UTC Executing workflow item number 2
Nov 03, 2015 11:26:30 UTC Trigger context executeWorkFlowStep called
Nov 03, 2015 11:26:31 UTC Executing custom action Multi_VM_Power_OFF (Start Loop)
Nov 03, 2015 11:26:31 UTC Executing custom action Multi_VM_Power_OFF (Start Loop)
Nov 03, 2015 11:26:35 UTC Start While task execution iteration no - 2
Nov 03, 2015 11:26:42 UTC Task #1 (Multi_VM_Power_OFF (Start Loop)) completed successfully in 11 seconds
Nov 03, 2015 11:26:42 UTC Input/Output values for Task #1 (Multi_VM_Power_OFF (Start Loop)):
Nov 03, 2015 11:26:42 UTC [Local Input: List based iteration = true]
Nov 03, 2015 11:26:42 UTC [Mapped Input: Input for list based iteration = 1145,1146]
Nov 03, 2015 11:26:42 UTC [Local Input: User Input to assign iterated values = input_1_VM_ID_From_Loop29]
Nov 03, 2015 11:26:42 UTC [Local Input: Count based iteration = false]
Nov 03, 2015 11:26:42 UTC [Local Input: Number of times to loop = ]
Nov 03, 2015 11:26:42 UTC [Output: START_LOOP_OUTPUT = 1146]
Nov 03, 2015 11:26:42 UTC Completed workflow item number 2, with status Completed
Nov 03, 2015 11:26:46 UTC Executing workflow item number 3
Nov 03, 2015 11:26:46 UTC Trigger context executeWorkFlowStep called
Nov 03, 2015 11:26:46 UTC Executing custom action Multi_VM_Power_OFF (VM Power Action)
Nov 03, 2015 11:26:46 UTC Executing custom action Multi_VM_Power_OFF (VM Power Action)
Nov 03, 2015 11:26:51 UTC Executing action powerOff on VM 1146 as part of custom action Multi_VM_Power_OFF
Nov 03, 2015 11:26:51 UTC Waiting for action to complete
Nov 03, 2015 11:26:51 UTC Initiated task, waiting for completion...
Nov 03, 2015 11:26:54 UTC Task completed with status success
Nov 03, 2015 11:27:21 UTC Action Complete
Nov 03, 2015 11:27:21 UTC Task #2 (Multi_VM_Power_OFF (VM Power Action)) completed successfully in 34 seconds
Nov 03, 2015 11:27:21 UTC Input/Output values for Task #2 (Multi_VM_Power_OFF (VM Power Action)):
Nov 03, 2015 11:27:21 UTC [Mapped Input: Select VM = 1146]
Nov 03, 2015 11:27:21 UTC [Local Input: VM Action = powerOff]
Nov 03, 2015 11:27:21 UTC Completed workflow item number 3, with status Completed
Nov 03, 2015 11:27:23 UTC Executing workflow item number 4
Nov 03, 2015 11:27:23 UTC Trigger context executeWorkFlowStep called
Nov 03, 2015 11:27:23 UTC Executing custom action Multi_VM_Power_OFF (End Loop)
Nov 03, 2015 11:27:23 UTC Executing custom action Multi_VM_Power_OFF (End Loop)
Nov 03, 2015 11:27:27 UTC End While task execution iteration no - 2
Nov 03, 2015 11:27:27 UTC Task #3 (Multi_VM_Power_OFF (End Loop)) completed successfully in 3 seconds
Nov 03, 2015 11:27:27 UTC Input/Output values for Task #3 (Multi_VM_Power_OFF (End Loop)):
Nov 03, 2015 11:27:27 UTC Completed workflow item number 4, with status Completed
Nov 03, 2015 11:27:29 UTC Executing workflow item number 5
Nov 03, 2015 11:27:29 UTC Completed workflow item number 5, with status Completed
Schedule the workflow:
Right click:
And set the Schedule:
The schedule is in place:
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: