To get the vRealize Orchestrator (vRO) appliance’s hostname using JavaScript within a vRO workflow, there is no official API call for this purpose, but there are practical workarounds:
Method 1: Parse Environment Variables
In vRO 8.x (containerized), you might be able to extract the hostname from JVM arguments in the environment:
Prerequisite: Enable local process execution.
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]+)/)[1];
System.log('vRO Hostname: ' + nodeName); // vRO Hostname: vra_fqdn.domain.localMethod 2: Extract embedded vRO Hostname from vRA Plugin
If local command execution is not permitted, you can try to extract the hostname or IP from the vRA Plugin class :
System.log(VraHostManager.defaultHostData.vraHost); // https://vra_fqdn.domain.localGetting IP from FQDN
System.log(System.resolveHostName("vra_fqdn.domain.local")); // 10.242.1.8
System.log(System.resolveIpAddress("10.242.1.8")); //10-242-1-8.kubernetes.default.svc.cluster.localSummary Table
| Method | Reliability | Notes |
|---|---|---|
| Command | High | Needs local process enabled |
| vRA Plugin | Low | May return IP or hostname |
Choose the method that matches your vRO configuration and security policy.
If you cannot enable local process execution, the vRA host url extraction is the safest alternative.
Citations:
- https://community.broadcom.com/vmware-cloud-foundation/discussion/getting-hostnameip-of-current-node-in-vro-cluster-using-a-workflow
- https://richdowling.wordpress.com/2020/09/14/vrealize-orchestrator-name-ip-lookups/
Discover more from Cloud Blogger
Subscribe to get the latest posts sent to your email.









