Search in sources :

Example 11 with VdsDynamic

use of org.ovirt.engine.core.common.businessentities.VdsDynamic in project ovirt-engine by oVirt.

the class UpdateVdsCommand method checkKdumpIntegrationStatus.

private void checkKdumpIntegrationStatus() {
    VdsStatic vdsSt = getParameters().getVdsStaticData();
    if (vdsSt.isPmEnabled() && vdsSt.isPmKdumpDetection()) {
        VdsDynamic vdsDyn = vdsDynamicDao.get(vdsSt.getId());
        if (vdsDyn != null && vdsDyn.getKdumpStatus() != KdumpStatus.ENABLED) {
            AuditLogable logable = new AuditLogableImpl();
            logable.setVdsId(vdsSt.getId());
            logable.setVdsName(vdsSt.getName());
            auditLogDirector.log(logable, AuditLogType.KDUMP_DETECTION_NOT_CONFIGURED_ON_VDS);
        }
    }
}
Also used : VdsStatic(org.ovirt.engine.core.common.businessentities.VdsStatic) AuditLogable(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable) VdsDynamic(org.ovirt.engine.core.common.businessentities.VdsDynamic) AuditLogableImpl(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl)

Example 12 with VdsDynamic

use of org.ovirt.engine.core.common.businessentities.VdsDynamic in project ovirt-engine by oVirt.

the class UpgradeHostInternalCommand method updateHostStatusAfterSuccessfulUpgrade.

public void updateHostStatusAfterSuccessfulUpgrade() {
    VdsDynamic dynamicHostData = vdsDynamicDao.get(getVdsId());
    dynamicHostData.setUpdateAvailable(false);
    vdsDynamicDao.update(dynamicHostData);
    if (getVds().getVdsType() == VDSType.VDS && !getParameters().isReboot()) {
        if (getParameters().getInitialStatus() == VDSStatus.Maintenance) {
            setVdsStatus(VDSStatus.Maintenance);
        } else {
            setVdsStatus(VDSStatus.Initializing);
        }
    }
}
Also used : VdsDynamic(org.ovirt.engine.core.common.businessentities.VdsDynamic)

Example 13 with VdsDynamic

use of org.ovirt.engine.core.common.businessentities.VdsDynamic in project ovirt-engine by oVirt.

the class VdsDynamicDaoTest method testUpdateDnsResolverConfiguration.

@Test
public void testUpdateDnsResolverConfiguration() {
    VdsDynamic before = dao.get(getExistingEntityId());
    before.getReportedDnsResolverConfiguration().setNameServers(Collections.singletonList(new NameServer("1.1.1.1")));
    dao.updateDnsResolverConfiguration(before.getId(), before.getReportedDnsResolverConfiguration());
    VdsDynamic after = dao.get(getExistingEntityId());
    assertEquals(before.getReportedDnsResolverConfiguration(), after.getReportedDnsResolverConfiguration());
}
Also used : NameServer(org.ovirt.engine.core.common.businessentities.network.NameServer) VdsDynamic(org.ovirt.engine.core.common.businessentities.VdsDynamic) Test(org.junit.Test)

Example 14 with VdsDynamic

use of org.ovirt.engine.core.common.businessentities.VdsDynamic in project ovirt-engine by oVirt.

the class VdsDynamicDaoTest method testUpdateAvailableUpdates.

@Test
public void testUpdateAvailableUpdates() {
    VdsDynamic before = dao.get(FixturesTool.VDS_GLUSTER_SERVER2);
    assertFalse(before.isUpdateAvailable());
    before.setUpdateAvailable(true);
    dao.updateUpdateAvailable(before.getId(), before.isUpdateAvailable());
    VdsDynamic after = dao.get(FixturesTool.VDS_GLUSTER_SERVER2);
    assertEquals(before.isUpdateAvailable(), after.isUpdateAvailable());
}
Also used : VdsDynamic(org.ovirt.engine.core.common.businessentities.VdsDynamic) Test(org.junit.Test)

Example 15 with VdsDynamic

use of org.ovirt.engine.core.common.businessentities.VdsDynamic in project ovirt-engine by oVirt.

the class VdsDynamicDaoTest method testUpdateHostExternalStatus.

@Test
public void testUpdateHostExternalStatus() {
    VdsDynamic before = dao.get(FixturesTool.VDS_GLUSTER_SERVER2);
    before.setExternalStatus(ExternalStatus.Error);
    dao.updateExternalStatus(before.getId(), before.getExternalStatus());
    VdsDynamic after = dao.get(FixturesTool.VDS_GLUSTER_SERVER2);
    assertEquals(before.getExternalStatus(), after.getExternalStatus());
}
Also used : VdsDynamic(org.ovirt.engine.core.common.businessentities.VdsDynamic) Test(org.junit.Test)

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