VMware Cloud Community
Paul_SI
Enthusiast
Enthusiast

getProvisioningRequestData

Hi All,

When I browse the API explorer then I find a lot of methods and objects. But how can I create a object that is a dependency for another??

Meaning, I'd like to change the VM configuration in the Requested Phase. I found the script below and I'd like to change the network adapter to VMXNet and the storage to paravirtual.

var requestId = executionContextProperties.get("__asd_catalogRequestId");

var jsonData = vCACCAFERequestsHelper.getProvisioningRequestData(requestId);

var json = JSON.parse(jsonData);

System.log(json);

// Change cpu example

json.ComponentName.data.cpu = 2;

When I lookup the method "getProvisioningRequestData()" then a "vCACCAFECatalogItemProvisioningRequest" is required as an input. How can I create this during the subscription run?

I'd tried to pass in the catalog request id, but this didn't work Smiley Sad

var requestId = executionContextProperties.get("__asd_catalogRequestId");

Thanks!

Reply
0 Kudos
1 Reply
eoinbyrne
Expert
Expert

I think you might be a little confused here as the RequestsHelper is intended for making new CatalogItem requests via the vRA Service Catalog whereas the EBS is intended for customizing requests which have already been submitted & which the system has started processing

The RequestsHelper permits vRO to do the following

- Retrieve the Request (form) content for an entitled CatalogItem

- Convert the retrieved content to JSON

At this point your workflow can customize the JSON by either

- Modifying member values in the JSON

- Adding vRA Custom properties if needed

Once that is done the RequestsHelper can be used to then

- Convert the JSON back to the request data for the CatalogItem

- Submit the modified CatalogItem request

Note that the above logical flow takes place in the Service Catalog context only and the output of the above is a NEW Service Request in vRA.

We tend to take this approach and use an XaaS form to gather user inputs and then when the XaaS is submitted we process that data to make a request for a CompositeBlueprint with the appropriate customizations applied (generate a unique hostname, set the VM size, Add new disks, set the primary NIC onto a specific network, add a new NIC on another network, etc) .

It is important to note that the new IaaS Custom Forms (introduced in 7.6) can do somewhat the same job but I've not used them much since our current approach serves our needs

After the XaaS has finished the newly submitted IaaS request can then be customized using the EBS (which we would use to do DNS registration, CMDB updates, etc)

It is important to note that you CAN achieve most of the same customizations using the EBS but you will be customizing the IaaS request using MachineLifecycle events

Reply
0 Kudos