Setting system properties that matter
System properties are switches that change how the Orchestrator server behaves. Most installations never touch them, but sooner or later a workflow needs to run a shell command, use a Java class that the scripting engine blocks, or wait longer for a slow vCenter. Recipe 1.8 showed the vracli vro properties commands. This recipe uses them on the properties you’re most likely to need, and tests each one with a small action.
Getting ready
- A standalone appliance and a root shell on it: SSH in as
vmware-system-user, thensudo su -(recipe 2.1). System properties can’t be changed on the Orchestrator embedded in VCF Automation. - An account in the Orchestrator Client that can create actions.
- An action module called
com.vcfguide.chapter2. Create it under Library > Actions if it doesn’t exist yet. - A maintenance window. Setting a property restarts the Orchestrator server, which interrupts running workflows.
How to do it
Look before you change anything
- List the properties already set on this server, then the commonly used ones with their descriptions:
vracli vro propertiesvracli vro properties advancedSSH session on vco01 showing part of the output of vracli vro properties advanced, with at least com.vmware.js.allow-local-process visible.
Allow workflows to run shell commands
- Set
com.vmware.js.allow-local-processtotrue. Use-nso the server doesn’t restart yet, because you’ll set two more properties first:
vracli vro properties set -k com.vmware.js.allow-local-process -v true -nLet scripts use more Java classes
- Create a file that lists the Java packages and classes scripts may use, one per line. It must be in a subfolder of
/data/vco/usr/lib/vcoon the appliance:
mkdir -p /data/vco/usr/lib/vco/vcfguidecat > /data/vco/usr/lib/vco/vcfguide/class-shutter.txt <<'EOF'java.net.InetAddressEOF- Point the property
com.vmware.scripting.rhino-class-shutter-fileat the file. Note the path: it starts at/usr/lib/vco, not/data/vco/usr/lib/vco, because that’s where the folder appears inside the Orchestrator server’s container:
vracli vro properties set -k com.vmware.scripting.rhino-class-shutter-file \ -v /usr/lib/vco/vcfguide/class-shutter.txt -nWait longer for a busy vCenter
- Raise the time Orchestrator waits for a vCenter response,
com.vmware.vmo.plugin.vi4.waitUpdatesTimeout, from its default of 20,000 milliseconds to 60,000. This time, leave out-n, so the server restarts and picks up all three changes:
vracli vro properties set -k com.vmware.vmo.plugin.vi4.waitUpdatesTimeout -v 60000- Wait for the server to come back.
vracli vro info -dreports it healthy again after a few minutes. Then check that all three properties are listed:
vracli vro propertiesProve it works
- In the Orchestrator Client, create an action
getDiskUsagein the modulecom.vcfguide.chapter2, with return typestringand this script:
// Needs com.vmware.js.allow-local-process = truevar cmd = new Command("df -h /var/run/vco");var exitCode = cmd.execute(true); // true: wait for the command to finishif (exitCode !== 0) { throw "df failed with exit code " + exitCode + ": " + cmd.output;}System.log(cmd.output);return cmd.output;-
Run the action. The log shows the disk usage of the folder, as seen from inside the server’s container.
-
Create a second action,
resolveHost, in the same module, with an inputhostNameof typestring, return typestring, and this script:
// Needs java.net.InetAddress in the class shutter filevar address = java.net.InetAddress.getByName(hostName);System.log(hostName + " resolves to " + address.getHostAddress());return address.getHostAddress();- Run it with
vc01.vmw.lab. The log shows vCenter’s IP address. Before step 4, the same script fails because the scripting engine can’t see the class.
Orchestrator Client, run of the action com.vcfguide.chapter2/resolveHost with hostName = vc01.vmw.lab, Logs tab showing the resolved IP address.
/data/vco/usr/lib/vco, that the value /usr/lib/vco/vcfguide/class-shutter.txt is the path the server sees, and whether the value should name the file or its folder (the 8.x wording is ambiguous).On the embedded 9.1.1 lab, without the property, new Command("df -h /var/run/vco") fails at execute with This method is disabled for security reasons. ‘Command’ is deprecated and will be removed in future release. Take the second half seriously: don’t build anything new on Command. For an operating system command, run it on another host over SSH (recipe 5.3), or in a polyglot action.
com.vmware.js.allow-local-process and check whether Command runs at all, or stays disabled.How it works
The Orchestrator server stores system properties in its own configuration, alongside settings such as the authentication provider. vracli vro properties set writes a key and value there, then restarts the Orchestrator server so that it reads them again at start-up. Most properties are only read once, when the server starts, which is why a change needs the restart and why -n is useful for batching several changes into one restart.
Each property in this recipe loosens a default that exists for a reason:
com.vmware.js.allow-local-processunlocks theCommandscripting class, which runs operating system commands as the server’s own user. Without the property,Commandrefuses to run. With it,Commandcan also write anywhere in the server’s file system, regardless of the rules injs-io-rights.conf, which still apply to every other scripting class.com.vmware.scripting.rhino-class-shutter-filewidens the list of Java classes that Orchestrator’s JavaScript engine lets scripts see. By default scripts can only use thejava.utilpackage. The file names extra packages (java.net.*) or single classes (java.net.InetAddress), one per line.com.vmware.vmo.plugin.vi4.waitUpdatesTimeoutis how long, in milliseconds, the vCenter plug-in waits for vCenter to answer before giving up. Raise it when an overloaded vCenter makes workflows fail with timeouts. It doesn’t make anything slower when vCenter is healthy.
The Command class and every Java class you allow run inside the Orchestrator server’s container, not on the appliance itself. The container sees its own file system, with a few folders from the appliance mapped into it: /data/vco/usr/lib/vco on the appliance appears as /usr/lib/vco inside, and /data/vco/var/run/vco appears as /var/run/vco. That mapping is why step 4’s path differs from step 3’s.
/data/vco/var/run/vco on the appliance and listing /var/run/vco from an action.vracli vro properties set -k … -v … in the appliance shell. Add -n to set several and restart once.There's more
Allow only what you need. A class shutter file with java.lang.* or java.io.* in it, or allow-local-process on a server that many people can write workflows on, gives every workflow author the server’s own operating system rights. Prefer a narrow list of single classes, and record why each one is there. If a REST call or a plug-in can do the job, use that instead.
Server file system access. Scripting classes that read and write files, such as File and FileWriter, are limited by /data/vco/usr/lib/vco/app-server/conf/js-io-rights.conf. Each line is + (allow) or - (deny), then any of r, w, x, then a path, and later lines override earlier ones. By default only /var/run/vco is fully writable, which is why the action in step 7 looks there. Never add +rwx /.
On the embedded 9.1.1 lab, a script can read the file as /usr/lib/vco/app-server/conf/js-io-rights.conf inside the server’s container (which also bears out the /usr/lib/vco mapping above). It holds these rules:
-rwx /+rwx /var/run/vco/-rwx /etc/vco/app-server/security/+rx /etc/vco/+rx /usr/lib/vco/+rx /var/log/vco/-rwx /usr/lib/vco/app-server/conf/security/So scripts can write only to /var/run/vco, and can read the configuration, the server’s own files and its logs, but not the security folders.
Basic authentication. Older guides tell you to set com.vmware.o11n.sso.basic-authentication.enabled to turn basic authentication on or off for the REST API. That property only applies when Orchestrator is authenticated with VCF Automation. On a standalone appliance authenticated with vSphere, it has no effect, and Broadcom says there’s currently no supported way to turn basic authentication off there.
Properties for the workflow engine. Some properties limit how many workflows run at once, how many wait in the queue, or how much run history is kept. They’re tempting when the server is busy, but they trade one problem for another. Change them only on Broadcom’s advice, and check vracli vro properties advanced for the ones your build supports.
Removing a property. Remove the key to go back to the default. This restarts the server too:
vracli vro properties remove -k com.vmware.vmo.plugin.vi4.waitUpdatesTimeoutClusters. Set properties once, on any node. They’re stored in the shared configuration, and every node restarts with them. The class shutter file, though, is an ordinary file on the appliance’s disk, so copy it to the same path on all three nodes.
See also
- 1.8 Configuring Orchestrator from the command line, for every
vracli vro propertiesoption. - 2.7 Scaling the Java heap, if a busy server runs out of memory rather than time.
- Broadcom TechDocs: Set JavaScript Access to Java Classes, Set Custom Timeout Property, and Configuring VCF Operations orchestrator with the command line interface.
- VMware Docs (Aria Automation Orchestrator 8.16): Allow the Command scripting class and Rules in the js-io-rights.conf file.
- Broadcom KB 440608: Aria Orchestrator Basic Authentication property does not apply to standalone instances.
- CloudBlogger, the author’s blog: Enabling Local Process Execution in Orchestrator via VRACLI, Enable access to Java Classes in JavaScript code, List of Aria Automation Orchestrator System Properties.
