I am trying to use "Request a resource action" library workflow to change lease on a vRA resource. Having trouble with input (I believe) and getting "400 BAD_REQUEST (Dynamic Script Module name : requestResourceAction#14)".
Catalog resource and Resource operation are populated with proper selections but in input values array I have the following:
provider-ExpirationDate | 2017-05-04T16:44:13.846Z |
And it inevitably fails to generate the request. Are there any other additional properties that need to be provided to complete built-in change lease action on vRA resource? Perhaps format is incorrect?
Hi All,
You need to wrap the date object in a vCACCAFEDateTimeLiteral object like this below. Then use inputs for the "Request a resource" workflow.
var date = new Date(); // Set the date here
var inputs = new Array();
inputs[0] = {
name: "provider-ExpirationDate",
value: new vCACCAFEDateTimeLiteral(date)
}
I guess a bump, I am stuck... This doesn't seem to be the date/time formatting. provider-ExpirationDate is the only input expected according to the vCACCAFERequestsHelper.getFormKeys output.
Tried every which way it seems through vRA plugin with no success and same 400 message back.
From several threads, there are other ways of doing this (REST call, CloudClient) but I'd like to stick to vRA plugin for simplicity sake of course if possible.
Another bump... I was able to complete lease change via a cloudclient and in the process realized that:
1) lease change won't work if source blueprint already had lease set.
2) date/time format is very specific, e.g., "MM/dd/yy HH:mm:ss".
However, going back to vRO call through vRA plugin, this still does not work, even though I removed lease settings from blueprint and formatted date input according to what worked in cloudclient.
I guess I am at my wit's end here, looking for any input. Even if it is just any other benefits of using cloudclient beyond what I am struggling to accomplish in this thread. For some reason having an external component outside of Orchestrator does not seem appealing to me right now.
According to documentation, the date format, at least in REST API, should match the one you used in your first try - https://pubs.vmware.com/vra-70/index.jsp?topic=%2Fcom.vmware.vra.programming.doc%2FGUID-30A735EB-2CB...
I'll try to ask around what could be the problem with the workflow (don't have a suitable vRA environment to check it).
Ok maybe different methods require different formats. Cloudclient seems to be very explicit about it:
CloudClient>vra deployment action execute --id 89c12244-dc96-4ac0-8928-f1f91ffa3c9b --action "Change Lease" --properties "provider-ExpirationDate='2017-05-04T16:44:13.846Z'"
Error: Incorrect format for date. Accepted formats: [MM/dd/y HH:mm:ss, MM/dd/y].
CloudClient>
CloudClient>vra deployment action execute --id 89c12244-dc96-4ac0-8928-f1f91ffa3c9b --action "Change Lease" --properties "provider-ExpirationDate='05/04/17 21:19:03'"
33e10a36-abc0-4065-ac46-73b2e32f9974
CloudClient>
By all accounts of previous discussion threads this should work with out of the box Orchestrator action. I'd appreciate if you can shed some light on this.
Hello,
Did you manage to find a solution to this problem? I am facing the same issue, and I couldn't figure out what is the problem.
Thank you.
No, sorry. This is still outstanding on my list and unfortunately got re-prioritized. I'll ask around, we have a couple of experts working with us and they may have an idea as to what's going wrong here. It should work...
Also, it may worth cross-posting this thread to vRA forum, I think there may be folks that have a test environment handy to help out.
Which version of vRA do you refer to?
I remember similar issue in vRA 7.1 that got resolved in vRA 7.2.
I originally encountered it on 7.0.1. Definitely ran similar activity on 7.2.1.5097044 and still experienced the same behavior. Just tried on 7.3.0.5481809 and it still persists. The original workflow package is here actually https://communities.vmware.com/servlet/JiveServlet/download/2517583-137614/chgLeaseViaRequestResourc... from this thread using vCO to change the Lease time on a vRA VM .
Hi All,
You need to wrap the date object in a vCACCAFEDateTimeLiteral object like this below. Then use inputs for the "Request a resource" workflow.
var date = new Date(); // Set the date here
var inputs = new Array();
inputs[0] = {
name: "provider-ExpirationDate",
value: new vCACCAFEDateTimeLiteral(date)
}
Ah yes. Thanks dude!