Scheduling vCO workflows with curl and the REST API

Posted by

There is an issue with vCenter Orchestrator 5.1.0 not running scheduled workflows ( The KB says it’s resolved n 5.1.0 but it appears that it’s not. Until the issue is resolved, this post will show you how to schedule vCO workflow runs.

Say you have a workflow named BackupProviderVMs that you want to run every Sunday. First you need to find the workflow’s itemHref value. You can get this by running the following and replacing the vCO URL, credentials and your workflow name:

curl -i -k -H “accept:application/xml” -H “content-type:application/xml;charset=UTF-8” -u vcoadmin:password -X GET

In my example the value of itemHref was

itemHref will be used in the remaining command as such:

curl -i -k -H “accept:application/xml” -H “content-type:application/xml;charset=UTF-8” -u vcoadmin:password -X GET itemHref/…

You can view existing runs for the workflow by running:

curl -i -k -H “accept:application/xml” -H “content-type:application/xml;charset=UTF-8” -u vcoadmin:password -X GET

The workflow can be ran with:

curl -i -k -H “accept:application/xml” -H “content-type:application/xml;charset=UTF-8” -u vcoadmin:password -X POST -d @relocate-response

Where relocate-response is a file with the contents of:

<execution-context xmlns=””&gt;

The workflow can be scheduled to run by creating a crontab entry on the vCO server as such:

05 02 * * 0 /usr/bin/curl -i -k -H “accept:application/xml” -H “content-type:application/xml;charset=UTF-8” -u vcoadmin:password -X POST -d @/usr/local/src/relocate-response


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 )

Connecting to %s