In this article
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.local
Method 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.local
Getting 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.local
Summary 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:
Discover more from Cloud Blogger
Subscribe to get the latest posts sent to your email.
Enjoyed this post?
Was this helpful?
One response to “Get Orchestrator Hostname and IP using JavaScript”
-
[…] T300 · Get Orchestrator Hostname and IP using JavaScript […]





























Leave a Reply