private int calculateHostCpus() { return getModel().getSelectedCluster().getCountThreadsAsCores() ? runningOnHost.getCpuThreads() : runningOnHost.getCpuCores(); }
private void onSaveConfirmCpuThreads() { ClusterModel model = (ClusterModel) getWindow(); // cancel confirm window if there is one cancelConfirmation(); // CPU thread support is being turned off either explicitly or via version change if (!model.getVersionSupportsCpuThreads().getEntity() && model.getCountThreadsAsCores().getEntity() && getSelectedItem().getCountThreadsAsCores()) { ConfirmationModel confirmModel = new ConfirmationModel(); setConfirmWindow(confirmModel); confirmModel.setTitle(ConstantsManager.getInstance() .getConstants() .disableClusterCpuThreadSupportTitle()); confirmModel.setHelpTag(HelpTag.disable_cpu_thread_support); confirmModel.setHashName("disable_cpu_thread_support"); //$NON-NLS-1$ confirmModel.setMessage(ConstantsManager.getInstance() .getConstants() .youAreAboutChangeClusterCpuThreadSupportMsg()); UICommand tempVar = UICommand.createDefaultOkUiCommand("OnSaveConfirmGenericWarnings", this); //$NON-NLS-1$ getConfirmWindow().getCommands().add(tempVar); UICommand tempVar2 = UICommand.createCancelUiCommand("CancelConfirmation", this); //$NON-NLS-1$ getConfirmWindow().getCommands().add(tempVar2); } else { onSaveConfirmGenericWarnings(); } }
private void updateProperties() { Cluster cluster = getEntity(); setName(cluster.getName()); setDescription(cluster.getDescription()); setCpuType(cluster.getCpuName()); setDataCenterName(cluster.getStoragePoolName()); setMemoryOverCommit(cluster.getMaxVdsMemoryOverCommit()); setCpuThreads(cluster.getCountThreadsAsCores()); setResiliencePolicy(cluster.getMigrateOnError()); setEmulatedMachine(cluster.getEmulatedMachine()); setCompatibilityVersion(cluster.getCompatibilityVersion().getValue()); generateClusterType(cluster.supportsGlusterService(), cluster.supportsVirtService()); AsyncDataProvider.getInstance().getNumberOfVmsInCluster(new AsyncQuery<>( (QueryReturnValue returnValue) -> setNumberOfVms((Integer) returnValue.getReturnValue())), cluster.getId()); }
private static Cluster cloneCluster(Cluster instance) { Cluster obj = new Cluster(); obj.setId(instance.getId()); obj.setName(instance.getName()); obj.setDescription(instance.getDescription()); obj.setComment(instance.getComment()); obj.setCpuName(instance.getCpuName()); obj.setClusterCompatibilityLevelUpgradeNeeded(instance.isClusterCompatibilityLevelUpgradeNeeded()); obj.setCompatibilityVersion(instance.getCompatibilityVersion()); obj.setMigrateOnError(instance.getMigrateOnError()); obj.setTransparentHugepages(instance.getTransparentHugepages()); obj.setStoragePoolId(instance.getStoragePoolId()); obj.setMaxVdsMemoryOverCommit(instance.getMaxVdsMemoryOverCommit()); obj.setCountThreadsAsCores(instance.getCountThreadsAsCores()); obj.setEmulatedMachine(instance.getEmulatedMachine()); obj.setDetectEmulatedMachine(instance.isDetectEmulatedMachine()); obj.setArchitecture(instance.getArchitecture()); obj.setSerialNumberPolicy(instance.getSerialNumberPolicy()); obj.setCustomSerialNumber(instance.getCustomSerialNumber()); obj.setFencingPolicy(new FencingPolicy(instance.getFencingPolicy())); obj.setAutoConverge(instance.getAutoConverge()); obj.setMigrateCompressed(instance.getMigrateCompressed()); return obj; }
model.setVirtService(entity.supportsVirtService()); model.setGlusterService(entity.supportsGlusterService()); model.setThreadsAsCores(entity.getCountThreadsAsCores()); model.setTunnelMigration(entity.isTunnelMigration()); model.setTrustedService(entity.supportsTrustedService());
getCountThreadsAsCores().setEntity(getEntity().getCountThreadsAsCores()); getEnableBallooning().setEntity(getEntity().isEnableBallooning()); getEnableKsm().setEntity(getEntity().isEnableKsm());
cluster.getMaxVdsMemoryOverCommit()) .addValue("count_threads_as_cores", cluster.getCountThreadsAsCores()) .addValue("transparent_hugepages", cluster.getTransparentHugepages())