This post will walk through adding a resource action for vRealize Automation 7.x, mapped to a custom vRO workflow. The steps below assume that the vRO instance has been integrated with vRA.
Log into the vRealize Automation portal as a user with service architect permissions. From the Design tab select XaaS and Resource Actions. Any existing resource actions are listed. Click New.
Map the resource action to the relevant vRO workflow. In this example I am using a workflow that adds a virtual machine to a backup job. You can use any workflow that has been configured to accept an input parameter from a vRA item. For this particular case we are using the VC:VirtualMachine parameter which passes the virtual machine provisioned by vRA.
If not already populated select the relevant input mappings. In this case the resource type is IaaS VC Virtual Machine, the input parameter matches up with the parameter configured in the vRO workflow (whatever you have named it, vmObj here), and this maps to the VC:VirtualMachine orchestrator type.
If your vRO parameter does not have a corresponding mapping already in vRA or ready to be imported into vRA then you can create a new / custom resource mapping in the Resource Mappings page.
Enter a name and description for the resource action. Configure the remaining settings as appropriate, you have the option to set a provisioning or disposal type (leave blank if neither) and have the action always available or only when a certain criteria is met.
If you un-select the hide catalog request information page the user is prompted for a description and reason for requesting the resource action.
Once you have completed the details page click Next.
Edit the form to represent how you want the action to be displayed to users. Most of this configuration should be obtained from the vRO workflow so you may not need to make changes here. Click Finish.
The new resource action is now listed as a draft. To start using the action select it and click Publish.
Now select the Administration tab and Catalog Management. Open the Actions page, the new resource action we created should now be displayed.
If you want to change the icon of the resource action you can do so by selection the action and clicking Configure. There are a number of useful vRA icons available here, including sample icons for day 2 actions. In my example I am unable to update the icon which seems to be an issue with custom actions created in vRA 7.2; resolved in 7.3 as per this KB article.
The next step is to assign our custom action to an entitlement. Open the Entitlements page and select the relevant entitlement. Click the Items & Approvals tab, under Entitled Actions click the green plus symbol. Locate the new resource action and select the check box to add it to the entitled actions. Click Ok and Finish.
To confirm the configuration has worked browse to the Items tab and select Machines. Any virtual machines that have the custom resource action added to the entitlement will show the new action in the drop-down Actions menu.
When I select the new action I am presented with the action form as per the design canvas we saw earlier. In this example I select the backup job from the drop-down list of jobs that my vRO workflow has pulled from the backup server, and click Submit. The VC:VirtualMachine parameter is then passed through to the next stage of the workflow, which adds machine to the selected backup job.