I have a page (see attached image) that I have that displays VMs.
I do a loop through the list and simutaneously request VM data for all the VMs in the list but vCD appears to process them sequentially which makes a screen update take 25 seconds for 9 VMs.
Here is my ajax routine:
$( "#loop_btn" ).click( function () {
$('.itemrow').each(function(index, itemrow) {
$.get("/ajax/vm_get.php", { vmhref: itemrow.id }, function(vmdata) {
$(itemrow).data('vmdata', vmdata);
console.log(vmdata);
}, "json");
console.log("OK");
});
});
and it calls a php script that gets the data and converts it to json:
...
// Login
$auth = array('username'=>$_SESSION['cloud']['username'], 'password'=>$_SESSION['cloud']['password']);
$service = VMware_VCloud_SDK_Service::getService();
$service->login($server, $auth, $httpConfig);
$sdkVm = $service->createSDKObj($href);
$vm = $sdkVm->getVm();
echo json_encode(simplexml_load_string($vm->export()));
exit;
Dion