VMware Cloud Community
defmania
Enthusiast
Enthusiast
Jump to solution

vRA time to provision parameters

Hello,

Just wondering if anyone came across this. Is there a simple/easy way to export, as a starting point for building a report, the parameters containing the creation details for a blueprint request? I'm interested in grabbing the exact time difference between the time when a blueprint was requested and until it was provisioned successfully. There are some parameters in the postgres db like datecreated or lastupdated, but I'm not 100% sure those are totally accurate for what I need.

Thanks!

0 Kudos
1 Solution

Accepted Solutions
rstoker13
VMware Employee
VMware Employee
Jump to solution

Are you looking for a single report for each request or a periodically run report that gathers data for multiple requests? In either case, I believe vRO could be an option. Browsing the VCACCAFEHost from the administer tab in vRO, I selected a single request. The fields "dateCreated" and "dateCompleted" may be what you are looking for. See the image below.

requestDetails.PNG

If a report per request is your intention, you can utilize the event broker to call a vRO workflow that gathers the data. If a periodic report is required, you could schedule a vRO workflow to run at your desired frequency that gathers previous requests. In either case, you can send an email with formatted body or attached CSV.

View solution in original post

0 Kudos
4 Replies
rstoker13
VMware Employee
VMware Employee
Jump to solution

Are you looking for a single report for each request or a periodically run report that gathers data for multiple requests? In either case, I believe vRO could be an option. Browsing the VCACCAFEHost from the administer tab in vRO, I selected a single request. The fields "dateCreated" and "dateCompleted" may be what you are looking for. See the image below.

requestDetails.PNG

If a report per request is your intention, you can utilize the event broker to call a vRO workflow that gathers the data. If a periodic report is required, you could schedule a vRO workflow to run at your desired frequency that gathers previous requests. In either case, you can send an email with formatted body or attached CSV.

0 Kudos
defmania
Enthusiast
Enthusiast
Jump to solution

This is very helpful indeed!

A periodic report is what I'm interested in. Can you please provide some tips as to how can I get started with that workflow in vRO?

Thank you,

0 Kudos
rstoker13
VMware Employee
VMware Employee
Jump to solution

Your question inspired me to create an action as I'm sure my management will soon be asking for these very details. Please see the code below to create a CSV file located in the vRO Temp directory. You can then use a number of different methods to email the file on a scheduled basis. I have attached the action as well as included the code below. Please let me know if you have questions. Thank you.

//Instantiate variables

//Create csv for email. Don't hardCode the path - keep this workflow portable by using the temp folder

var csvFile = new FileWriter(System.getTempDirectory() + "/vRArequest_report.csv");

csvFile.open();

csvFile.clean();

  // Write CSV headers to file

  csvFile.write(

  "\"" + "requestedItemName" + "\""

  + "," + "\"" + "dateCreated" + "\""

  + "," + "\"" + "dateApproved" + "\""

  + "," + "\"" + "dateCompleted" + "\""

  + "," + "\"" + "lastUpdated" + "\""

  + "," + "\"" + "executionStatus" + "\""

  + "," + "\"" + "requestedBy" + "\""

  + "," + "\"" + "requestedFor" + "\""

  + "," + "\"" + "state" + "\""

  + "," + "\"" + "waitingStatus" + "\""

  + "\n");

//Get VCAC Cafe Host. If you have multiples, you may want to implement a for loop

var inVCACCafeHost = Server.findAllForType("vCACCAFE:VCACHost")[0];

//Get vRA Catalog Item Request

var requests = vCACCAFEEntitiesFinder.getCatalogItemRequests(inVCACCafeHost);

//Loop through requests to view attributes

for each(request in requests){

  //Instantiate array of request data

  var results = new Array();

  //get created time of request

  var timeCreated = request.dateCreated.getTime();

  //get current system date/time, convert to ms

  var curDate = new Date();

  var curTime = curDate.getTime();

  //subtract current system time from VM installed time

  diff = curTime-timeCreated;

  days = diff/86400000;

  //if request is 7 days or less

  if(days <= 7){

  results.push(request.requestedItemName);

  results.push(request.dateCreated);

  results.push(request.dateApproved);

  results.push(request.dateCompleted);

  results.push(request.lastUpdated);

  results.push(request.executionStatus.value());

  results.push(request.requestedBy);

  results.push(request.requestedFor);

  results.push(request.state.value());

  results.push(request.waitingStatus.value());

  }

  csvFile.write(results + "\n");

  }

csvFile.close();

0 Kudos
defmania
Enthusiast
Enthusiast
Jump to solution

Hey, thanks for the action. Where you able to succcessfully create that workflow to eventually send out the notification email? I'm still hitting a few bumps along to road to creating that.

Thank you!

0 Kudos