use of org.ovirt.engine.core.common.businessentities.VdsDynamic in project ovirt-engine by oVirt.
the class JsonObjectSerializationEntitiesTest method randomVdsDynamic.
private static VdsDynamic randomVdsDynamic() {
RandomUtils random = RandomUtils.instance();
VdsDynamic vdsDynamic = new VdsDynamic();
vdsDynamic.setCpuCores(random.nextInt());
vdsDynamic.setCpuThreads(random.nextInt());
vdsDynamic.setCpuModel(random.nextString(10));
vdsDynamic.setCpuSpeedMh(random.nextDouble());
vdsDynamic.setIfTotalSpeed(random.nextString(10));
vdsDynamic.setKvmEnabled(random.nextBoolean());
vdsDynamic.setMemCommited(random.nextInt());
vdsDynamic.setPhysicalMemMb(random.nextInt());
vdsDynamic.setStatus(random.nextEnum(VDSStatus.class));
vdsDynamic.setId(Guid.newGuid());
vdsDynamic.setVmActive(random.nextInt());
vdsDynamic.setVmCount(random.nextInt());
vdsDynamic.setVmMigrating(random.nextInt());
vdsDynamic.setReservedMem(random.nextInt());
vdsDynamic.setGuestOverhead(random.nextInt());
vdsDynamic.setPreviousStatus(random.nextEnum(VDSStatus.class));
vdsDynamic.setSoftwareVersion(random.nextNumericString(5) + '.' + random.nextNumericString(5));
vdsDynamic.setVersionName(random.nextString(10));
vdsDynamic.setPendingVcpusCount(random.nextInt());
vdsDynamic.setPendingVmemSize(random.nextInt());
vdsDynamic.setNetConfigDirty(random.nextBoolean());
vdsDynamic.setTransparentHugePagesState(random.nextEnum(VdsTransparentHugePagesState.class));
vdsDynamic.setHardwareUUID(Guid.newGuid().toString());
vdsDynamic.setHardwareFamily(random.nextString(10));
vdsDynamic.setHardwareSerialNumber(random.nextString(10));
vdsDynamic.setHardwareVersion(random.nextString(10));
vdsDynamic.setHardwareProductName(random.nextString(10));
vdsDynamic.setHardwareManufacturer(random.nextString(10));
return vdsDynamic;
}
use of org.ovirt.engine.core.common.businessentities.VdsDynamic in project ovirt-engine by oVirt.
the class HostMonitoring method moveVDSToMaintenanceIfNeeded.
private void moveVDSToMaintenanceIfNeeded() {
if (vds.getStatus() == VDSStatus.PreparingForMaintenance) {
if (monitoringStrategy.canMoveToMaintenance(vds)) {
VdsDynamic dbVds = getDbFacade().getVdsDynamicDao().get(vds.getId());
vds.setMaintenanceReason(dbVds.getMaintenanceReason());
vdsManager.setStatus(VDSStatus.Maintenance, vds);
saveVdsDynamic = true;
saveVdsStatistics = true;
log.info("Updated host status from 'Preparing for Maintenance' to 'Maintenance' in database, host '{}'({})", vds.getName(), vds.getId());
} else {
vdsMaintenanceTimeoutOccurred = vdsManager.isTimeToRetryMaintenance();
}
}
}
Aggregations