Cloud89
Contributor
Contributor

Service blueprint form and Dynamic input displaying on VRA forms and validation

We are planning to create service blueprint for SCCM Agent installation  on Existing windows/Linux servers.    For ex: Install SCCM Agent

 

 

Service blueprint form will display following fields on VRA form

 

Field 1:   VM Name:   User will input existing server VM name.

Field 2:   Master_SCCM – Server Name ( Should be auto fill during run of workflow based on filed 1 input)

 

Requirement is  Master_SCCM filed should be auto fill once user select or passed VM Name based upon the   region /country vCenter cluster in which it is deployed.

So before click last button of SUBMIT user must aware that Righat master server is selected before installation workflow start

So it is possible to display that value in the same blue print form during the Run of workflow based on users input provided in VC_VM text box ? 

 

NOTE it should be display in VRA form itself not in logs

0 Kudos
1 Reply
Hejahida8
Contributor
Contributor

If I understand your request correctly you want to automatically assign a value to the Field 2:   Master_SCCM – Server Name based on the value the user enters or selects in Field 1:   VM Name:   User will input existing server VM name?

The tie between the VM Name and the Master_SCCM server name is the vCenter cluster the VM selected in Field 1 is running on?

This is possible, use a vRO action to perform a lookup from the VM value to find the vCenter cluster it is running on and then use logic like if statements or switch cases to assign the correct value for the SCCM server name. Then use an array to return the SCCM server names as a result of the action which will do the auto fill in the request form.

The action will look something like this, you may need to do more work to get the correct input for the cluster depending on what values you are using for the VM e.g. string representing the name, or the actual VM.

var targetCluster = System.getModule("com.vmware.library.vc.cluster").getComputeResourceOfVm(vm) ;

// this will take a VC:VirtualMachine as an input (vm) and return the vCenter cluster using an out of the box vRO action

var targetClusterName = targetCluster.name

//the name of the cluster as a string

//use if statements or switch statements to match the cluster name to an SCCM server name and push the value into an array

//which is then returned as an output from the action for example

if(targetClusterName == "Development"){

     var targetSCCMMasterServer = new Array("SCCM_Master_Server1");

     return targetSCCMMasterServer;

}

Then attach the action to the input field in the vRO presentation tab within your main vRO workflow, there is a step by step example on the VCO team website that will show you how to do this:

Dynamic Input Values Based on other Inputs

Once that is configured the SCCM Master server value will auto populate based on the value input into the VM field in both vRO and vRA.

0 Kudos