Search in sources :

Example 26 with VdsDynamic

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;
}
Also used : VDSStatus(org.ovirt.engine.core.common.businessentities.VDSStatus) RandomUtils(org.ovirt.engine.core.utils.RandomUtils) VdsDynamic(org.ovirt.engine.core.common.businessentities.VdsDynamic) VdsTransparentHugePagesState(org.ovirt.engine.core.common.businessentities.VdsTransparentHugePagesState)

Example 27 with 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();
        }
    }
}
Also used : VdsDynamic(org.ovirt.engine.core.common.businessentities.VdsDynamic)

Aggregations

VdsDynamic (org.ovirt.engine.core.common.businessentities.VdsDynamic)27 Test (org.junit.Test)6 ArrayList (java.util.ArrayList)4 VDS (org.ovirt.engine.core.common.businessentities.VDS)4 Before (org.junit.Before)3 Cluster (org.ovirt.engine.core.common.businessentities.Cluster)3 VdsStatic (org.ovirt.engine.core.common.businessentities.VdsStatic)3 VDSStatus (org.ovirt.engine.core.common.businessentities.VDSStatus)2 OS (org.ovirt.engine.core.utils.OS)2 HashMap (java.util.HashMap)1 PermissionSubject (org.ovirt.engine.core.bll.utils.PermissionSubject)1 StoragePoolValidator (org.ovirt.engine.core.bll.validator.storage.StoragePoolValidator)1 CreateOrUpdateBond (org.ovirt.engine.core.common.action.CreateOrUpdateBond)1 MaintenanceVdsParameters (org.ovirt.engine.core.common.action.MaintenanceVdsParameters)1 UpgradeHostParameters (org.ovirt.engine.core.common.action.hostdeploy.UpgradeHostParameters)1 NonOperationalReason (org.ovirt.engine.core.common.businessentities.NonOperationalReason)1 ServerCpu (org.ovirt.engine.core.common.businessentities.ServerCpu)1 VdsTransparentHugePagesState (org.ovirt.engine.core.common.businessentities.VdsTransparentHugePagesState)1 Bond (org.ovirt.engine.core.common.businessentities.network.Bond)1 DnsResolverConfiguration (org.ovirt.engine.core.common.businessentities.network.DnsResolverConfiguration)1