Search in sources :

Example 21 with AuditLogableImpl

use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl in project ovirt-engine by oVirt.

the class ClusterOperationCommandBase method alertIfFencingDisabled.

protected void alertIfFencingDisabled() {
    if (!getCluster().getFencingPolicy().isFencingEnabled()) {
        AuditLogable alb = new AuditLogableImpl();
        alb.setClusterId(getCluster().getId());
        alb.setClusterName(getCluster().getName());
        alb.setRepeatable(true);
        auditLogDirector.log(alb, AuditLogType.FENCE_DISABLED_IN_CLUSTER_POLICY);
    }
}
Also used : AuditLogable(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable) AuditLogableImpl(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl)

Example 22 with AuditLogableImpl

use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl in project ovirt-engine by oVirt.

the class GetVmsFromExportDomainQuery method auditLogOvfLoadError.

private void auditLogOvfLoadError(String machineName, String errorMessage) {
    AuditLogable logable = new AuditLogableImpl();
    logable.addCustomValue("ImportedVmName", machineName).addCustomValue("ErrorMessage", errorMessage);
    auditLogDirector.log(logable, AuditLogType.IMPORTEXPORT_FAILED_TO_IMPORT_VM);
}
Also used : AuditLogable(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable) AuditLogableImpl(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl)

Example 23 with AuditLogableImpl

use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl in project ovirt-engine by oVirt.

the class VdsCommand method logSettingVmToDown.

protected void logSettingVmToDown(VM vm) {
    AuditLogable logable = new AuditLogableImpl();
    logable.setVdsName(getVds().getName());
    logable.setVdsId(getVds().getId());
    logable.setVmName(vm.getName());
    logable.setVmId(vm.getId());
    auditLogDirector.log(logable, AuditLogType.VM_WAS_SET_DOWN_DUE_TO_HOST_REBOOT_OR_MANUAL_FENCE);
}
Also used : AuditLogable(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable) AuditLogableImpl(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl)

Example 24 with AuditLogableImpl

use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl in project ovirt-engine by oVirt.

the class VdsEventListener method createVmEvent.

private AuditLogable createVmEvent(Guid vmId, AuditLogType logType) {
    AuditLogable event = new AuditLogableImpl();
    event.setVmName(vmStaticDao.get(vmId).getName());
    event.setVmId(vmId);
    auditLogDirector.log(event, logType);
    return event;
}
Also used : AuditLogable(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable) AuditLogableImpl(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl)

Example 25 with AuditLogableImpl

use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl in project ovirt-engine by oVirt.

the class VmPoolMonitor method runVmFromPool.

/**
 * Run the given VM as stateless.
 */
private boolean runVmFromPool(VmStatic vmToRun, boolean runAsStateless, String poolName) {
    log.info("Running VM '{}' as {}", vmToRun.getName(), runAsStateless ? "stateless" : "stateful");
    RunVmParams runVmParams = new RunVmParams(vmToRun.getId());
    runVmParams.setEntityInfo(new EntityInfo(VdcObjectType.VM, vmToRun.getId()));
    runVmParams.setRunAsStateless(runAsStateless);
    ActionReturnValue actionReturnValueurnValue = Backend.getInstance().runInternalAction(ActionType.RunVm, runVmParams, ExecutionHandler.createInternalJobContext().withLock(vmPoolHandler.createLock(vmToRun.getId())));
    boolean prestartingVmSucceeded = actionReturnValueurnValue.getSucceeded();
    if (!prestartingVmSucceeded) {
        AuditLogable log = new AuditLogableImpl();
        log.addCustomValue("VmPoolName", poolName);
        Injector.get(AuditLogDirector.class).log(log, AuditLogType.VM_FAILED_TO_PRESTART_IN_POOL);
    }
    log.info("Running VM '{}' as {} {}", vmToRun.getName(), runAsStateless ? "stateless" : "stateful", prestartingVmSucceeded ? "succeeded" : "failed");
    return prestartingVmSucceeded;
}
Also used : AuditLogable(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable) ActionReturnValue(org.ovirt.engine.core.common.action.ActionReturnValue) EntityInfo(org.ovirt.engine.core.common.asynctasks.EntityInfo) AuditLogableImpl(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl) RunVmParams(org.ovirt.engine.core.common.action.RunVmParams) AuditLogDirector(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector)

Aggregations

AuditLogableImpl (org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl)88 AuditLogable (org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable)85 AuditLogDirector (org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector)8 AuditLogType (org.ovirt.engine.core.common.AuditLogType)6 Guid (org.ovirt.engine.core.compat.Guid)5 EngineException (org.ovirt.engine.core.common.errors.EngineException)4 HostUpgradeManagerResult (org.ovirt.engine.core.common.HostUpgradeManagerResult)3 ActionReturnValue (org.ovirt.engine.core.common.action.ActionReturnValue)3 AnsibleCommandBuilder (org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilder)3 AnsibleReturnValue (org.ovirt.engine.core.common.utils.ansible.AnsibleReturnValue)3 ArrayList (java.util.ArrayList)2 Date (java.util.Date)2 List (java.util.List)2 Collectors (java.util.stream.Collectors)2 StorageDomain (org.ovirt.engine.core.common.businessentities.StorageDomain)2 StorageDomainStatic (org.ovirt.engine.core.common.businessentities.StorageDomainStatic)2 StoragePool (org.ovirt.engine.core.common.businessentities.StoragePool)2 DiskImage (org.ovirt.engine.core.common.businessentities.storage.DiskImage)2 LUNs (org.ovirt.engine.core.common.businessentities.storage.LUNs)2 Event (org.ovirt.engine.core.common.eventqueue.Event)2