use of org.ovirt.engine.core.common.businessentities.VDS in project ovirt-engine by oVirt.
the class HostSetupNetworksModel method queryNetworkAttachments.
private void queryNetworkAttachments() {
VDS vds = getEntity();
IdQueryParameters params = new IdQueryParameters(vds.getId());
params.setRefresh(false);
// query for network attachments
Frontend.getInstance().runQuery(QueryType.GetNetworkAttachmentsByHostId, params, new AsyncQuery<>((QueryReturnValue returnValue) -> {
hostSetupNetworksParametersData.getNetworkAttachments().addAll((List<NetworkAttachment>) returnValue.getReturnValue());
initNetworkIdToExistingAttachmentMap();
// chain the vfsConfig query
queryVfsConfig();
}));
}
use of org.ovirt.engine.core.common.businessentities.VDS in project ovirt-engine by oVirt.
the class HostGeneralModel method upgrade.
private void upgrade() {
if (getWindow() != null) {
return;
}
final VDS host = getEntity();
Model model = createUpgradeModel(host);
model.initialize();
// $NON-NLS-1$
model.getCommands().add(UICommand.createCancelUiCommand("Cancel", this));
setWindow(model);
}
use of org.ovirt.engine.core.common.businessentities.VDS in project ovirt-engine by oVirt.
the class HostGeneralModel method updateProperties.
private void updateProperties() {
VDS vds = getEntity();
setOS(vds.getHostOs());
setOsPrettyName(vds.getPrettyName());
setKernelVersion(vds.getKernelVersion());
setKvmVersion(vds.getKvmVersion());
setLibvirtVersion(vds.getLibvirtVersion());
setVdsmVersion(vds.getVersion());
setSpiceVersion(vds.getSpiceVersion());
setGlusterVersion(vds.getGlusterVersion());
setLibrbdVersion(vds.getLibrbdVersion());
setIScsiInitiatorName(vds.getIScsiInitiatorName());
setSpmPriorityValue(vds.getVdsSpmPriority());
setActiveVms(vds.getVmActive());
setPhysicalMemory(vds.getPhysicalMemMb());
setSwapTotal(vds.getSwapTotal());
setSwapFree(vds.getSwapFree());
setSharedMemory(vds.getMemSharedPercent());
setMemoryPageSharing(vds.getKsmState());
setAutomaticLargePage(vds.getTransparentHugePagesState());
if (vds.getHugePages() != null) {
setHugePages(vds.getHugePages().stream().map(page -> messages.hugePages(String.valueOf(page.getSizeKB()), String.valueOf(page.getAmount() != null ? page.getAmount() : constants.notAvailableLabel()))).collect(// $NON-NLS-1$
Collectors.joining(", ")));
} else {
setHugePages(constants.notAvailableLabel());
}
setBootTime(vds.getBootTime());
setKdumpStatus(EnumTranslator.getInstance().translate(vds.getKdumpStatus()));
setSelinuxEnforceMode(EnumTranslator.getInstance().translate(vds.getSELinuxEnforceMode()));
setClusterCompatibilityVersion(vds.getSupportedClusterLevels());
setHostDevicePassthroughSupport(vds.isHostDevicePassthroughEnabled());
if (!vds.getHighlyAvailableIsConfigured()) {
setHostedEngineHaIsConfigured(false);
setHostedEngineHa(constants.bracketedNotAvailableLabel());
} else {
setHostedEngineHaIsConfigured(true);
if (!vds.getHighlyAvailableIsActive()) {
setHostedEngineHa(constants.haNotActive());
} else if (vds.getHighlyAvailableGlobalMaintenance()) {
setHostedEngineHa(constants.haGlobalMaintenance());
} else if (vds.getHighlyAvailableLocalMaintenance()) {
setHostedEngineHa(constants.haLocalMaintenance());
} else {
setHostedEngineHa(messages.haActive(vds.getHighlyAvailableScore()));
}
}
setLogicalCores(vds.getCpuThreads());
String onlineCores = vds.getOnlineCpus();
if (onlineCores != null) {
onlineCores = // $NON-NLS-1$
Arrays.stream(onlineCores.split(",")).sorted((s1, s2) -> {
Integer i1;
Integer i2;
try {
i1 = Integer.parseInt(s1);
i2 = Integer.parseInt(s2);
} catch (NumberFormatException ex) {
return s1.compareTo(s2);
}
return i1.compareTo(i2);
}).collect(// $NON-NLS-1$
Collectors.joining(", "));
}
setOnlineCores(onlineCores);
setKernelFeatures(formatKernelFeatures(vds.getKernelFeatures()));
}
use of org.ovirt.engine.core.common.businessentities.VDS in project ovirt-engine by oVirt.
the class HostInterfaceListModel method updateActionAvailability.
private void updateActionAvailability() {
VDS host = getEntity();
getSaveNetworkConfigCommand().setIsExecutionAllowed(host != null && (host.getNetConfigDirty() == null ? false : host.getNetConfigDirty()));
getSyncAllHostNetworksCommand().setIsExecutionAllowed(getOriginalItems() != null && getOriginalItems().stream().map(hostInterface -> hostInterface.getNetworkImplementationDetails()).filter(Objects::nonNull).anyMatch(implementationDetails -> implementationDetails.isManaged() && !implementationDetails.isInSync()));
}
use of org.ovirt.engine.core.common.businessentities.VDS in project ovirt-engine by oVirt.
the class HostInterfaceListModel method setEntity.
public void setEntity(VDS value) {
if (super.getEntity() != null && value != null) {
VDS currentItem = super.getEntity();
Guid currentItemId = currentItem.getId();
Guid newItemId = value.getId();
if (currentItemId.equals(newItemId)) {
setEntity(value, false);
updateActionAvailability();
return;
}
}
super.setEntity(value);
}
Aggregations