In this article we will try to describes the steps to define a custom workflow in vRealize Orchestrator and configure auto-remediation of an alert using the custom workflow.
Automated workflow execution is possible on workflows which have only one input parameter. The input parameter should be of type VC:<VC datatype> in the vRealize Orchestrator workflows.
you will need to have VROPS 7.5 with VRO Management pack install and configured.
for more details on the management pack : https://marketplace.vmware.com/vsx/solutions/management-pack-for-vrealize-orchestrator
Create a custom workflow in vRealize Orchestrator
The custom workflow should have one input parameter of type VC: <VC Datatype>.
In our example, the workflow VMAOR Remove all snapshot, has one input parameter of type VC:VirtualMachine, and the name of the input parameter is vm.
Import the custom workflow into VROPS
On the menu, click Environment and under Management Pack for vRealize Orchestrator, select vRO Packages and Workflows.
vRealize Orchestrator displays a list of the configured vRealize Orchestrator adapter instances. Select VRO adapter instance.
Next to the name of the VRO adapter instance in the right pane, click Configure Package Discovery under Actions.
The Configure Package Discovery dialog box opens. Add a list of packages to be discovered in the following format: <packageName>
i have use my own package that i have created name VMAOR.
Map the custom workflow to a vCenter resource.
Here the vCenter resource is of type VC:VirtualMachine which should match the VRO workflow.
- In the menu, select Administration, then click Configuration > Inventory Explorer in the left pane.
- Select Adapter Instances and then vRealize Orchestrator Adapter Instance from the list of adapter instances.
- Select the vRealize Orchestrator adapter instance that contains the workflow that you want to run.
- From the right pane, select the workflow that you want to add to a resource.
- Click the Action icon and then Create/Modify Workflow Action on vCenter Resources.
Create a custom recommendation.
To define recommendations, in the menu, click Alerts and then in the left pane.
click Alert Settings -> recommendations.
Create a custom Symptom.
Create a symptom which looks for VMs that have vm older then configured. In the menu, click Alerts and then in the left pane.
click Alert Settings -> Symptom Definitions.
Create a custom alert which will invoke the VRO workflow/action automatically.
Map the symptom and recommendation to the alert.
To create or edit your alert definitions, in the menu, click Alerts and then in the left pane, click Alert Settings -> alert definitions.
Create/Modify the policy and apply the vRealize Orchestrator Adapter group.
In the menu, click Administration, and then in the left pane click Policies.
click the Edit Selected Policy icon to edit a policy.
In the Automate and State columns, change the setting to Local.
After configuring the custom workflow, vRealize Operations Manager will look for VMs that have snapshot older then configure.
Based on the alert, Management Pack for vRealize Orchestrator invokes the custom workflow automatically.
The alert remediated in next collection by executing the mapped recommendation. You can verify this in the Recent Tasks.