Aria Automation Cloud Automation Cloud Management Platform vRealize vRealize Automation Ecosystem vRealize Suite

Custom Resources – ABX Backed – A Data Management Tanzu Use Case

Updated October 2021

As you probably know in vRealize Automation you can create your own Resources (Custom Resources) and Day-2 actions (Resource Actions) backed by vRealize Orchestrator  workflows in your Cloud Templates and deployments! 

You could learn the basics at this excellent blog Custom Resources and Resource Actions in vRealize Automation Cloud by Vincent Riccio and I would suggest also review this blog Integrating Tanzu Mission Control with vRealize Automation Custom Resources by Sam McGeown where these capabilities are put into action for a real use case.

However today, I will like to talk about the latest enhancement for the Custom Resources and the associated Additional Actions introduced at vRealize Automation Cloud in the September 2021 release.

This improvement I am referring to, it is new ability for the Custom Resources and the associated Additional Actions to support Action Base Extensibility (ABX).

This is a game changer for several reasons:

  • It will streamline, tremendously, the creation and maintenance of Custom Resources, think about anything you would like to have as a Cloud Template Construct, your own in-house or public cloud endpoints and / or other meaningful applications.
  • No need for vRealize Orchestrator‘s Data Types or Dynamic Types.
  • Resources backed by ABX can now be exposed and consumed easily via the Service Broker and to any other vRealize Automation Cloud feature, e.g., it is very simple to call a Cloud Template tasks from Code Stream.
  • Custom Resources state data is tracked by vRealize Automation Cloud.
  • Complements the Custom Resources backed by vRealize Orchestrator

Let’s learn more about this new Custom Resources type with a small use case, I needed a Custom Resource for leveraging Data Management for VMware Tanzu, so I could create a MySQL database “as a service for my Front-End App.

If you are not familiar with Data Management for VMware Tanzu , it allows you to run your own database “as a service” on vSphere for your whole organization to simplify, automate, and easily scale database provisioning and management.

Ok, in order to create a Custom Resource, you can do it easily at the Cloud Assembly, go under the Design menu, then you will find the “Custom Resources” link that gives you access to the option “+ New Custom Resource“.

I will not go in details for the whole Custom Resource creation, as the whole procedure is not that much different than what Vincent Riccio‘s Blog Custom Resources and Resource Actions in vRealize Automation Cloud describes but I will point out the main exceptions when using Action Base Extensibility (ABX).

For starters, you may notice that there’s a new input, “Based on“, that allows you to select the extensibility engine

Whenever you select “ABX user-defined schema“, you may notice that a “Generate Actions” option becomes available, this option will create 4 x ABX‘s Action Templates, one for each operation (it uses the name of the resource as a prefix for naming each ABX‘s Action Template), however you could pre-stage your own ABX‘s Actions then simply assign them to their corresponding operation.

If you look closely, you will see the operations, “Create“, “Destroy” (both mandatory operations) , “Update“, and a new operation, “Read” (which it is also mandatory), this last operation is needed as it will be used used for tracking the health of your Custom Resource (you will notice vRealize Automation Cloud running this operation periodically to detect any changes associated to your instanced Custom Resources, but also for other operations, e.g., whenever you want to update the Custom Resource.

Then, you have the option to define “Additional Actions” (Optional, day-2 operations available for resource after provisioning), they are also backed by Action Base Extensibility (ABX) and the request parameters can be edited, in the same you would do for a custom forms.

For my Data Management for VMware Tanzu Custom Resource, I created the following Python-Based ABX‘s Actions (all ABX Scripting Engines are supported), they are the ones that actually perform the heavy lifting for the “Create“, “Destroy“, “Update” & Read” operations, the back end if you will from my Custom Resource

Then I simply match them to the Lifecycle Actions

Plus, I added an extra one to perform a Database backup; you can download all the ABX‘s Actions from this GitLab repository moffzilla/cr-abx .

Moving on, there is one more important aspect, we need to define the properties of the Custom Resource, the properties that will be ultimately exposed in the Cloud Templates when the resource construct is selected

You will notice the “Properties” tab that enable us for defining the schema, in my example, it goes something like this:

Please note the option “recreateOnUpdate” this will indicate to vRealize Automation Cloud that when updating the resource needs to be re-created. You can find all of the parameters in the form view, next to the code view.

it is very important to mention that once the Custom Resource is created, the Schema cannot be changed, in order to prevent changes that could affect existing Custom Resources already declared in Cloud Templates.

And when all this is done, all you need to do is to access the Cloud Template Design Canvas, create or re-use an existing Cloud Template then simply drag and drop this newly created Custom Resource, like any other resource and populate its properties with values, please note that all the available properties options are hinted in the Cloud Templates

Then you can add and mix more resources

And if we deployed this Cloud Template, you would be able to track the execution as any other standard Cloud Template Deployment

Under the hood and as Administrator, you could track the ABX‘s Actions executions

and even inspect the details further (the execution of my Python Script)

When the deployment is complete, you can access it like any other standard deployment

which gives access to detailed information about the resources, including our very own Custom Resource data and more importantly, day 2 operations, remember we also assigned a back up option?

If we execute that back up option, you could observe how the ABX‘s Actions execution for back up is called

And we could track it, once again from our deployment

And well, if you were the Data Management for VMware Tanzu‘s Organization Administrator, at the Dashboard you could find the actual Database our Custom Resource created

together with the corresponding back up operation we just triggered, all the way from vRealize Automation Cloud

and yes, we could update or delete our deployment which will call the corresponding ABX‘s Actions in the Custom Resource.

You can see more details for this implementation in this recording

And of course, the obvious question would be, when should I create Custom Resources based on Action Base Extensibility (ABX) or vRealize Orchestrator? There is however not a direct answer, but general recommendations based on your use cases and environments,  as an example,

  • if I were having a private cloud, and my custom resources were around existing vRealize Orchestrator‘s Plug-ins (meaning I will have access to Specific Data Types and Workflows) then it makes sense to use Custom Resources backed by vRealize Orchestrator.
  • In the other hand, if I am working with Hybrid Cloud, my Custom Resource is not complex or I don’t have a vRealize Orchestrator‘s Plug-In, I will opt for a Custom Resources backed by Action Base Extensibility (ABX).

Conclusion

As a vRealize Automation Administrator having the flexibility to use Custom Resources supported by Action Base Extensibility (ABX) or vRealize Orchestrator will streamline, tremendously, the creation and maintenance of Custom Resources, simplifying your end to end use cases.

Try vRealize Automation

For more information feel free to check these blogs out:

Custom Resources and Resource Actions in vRealize Automation Cloud

Integrating Tanzu Mission Control with vRealize Automation Custom Resources

Custom Resources – Resource Actions Troubleshooting and Event Topics

Native AWS services in VMware Cloud Templates (an AWS RDS use case).

Data Management for VMware Tanzu