Hello,
I have workflow which creates a Provider vDC in vCloud Director. After that it creates an Organization and then an Organization vDC.
To create the Org vCD I need the provider vDC. I query the API for it, but it is not returned. However if I have the code loop it eventually shows up in about 20 minutes. Here is a sample of the code.
while (sleepCounter < maxSleep) {
//Update the vcdHost from vRO to vCD
vcdHost.updateInternalState();
// Find Provider vDC
var vdcs = vcdHost.toAdminObject().getProviderVdcs();
System.debug("Provider VDC count: "+vdcs.length);
for each (var vdc in vdcs) {
System.debug("Have a Provider vdc: "+vdc.name);
if (vdc.name.indexOf(providerVdcName) != -1) {
providerVDC = vdc;
System.log("Found Provider vDC: " + providerVDC.name);
break;
}
}
sleepCounter += 1;
if (providerVDC == null) {
System.log("Did not find the provider VDC, sleep 1 minute");
System.sleep(sleepTime);
} else {
//Found it, exit loop
sleepCounter += maxSleep;
}
}
I have had stale data issues in the past, but the updateInternalState() call on the vCD connection, seemed to resolve that.
I am running vRO 7.2 with vCD 8.0.2. Any ideas? Is there an API call I can use to force the data refresh to happen sooner?