The customer has a vRO 7.6 workflow for CMDB registration. The workflow relies on the vRO node name. After migrating to the cloud proxy vRO appliance the workflow stopped working. The requirement was to update the hostname logic in a new container-based vRO.
The customer uses the below code to get the vRO node name. Based on the node name customer decided the vRO environment the workflow is executing in and pull environment-specific key-value pairs from a resource element.
var nodeName = System.resolveIpAddress("127.0.0.1");
The new cloud proxy vRO appliances are container-based, so running the above command will return localhost and doesn’t return the container (vco-app) hostname. The logic needs to be updated to get the container hostname instead of the appliance hostname.
vRO also enables you to run the commands on the appliance and fetch the output. For the new solution, you need to set access to operating system commands for workflows and actions. Please follow the instructions on Page#74
This will add a key-value pair “com.vmware.js.allow-local-process” : true in the vRO system properties.
The legacy code needs to be replaced with the below snippet
var com = new Command(["printenv", "|", "fgrep", "JVM_OPTS"]); var res = com.execute(true); // makes the call blocking var output = com.output; var nodeName = output.match(/-Dvco.app.hostname=([^\s]+)/); System.log('vRO Hostname: ' + nodeName);
I hope this article will help the readers save some time troubleshooting and researching the solution.