vCO data refresh from vCD weirdness

Question:

Just curious if you have ever experienced a lag in what VMware vCenter Orchestrator (vCO) sees in vCloud Director (vCD)? I discovered that the workflows are failing because it seems like the data gets stale. Sometimes the new vApp shows up to vCO and other times it takes time... sometimes it seems like things are completely stale. I waited about 30 minutes and it still wasn't showing up when I queried the vApps available. If I restart the vCO services things get refreshed. We are running the vCO appliance. Maybe it will function better if I run vCO on the vCenter server? Anyway if you have run into this I would appreciate some help.

Answer:

This is actually somewhat expected behavior due to the nature of the plugin. vCD provides a REST based API which is stateless, so you must force an update if you wish to retrieve updated values. So, for example, if you are working with a vCloud:VApp object named "vApp", you should always do a :

vApp.updateInternalState();

call against the object you are working with to be sure you have the most current details about that object. This method is available for most, if not all, vCD objects.