use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable in project ovirt-engine by oVirt.
the class StorageDomainHelper method checkNumberOfLVsForBlockDomain.
/**
* If the storage domain given in the parameter is a block domain, the number of LVs on this domain will be fetched
* and if it exceeds the maximum number of LVs defined in the AlertOnNumberOfLVs config value, an audit log will
* be logged to indicate that the number of LVs on this domain exceeded the allowed number of LVs
*/
public void checkNumberOfLVsForBlockDomain(Guid storageDomainId) {
StorageDomainStatic domain = storageDomainStaticDao.get(storageDomainId);
if (domain.getStorageType().isBlockDomain()) {
long numOfLVs = storageDomainDao.getNumberOfImagesInStorageDomain(storageDomainId);
Integer maxNumOfLVs = Config.getValue(ConfigValues.AlertOnNumberOfLVs);
if (numOfLVs >= maxNumOfLVs) {
AuditLogable logable = new AuditLogableImpl();
logable.setStorageDomainName(domain.getName());
logable.addCustomValue("maxNumOfLVs", maxNumOfLVs.toString());
logable.setStorageDomainId(storageDomainId);
auditLogDirector.log(logable, AuditLogType.NUMBER_OF_LVS_ON_STORAGE_DOMAIN_EXCEEDED_THRESHOLD);
}
}
}
use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable in project ovirt-engine by oVirt.
the class VdsNotRespondingTreatmentCommand method logAlert.
private void logAlert(VDS host, int percents) {
AuditLogable auditLogable = createAuditLogableForHost(host);
auditLogable.addCustomValue("Percents", String.valueOf(percents));
auditLogDirector.log(auditLogable, AuditLogType.VDS_ALERT_FENCE_OPERATION_SKIPPED_BROKEN_CONNECTIVITY);
}
use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable in project ovirt-engine by oVirt.
the class VdsNotRespondingTreatmentCommand method shouldFencingBeSkipped.
private boolean shouldFencingBeSkipped(VDS vds) {
// check if fencing in cluster is enabled
Cluster cluster = clusterDao.get(vds.getClusterId());
if (cluster != null && !cluster.getFencingPolicy().isFencingEnabled()) {
AuditLogable alb = createAuditLogableForHost(vds);
auditLogDirector.log(alb, AuditLogType.VDS_ALERT_FENCE_DISABLED_BY_CLUSTER_POLICY);
return true;
}
// check if connectivity is not broken
if (isConnectivityBrokenThresholdReached(getVds())) {
return true;
}
// fencing will be executed
return false;
}
use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable in project ovirt-engine by oVirt.
the class PostDeleteActionHandler method fixDiscardField.
/**
* Since a storage domain's discard support may be changed since the discard after delete value was chosen by the
* user, we should check its support before sending it to vdsm. If it doesn't support discard any more, that means
* that discarding the disk will not work, and we can let the user know about it and send discard=false to vdsm.
* @param parameters the parameters of the command that should be executed.
* @param storageDomain the storage domain that the disk or snapshot belongs to.
* @param <T> the parameters type.
* @return the fixed parameters.
*/
protected <T extends StoragePoolDomainAndGroupIdBaseVDSCommandParameters & PostDeleteAction> T fixDiscardField(T parameters, StorageDomain storageDomain) {
if (storageDomain.getDiscardAfterDelete()) {
if (!Boolean.TRUE.equals(storageDomain.getSupportsDiscard())) {
parameters.setDiscard(false);
AuditLogable auditLog = new AuditLogableImpl();
auditLog.setStorageDomainId(storageDomain.getId());
auditLogDirector.log(auditLog, AuditLogType.ILLEGAL_STORAGE_DOMAIN_DISCARD_AFTER_DELETE);
}
} else if (diskVmElementWithPassDiscardExists(parameters.getImageGroupId()) && Boolean.TRUE.equals(storageDomain.getSupportsDiscard())) {
// At least one vm has this disk with pass discard enabled.
// Thus, although the relevant storage domain's discard after
// delete value is false, we send discard = true to vdsm.
parameters.setDiscard(true);
}
return parameters;
}
use of org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable in project ovirt-engine by oVirt.
the class IsoDomainListSynchronizer method addToAuditLogSuccessMessage.
/**
* Add audit log message when fetch encounter problems.
*/
private void addToAuditLogSuccessMessage(StorageDomain isoDomain, String imageType) {
AuditLogable logable = new AuditLogableImpl();
logable.addCustomValue("imageDomains", String.format("%s (%s file type)", isoDomain.getName(), imageType));
logable.setStorageDomainId(isoDomain.getId());
logable.setStorageDomainName(isoDomain.getName());
auditLogDirector.log(logable, AuditLogType.REFRESH_REPOSITORY_IMAGE_LIST_SUCCEEDED);
}
Aggregations