Hi,
I want to work with VMUtilities in Workflows.
Therefore, I created a simple workflow to extract the vmGUID using RestAPI.
The the first step created 2 Variables, on with the name of the VM and the other for my vShpere-Client:
As the first activity I use HttpClient to get the client details including the vmGUID
1. Solution:
In the next step I’m using the activity «PowerOn», insert the two variable and try to extract the vmGUID from previous output:
To extract the vmGUID, I used the example I found in documentation and changed it to suite my needs.
I get the following errors:
org.jdom2.input.JDOMParseException: Error on line 2: Element type "vm" must be followed by either attribute specifications, ">" or "/>".
VMOperationsHandler : oPowerOn (PowerOn_1)] ERROR: failed to encode xml
2. Solution:
Then I thought I could put these lines into the “OnStart Script” of “PowerOn” and just put the resulting variable vmGUID as input:
This time I get these errors:
groovy.lang.MissingPropertyException: No such property: JSON for class: Script1
ProcessOnEnter :
I have attached the exported workflow, just in case someone wants to have a look at it.