var cafeHosts = Server.findAllForType("vCACCAFE:VCACHost", null);
var vms; var cafeHost;
for(var i = 0; i < cafeHosts.length; i++) {
vms = null;
if(cafeHosts[i].sessionMode != "Per User Session") {
vms = vCACCAFEEntitiesFinder.findCatalogResources(cafeHosts[i],vmName);
if(vms.length > 0) {
for each (var v in vms) {
if (v.parentResourceRef != null && v.name.toLowerCase() == vmName.toLowerCase()) {
targetVmID = v.getProviderBinding().getBindingId(); targetVmName = v.name;
break;
}
}
}
}
}
if (targetVmID == null) { throw("VM " + vmName + " NOT FOUND!!"); }
Post Views:
293
Related