Hi guys,
I have a catalog item for extending a disk, which is presented from vRA advanced services and picks up the vRO workflow. Due to this, the default IaaS resource management in vRA does not come into affect. Therefore, I would like to limit the end users to a maximum size of the virtual machine - ie, if total size + the size they intent to extend by is > than a specific size, then the workflow will flag this.
I have wrote the following code to return the total of all disks attached to a machine. This is then called from vRO presentation tab to fill in the max value of disks. This works fine when i use the code as a workflow and log the output. However, vRO presentation does not return any value. Has anyone had similar issues or have i done a silly mistake and missing something ?
var total = 0;
var size = new Array();
var devices = vm.config.hardware.device;
var h = 0;
for (var i in devices) {
if (devices[i] instanceof VcVirtualDisk) {
size[h++] = devices[i].capacityInKB / 1024 / 1024;
total += devices[i].capacityInKB / 1024 / 1024;
}
}
return total;
Thanks,
bradger33