Using custom property in vRA/vCAC to deploy VM in specific datacenter using local templates -Post01
Yeah ! Post title is big. But let me explain the use case. Customer has geographically dispersed datacenter but part of single vCenter. Customer would like to provisioning resources across geographies but wish to reduce time while provisioning across geographies. To be honest I was not aware if we can dynamically provide options to user based on the field selection. These two posts (By Jad, By Eiad Al-Aqqad ) are amazing. They explain in detailed how to achieve it. All credits for them but credit also goes to Ajit as he directed me to these posts. Let’s deconstruct the requirement. Single vCenter, two physical datacenter and local templates. And Virtual Datacenter added into vCenter.
In above figure, i have tried to simulate customer setup. Customer will be requesting VM either in Mumbai or Pune. However when he is provisioning VM in mumbai, it should use Mumbai template as it will reduce provisioning time. So end user should be able to choose datacenter where he needs VM to deployed, which should automagically select local template in respective datacenter. Here is how the workflow below looks like
Let’s see how to achieve this. There is non-documented custom property Vrm.Datacenter.Location which will be used here. Below is the complete detailed procedure.
First make changes on vCAC-IaaS Server as explained here. Here is how my xml file looks like
Now associate the datacenter with compute resources as shown here.Mumbai represented by 192.168.1.18Pune represented by Cluster_PNQ
Now we need to create property definition. You can create either build profile or Property Dictionary . I preferred Property Dictionary. I have exactly followed steps mentioned by Jad. Here is how Vrm.Datacenter.Location looks like
Now datacenter part is done. We have to create value expression such that when datacenter is selected, template should be displayed.
We will be using customer property by name CloneFrom. Refer custom property link here. This property will over-ride the value defined in blueprint. So here is the CloneFrom and its value expression.
Actually it didn’t worked. I never got any template in the drop down. And it took quite while to understand. I have to set a Property Layouts. I have to first select datacenter based on which respective template will be displayed in drop down as designed below.
NOTE: If you login into to portal as Tenant Admin you will always see Location field displayed irrespective of if you select “Display location on request” or not. However if end user logs in “Display location on request” behavior is reflected based on if checkbox is selected or not.
If you look into screen capture, by default CloneFrom is empty, so unless user selects template to be used, CloneFrom becomes null, which over-rides the property in template and provisioning fails. This was expected behavior.
If you have use cases where user must select template to start provisioning in respective datacenter this will solve your problem.
In my case I don’t want user to select template, I want user to just select datacenter and automatically respective template is selected behind the scene and VM provisioning starts. AFAIK, this behavior cannot be achieved using value expression. In order to do it you must use vCenter Orchestrator Workflow. I must admit, I’m in love with this tool. It just keep extending the possibility of what you can do. So to conclude as long as you want user choice to select template this procedure works and is perfectly fine. let’s discuss vCO Option in next post.