Retrieve the external IP of a vCenter Orchestrator server

Recently I had to understand what’s the external IP of the server that my vCO was deployed on. Since I did not had SSH access to the machine I wondered how I could do this. It turned out to be as simple as few lines of JavaScript in a vCO action. I used the HTTP REST plugin to make a get request to and extract the response.

The code (with dynamically adding and removing REST hosts) :

var host = new RESTHost("IP echo");
host.url = "";

host = RESTHostManager.addHost(host);

try {
var response = host.createRequest("GET", "plain").execute();


return response.contentAsString;
} catch (e) {

throw e;


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s