Input and Custom Properties During Provisioning in vRA 8.x

Mindwatering Incorporated

Author: Tripp W Black

Created: 09/27/2022 at 11:27 AM

 

Category:
VMWare
vRO - VCAC

Task1 :
Get parameters of the build being provisioned.
Allow custom properties to be exchanged to the next workflow in the pipe.


Task 2:
Get the provision's customProperties from the build, during/for Day 2 action's workflow.
The __asd_catalogRequestId cannot be used from vRO 7.6.x. However, the property, __metadata_resourceProperties, does exist if the workflow was run as part of a VM action.


Task 1 Solution:
vRO --> Workflow --> Inputs/Outputs tab
1. Click the New button

2. Add input, inputProperties:
Name: inputProperties
Type: Properties
Array: leave unchecked
Click Save.

2. Add output variable, customProperties
Name: customProperties
Type: Properties
Array: leave unchecked
Click Save.


inputProperties:
name type
- addresses Array[1]
- componentId vsphere_Machine[0]
- endpointId string
- externalIds Array[1]
- blueprintId string
- tags [Properties]
- resourceNames Array[1]
- customProperties [Properties]
- componentTypeId Cloud.vSphere.Machine string
- requestId string
- macAddresses Array[1]
- deploymentId string
- zoneId string
- projectId string
- subnetIds Array[1]
- resourceIds Array[1]
- __metadata_userName string
- __metadata_hdr_uberctx-org-id string
- __metadata_contextOrgId string
- __metadata_correlationType contextId string
- __metadata_orgId string
- __metadata_eventTopicId compute.provision.pre string
- __metadata_sourceIdentity string
- __metadata_targetId string
- __metadata_sourceType provisioning
- __metadata_hdr_uberctx-user-id string
- __metadata_hdr_uberctx-request-trace-id string
- __metadata_hdr_uber-trace-id string
- __metadata_hdr_runnableType extensibility.vro string
- __metadata_hdr_blocking true string
- __metadata_hdr_sample-decision false string
- __metadata_hdr_tokenId string
- __metadata_hdr_eventTraceEntryId string
- __metadata_hdr_uberctx-parent-id string
- __metadata_description string
- __metadata_targetType ComputeProvisionTaskState string
- __metadata_hdr_uberctx-serviceurl string (URL)
- __metadata_eventType EVENT string
- __metadata_hdr_provisioning-callback-uri string
- __metadata_id string
- __metadata_hdr_encryption-context string
- __metadata_hdr_runnableId string
- __metadata_correlationId string


Task 2 Solution:
vRO --> Workflow --> Schema tab
Create a new workflow item. This could also be done as an action.

Note:
The __metadata_resourceProperties property only exists when run from the vRA deployment's virtual machine actions. If the workflow is manually re-run, the property won't exist on the second run.

Add desired output variables:
Name: resourceProps
Type: Properties

Name: resourceId
Type: String

Name: vmNmShort
Type: String

Name: vmDeploymentID
Type: String

Add to the Scripting tab:
. . .
resourceId = '';
vmNmShort = '';
vmDeploymentID = '';
resourceProps = System.getContext().getParameter("__metadata_resourceProperties");
if (resourceProps) {
resourceId = resourceProps.get('resourceId');
vmNmShort = resourceProps.get('VirtualMachine');
vmDeploymentID = resourceProps.get('__vmw:provisioning:deployment');
} else {
System.warn("Resource properties were not available.");
}






previous page