Aria Orchestrator: Find the hostname of the Orchestrator server which is running a workflow, within its JavaScript scripting element.
search cancel

Aria Orchestrator: Find the hostname of the Orchestrator server which is running a workflow, within its JavaScript scripting element.

book

Article ID: 397540

calendar_today

Updated On:

Products

VCF Operations/Automation (formerly VMware Aria Suite)

Issue/Introduction

  • Get Orchestrator hostname in vRO workflow script
  • Guidance on how to use a workflow to get the hostname of the current Orchestrator.

Environment

  • VMware Aria Automation Orchestrator 8.x

Resolution

Here are some approaches which you can use to get the Orchestrator hostname:

  1. One approach uses the vRA plugin to get the hostname. Ensure that the Aria Automation plugin is installed and the host is set as Default:
    • hostname = VraHostManager.defaultHostData.vraHost;
      System.log("Hostname = '" + hostname + "'");

  2. The second approach requires you to first enable the com.vmware.js.allow-local-process property to allow Linux processes to be executed in the vco-app (Orchestrator) pod.
    1. CLI command:
      vracli vro properties set -k com.vmware.js.allow-local-process -v true


    2. Workflow JavaScript:
      var cmd = new Command('printenv');
      cmd.execute(true);
      var out = cmd.output;
      var prop = "-Dvco.app.hostname=";
      var posStart = out.indexOf(prop);
      var posSpace = out.indexOf(" ", posStart);
      var hostname = out.substring(posStart + prop.length, posSpace);
      System.log("Hostname = '" + hostname + "'");

  3. It is also possible to create a custom configuration element on each Orchestrator host which contains its hostname, and then query this in the workflow.