@Override
public String getPath() { return path; }
@Override
protected void update(ManagedObject mo) throws Exception {
ResourcePool rp = (ResourcePool)mo;
childVMs = Arrays.asList(rp.getVm());
owner = rp.getOwner();
parent = rp.getParent();
name = rp.getName();
isVApp = (rp instanceof VirtualApp);
if (isVApp) {
VirtualApp vapp = (VirtualApp)mo;
ProductInfo[] pInfo = vapp.getVAppConfig().getProduct();
version = pInfo[0].getVersion();
fullVersion = pInfo[0].getFullVersion();
}
ResourceConfigSpec config = rp.getConfig();
cpuAlloc = config.getCpuAllocation();
memAlloc = config.getMemoryAllocation();
// XXX: The cpuUsgae and memUsgae should really belong
// to the runtime info. We putting them into configuration category is
// to temporarily fix bug 865341 in Borealis. Should be refactorred later.
ResourcePool.RuntimeInfo runtime = rp.getRuntime();
cpuUsage = runtime.getCpu();
memUsage = runtime.getMemory();
for (ManagedObjectReference vmRef : childVMs) {
VcCache.putVmRpPair(vmRef, getMoRef());