How to limit number of workflow tokens

Each time vRealize Orchestrator (vRO) runs a workflow, a token (workflow execution) is added beneath the workflow in the vRO client. By default vRO will keep up to 100 of these tokens! This may be a slight annoyance to people who are only interested in the last 5-20 runs. This article will shed some light on the configuration options you have available to you.

 

Tired of seeing too many workflow tokens?

tired_of_seeing_too_many_workflow_tokens.png

Many developers prefer to have far fewer workflow tokens showing when they are working in the vRO client. Sure, you can right-click on the parent workflow and select Delete all finished workflow runs, but when you have scheduled tasks, policies, and users generating many tokens across many different workflows doing this manually can be tedious.

Maximum number of preserved runs per workflow

maximum_number_of_preserved_runs_per_workflow.png

As per the vRO 7.1 Documentation (click link for exact page), you can change the number of workflow tokens that are kept in the vRO client.

  • Let's do that now! Return to your browser tab with your vRO Control Center page loaded and click on Advanced Options

vRO 7+ Configuration Settings

vro_7__configuration_settings.png

Configuration settings for vRO 7 and above are now managed using the vRO Control Center. This is a new interface that become available in a beta form with vRO 6 and fully replaced the old web configurator since vRO version 7.1. Version 7.0.1 still had a link back to the Legacy UI but that is now gone as well since all configurations are now done through the Control Center and/or vRO Workflows.

In order to access the Control Center, you must have the vco-configurator service running. It is not running by default when vRO is embedded in vRealize Automation (vRA.)

How to access Control Center:

  1. https://your-vro-server:8283/vco-controlcenter
  2. https://your-vro-server:8281/vco - then click vRealize Orchestrator Control Center (login as root with your root pw for the appliance)
  3. https://your-vra-server/vco - (Note: port 443 when vRO embedded in vRA) then click vRealize Orchestrator Control Center (login as root with your root pw for the appliance)

Change to 10

change_to_10.png

  1. Set the value of Maximum number of preserved runs per workflow to the maximum number of workflow tokens you want shown under your workflows. For this article, we'll set this to 10.
  2. Click Save
  3. Note the message that appears under the Saved successfully note - you need to restart the Orchestrator service in order to apply the changes. Click Startup Options to be taken to the page that allows you to restart the server service.

Restart the server service

restart_the_server_service_1.png

You may restart the Server service using Control Center by clicking Restart on this page.

NOTE: the console/ssh equivalent of pushing this button is:

service vco-server restart

Workflow token purge

workflow_token_purge.png

After making the change above and restarting the vco-server service, you may notice that the changes may not appear to have taken effect right away. This may have to do with timing. A missing piece of documentation on that page linked above is the fact that the workflow tokens are purged once per hour by default. You can verify this by issuing the following command from an SSH session to your vRO server:

cat /var/log/vco/app-server/server.log | grep "Purging workflow tokens"


Note the timestamp at the beginning of the line - you'll see the results indicate an hourly execution of the purge process!

But wait! I don't want to wait an HOUR for the purge ! !
Okay, fine, let's change that then!

System Properties

system_properties.png

Control Center provides an interface to add custom system properties to the vRO Server.

  • Click on System Properties

Add New Property

add_new_property.png

  1. Add this text as the Key: com.vmware.o11n.purge.execution.cron
  2. Specify this cron info for the Value: 0 0/5 * * * ?
  3. Add the following as your Description: Purge workflow tokens every 5 minutes
  4. Click Add

Wait a second... you're probably wondering where I got that Key value from since it doesn't appear to be in the documentation.
I actually found it in an older VMware Communities post after a colleague mentioned the key name in a Socialcast discsussion.

media_1475683744460.png

  1. Note that your new property is now added (but not yet saved) to the server
  2. Click Save changes to save these changes to a config file on the server (/var/lib/vco/app-server/conf/vmo-managed.properties)
  3. As noted, you must now restart the server service in order to apply the new schedule
  4. Click Home then click Startup Options (not shown)

Restart the Server service

restart_the_server_service.png

Click Restart

NOTE: Even though Current Status may indicate Running right away, the vco-server service actually takes a few minutes to really reach the Running state.

End result: 5 minute token purge

end_result_5_minute_token_purge.png

SSH to your vRO server and run the following command to verify the purge is now taking place every 5 minutes:

<
tail -f /var/log/vco/app-server/server.log | grep "Purging workflow tokens"

End Result

end_result.png

Once the configuration changes have been made and the purge cron job executes, no more than the specified number of workflow tokens will be present for all workflows. In this case, you can see that there are now only 10 workflow tokens for each of the test workflows shown in the screenshot!

Conclusion

As you can see in this short article, you do have the ability to control the number of workflow tokens per workflow. All it took was a couple configuration changes and a server restart to apply those changes.

I hope you found this article helpful!

If you have questions about vRO, please take advantage of the VMware Orchestrator Communities! This article even referenced an old thread there in order to get the Key value for a configuration setting.

Comments  

0 #5 burke 2016-11-03 15:17
Quoting minitron:
Is there any way to control the number of retained tokens per workflow or even per workflow category?

No, there's not. This is a global setting only.
0 #4 minitron 2016-11-03 13:26
Is there any way to control the number of retained tokens per workflow or even per workflow category?
0 #3 Bhaskar Desharaju 2016-10-17 06:42
Hi Burke,

Nice article and very intuitive.
0 #2 burke 2016-10-12 15:06
Quoting vikrant:
Great article. Thank you so much for this interesting and well-written article. You show How to limit number of workflow tokens. It is really helpful but it takes a server restart can we do without restart ? '
Thanks for sharing.

Unfortunately no, this change cannot be completed without restarting the vco-server service. At least a full machine reboot is not required ;)
0 #1 vikrant 2016-10-12 14:59
Great article. Thank you so much for this interesting and well-written article. You show How to limit number of workflow tokens. It is really helpful but it takes a server restart can we do without restart ? '
Thanks for sharing.

Search

Book Shelf

 
Experts Exchange

NUC Lab Kit

Below are my thoughts for a vSAN nuc lab. Since I already have cables, not including them here. I ordered (and received by Nov 30, 2016)
3 x nuc, 3 x 32GB Crucial mem, 3 x Toshiba NVMe drive, 3 x Startech USB to GB NIC, and 3 x Crucial 1TB SSD. I've also been very happy with my Cisco SG300-10 so I bought one more since my existing one only has one port available. Each of the items listed here are linked below - all were purchased using the provided links below.
single NIC (See this post for details on using the USB -> GB NIC item listed below

I stayed with the i5 for the power consumption and form factor vs. the i7 Skull Canyon ;)