With the release of vRealize Automation 7.4 came a feature called ‘Custom Forms’. With custom forms you can easily enhance the old and inflexible (.NET based) request forms in vRA. You can now do things like show elements based on conditional logic, put constraints on input values, custom help text and error messages, apply CSS formatting to your forms and much more cool stuff. And the beauty is that this can be applied to your existing blueprints without the hassle of using XaaS as front-end.
In the past some form of enhancement was available thought the use of XaaS blueprints, but this required more than standard knowledge of both vRA and vRO. With custom forms a lot of the complexity that was required has gone away.
How to get started
Lets have a look at what we have now and where we can start with the new custom forms.
As you can see I have a very simple Ubuntu deployment here but there are a lot of options to fill out and they are spread across different locations. Some of which I might not even want, like Reason for request. There is no way to get rid of that with the current request forms. Also notice that the choose host is an extra option I created through the use of custom properties and adding these in my blueprint. While this is not an option you might use a lot in regular environments it is pretty useful in my small home lab environment.
Now if we want to transform this into a much better looking request form we should enable the custom form for this blueprint. To do this go to the design tab and then blueprints. Here you will find some new elements.
When you click on the Custom Forms menu button you can choose Edit to begin. You will be presented with an empty custom forms editor.
I will start with the more basic elements such as a text box that gives the user some general info, number of CPU’s, Amount of memory and that host picker.
The General info text box shows some informative text to the end user.
For the Memory field I changed the increments in which you can increase the memory size. This way, if you want to increase your memory from 1 GB to 2 GB you just need to click the up-arrow once.
And for the host picker I created a value|label drop-down list. In the backend the custom properties defined in the blueprint will handle these host names for placement in my home lab (VirtualMachine.Admin.ForceHost and VirtualMachine.Admin.HostSelectionPolicy).
Once I’m done all I need to do to activate the custom forms is use the slider in the top right corner and save and finish this form.
Because this was an existing blueprint that was already published and entitled I just need to request this blueprint from the catalog to see the new custom forms in action.
Now this is of course still a pretty simple looking form but you can already tell that the custom forms editor can do a lot of cool stuff.
Building out the form
Lets say you have a production and test environment and you want to have different characteristics on your deployments, you could use multiple different ways to accomplish this and custom forms is now one of them. You could use it to make additional options available to the user deploying the blueprint when a certain environment is chosen. Or you can fill in different defaults based prod or test. Lets have a look at what I have done to the Ubuntu blueprint.
As you can see I have added some elements. The first one is where you can choose between production and test. This is just another drop down list with some key|value pairs. I will use these values later to influence the other elements.
With the environment values in place we can tie these to other elements. You can now for instance populate the network selection element to fill in the correct network. To achieve this I have used conditional values for the network selector.
So basically what this does is check the value of the environment element and based of what it is set to it changes the default value of the network selector.
The last part of the form is the exclude from monitoring check box. I wanted this check box to only be visible when the test environment is chosen. So in this case the appearance of the check box is related to what environment is chosen.
With everything setup the way I want lets see the deployment with custom forms in action.
What I have shown today is just the tip of the iceberg. There is so much more you can do with this powerful new feature. Think about styling your forms with CSS or tying it into vRO to use external values. And besides giving a more consistent experience to service architects in designing infra and application catalog items it looks very nice as well.
9 Replies to “vRealize Automation Custom Forms Introduction”
We are having following scenario for user request for on vRA
1st user will choose only one location of site as an example
Dropdown menu :
after that they should see following option on Environment tab i.e
if they choose “Site” as “London” and “Environment” as “Production” then from back end it should automatically choose 1 Production Clusters from multiple
just need a help to resolve this either from a workflow or from custom properties
This works a little bit differently then you would expect. There is a great resource already on how this works. You should check out this blog:
Also check out this blog:
Basically there is an XML file you need to edit and adapt your blueprints to it to get a location option available. Of course, your use case is a bit more complex but this should get you started at least.
How can I create a work flow to change computer OU in AD after deployment?
Any help or leads will be highly appreciated
You will need to use vRO actions to do the work. There is no default vRO action to move a computer object between OU’s but there are other workflows\actions that should get you started in \Library\Microsoft\Active Directory\Computer and com.vmware.vra.ad. And I wouldn’t be surprised if there are other resources out there that cover this already. I think something similar is being done in this post.
Thanks Wesley for the quick response.
I saw the link you mentioned earlier, but not very straight forward as I am still new and learning vRA/vRO, thought there was an easier for this.
In that case, I was thinking, you might be better off using the placement that comes with vRA out of the box depending on the use case.
Under Administration->vRO Configuration create the AD endpoint.
Then under Administration->Active Directory Policies create the policies that have different OU’s
Now when creating business groups you can choose the AD policy that handles the placement at deployment time per business group.
I also checked the vRO plugin for active directory, it looks like there is no moveAdComputer function. I did found some forum post that use the ActiveDirectory.rename function to change the OU. But this would be a bit harder to achieve and is also a different use case than described above. It is either choosing OU on deployment or change OU after deployment (day-2 action).
UPDATE: I can confirm that ActiveDirectory.rename can be used to move a computer object to a different OU.
On the exclude from monitoring check box, doe sit do anything in the backend? I am looking for a similar checkbox for backup. (Exclude form backup) but has to tie in to a No-Backup tag in vCenter. How do I do that?
In this example it doesn’t do anything (I just didn’t set it up) as I was just showing some use cases for custom forms.
If you want to make this work I think you should create a custom property ‘noBackup’ as a boolean. Add that to your blueprint and the custom form. If you then use event broker for extensibility you can pick up the property and the value in vRO and do your vCenter tagging with a workflow.
Hope this helps.
I have created the noBackup as boolean and added to the blueprint custom form. It’s the next stage of ‘use event broker for extensibility you can pick up the property and the value in vRO and do your vCenter tagging with a workflow, that I am having a challenge.
I already have the tags in vCenter,need your help to tie all together.