use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl in project ovirt-engine by oVirt.
the class IrsProxy method reconstructMasterDomainNotInSync.
/**
* Reconstructs the master domain when the old domain is not in sync.
*
* @param storagePoolId
* The storage pool id.
* @param masterDomain
* The master domain.
* @param exceptionMessage
* The message of the exception to throw.
* @param logMessage
* The log message to write in the log.
*/
private void reconstructMasterDomainNotInSync(final Guid storagePoolId, final StorageDomainStatic masterDomain, final String exceptionMessage, final String logMessage) {
getEventQueue().submitEventSync(new Event(this.storagePoolId, masterDomain.getId(), null, EventType.RECONSTRUCT, "Reconstruct caused by failure to execute spm command"), () -> {
log.warn(logMessage);
AuditLogable logable = new AuditLogableImpl();
logable.setVdsId(currentVdsId);
logable.setVdsName(vdsStaticDao.get(currentVdsId).getName());
logable.setStorageDomainId(masterDomain.getId());
logable.setStorageDomainName(masterDomain.getName());
auditLogDirector.log(logable, AuditLogType.SYSTEM_MASTER_DOMAIN_NOT_IN_SYNC);
return getEventListener().masterDomainNotOperational(masterDomain.getId(), storagePoolId, false, true);
});
throw new IRSNoMasterDomainException(exceptionMessage);
}
use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl in project ovirt-engine by oVirt.
the class SingleAgentFenceActionExecutor method auditVerifyStatusRetryLimitExceeded.
protected void auditVerifyStatusRetryLimitExceeded(FenceActionType fenceAction) {
AuditLogable auditLogable = new AuditLogableImpl();
auditLogable.addCustomValue("Host", fencedHost.getName());
auditLogable.addCustomValue("Status", fenceAction.name().toLowerCase());
auditLogable.setVdsId(fencedHost.getId());
auditLogable.setVdsName(fencedHost.getName());
getAuditLogDirector().log(auditLogable, AuditLogType.VDS_ALERT_FENCE_STATUS_VERIFICATION_FAILED);
log.error("Failed to verify host '{}' status after {} action: have retried {} times with delay of {} seconds" + " between each retry.", fencedHost.getHostName(), fenceAction.name(), allowedWaitForStatusRetries, delayBetweenRetries);
}
use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl in project ovirt-engine by oVirt.
the class VdsNotRespondingTreatmentCommand method createAuditLogableForHost.
private AuditLogable createAuditLogableForHost(VDS vds) {
AuditLogable logable = new AuditLogableImpl();
logable.setVdsId(vds.getId());
logable.setVdsName(vds.getName());
logable.setClusterId(vds.getClusterId());
logable.setClusterName(vds.getClusterName());
logable.setRepeatable(true);
return logable;
}
use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl in project ovirt-engine by oVirt.
the class BlockStorageDiscardFunctionalityHelper method logIfDisksWithIllegalPassDiscardExist.
public void logIfDisksWithIllegalPassDiscardExist(Guid vmId) {
Collection<DiskImage> disks = DisksFilter.filterImageDisks(diskDao.getAllForVm(vmId));
Collection<DiskVmElement> diskVmElements = diskVmElementDao.getAllForVm(vmId);
Map<Disk, DiskVmElement> diskToDiskVmElement = diskHandler.getDiskToDiskVmElementMap(disks, diskVmElements);
Map<Guid, Guid> diskIdToDestSdId = disks.stream().collect(Collectors.toMap(DiskImage::getId, diskImage -> diskImage.getStorageIds().get(0)));
MultipleDiskVmElementValidator multipleDiskVmElementValidator = new MultipleDiskVmElementValidator(diskToDiskVmElement);
Collection<Guid> disksWithoutSupportForPassDiscard = multipleDiskVmElementValidator.getDisksWithoutSupportForPassDiscard(diskIdToDestSdId);
if (!disksWithoutSupportForPassDiscard.isEmpty()) {
AuditLogable auditLog = new AuditLogableImpl();
auditLog.addCustomValue("DisksIds", disksWithoutSupportForPassDiscard.stream().map(Guid::toString).collect(Collectors.joining(", ")));
auditLogDirector.log(auditLog, AuditLogType.DISKS_WITH_ILLEGAL_PASS_DISCARD_EXIST);
}
}
use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl in project ovirt-engine by oVirt.
the class AsyncTaskManager method cleanZombieTasks.
private void cleanZombieTasks() {
long maxTime = DateTime.getNow().addMinutes(-1 * Config.<Integer>getValue(ConfigValues.AsyncTaskZombieTaskLifeInMinutes)).getTime();
for (SPMTask task : tasks.values()) {
if (task.getParameters().getDbAsyncTask().getStartTime().getTime() < maxTime) {
AuditLogable logable = new AuditLogableImpl();
logable.addCustomValue("CommandName", task.getParameters().getDbAsyncTask().getActionType().toString());
logable.addCustomValue("Date", task.getParameters().getDbAsyncTask().getStartTime().toString());
// status
if (task.getLastTaskStatus().getStatus() != AsyncTaskStatusEnum.finished && task.getLastTaskStatus().getStatus() != AsyncTaskStatusEnum.unknown) {
// mark it as a zombie task, Will result in failure of the command
task.setZombieTask(true);
auditLogDirector.log(logable, AuditLogType.TASK_STOPPING_ASYNC_TASK);
log.info("Cleaning zombie tasks: Stopping async task '{}' that started at '{}'", task.getParameters().getDbAsyncTask().getActionType(), task.getParameters().getDbAsyncTask().getStartTime());
task.stopTask(true);
} else {
auditLogDirector.log(logable, AuditLogType.TASK_CLEARING_ASYNC_TASK);
log.info("Cleaning zombie tasks: Clearing async task '{}' that started at '{}'", task.getParameters().getDbAsyncTask().getActionType(), task.getParameters().getDbAsyncTask().getStartTime());
task.clearAsyncTask(true);
}
}
}
}
Aggregations