Tal Nisan has posted comments on this change.

Change subject: core: Add an audit log entry when number of LVs on a domain 
exceeded max
......................................................................


Patch Set 1:

(3 comments)

http://gerrit.ovirt.org/#/c/29057/1/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties
File 
backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties:

Line 619: TASK_STOPPING_ASYNC_TASK=Stopping async task ${CommandName} that 
started at ${Date}
Line 620: REFRESH_REPOSITORY_IMAGE_LIST_FAILED=Refresh image list failed for 
domain(s): ${imageDomains}. Please check domain activity.
Line 621: REFRESH_REPOSITORY_IMAGE_LIST_SUCCEEDED=Refresh image list succeeded 
for domain(s): ${imageDomains}
Line 622: REFRESH_REPOSITORY_IMAGE_LIST_INCOMPLETE=Refresh image list probably 
incomplete for domain ${imageDomain}, only ${imageListSize} images discovered.
Line 623: NUNBER_OF_LVS_ON_STORAGE_DOMAIN_EXCEEDED_THRESHOLD=The number of LVs 
on the domain ${storageDomainName} exceeded the threshold of ${maxNumOfLVs}.
> Probably worth adding something like " you're approaching the limit where p
Done
Line 624: TASK_CLEARING_ASYNC_TASK=Clearing asynchronous task ${CommandName} 
that started at ${Date}
Line 625: VM_WAS_SET_DOWN_DUE_TO_HOST_REBOOT_OR_MANUAL_FENCE=Vm ${VmName} was 
shut down due to ${VdsName} host reboot or manual fence
Line 626: UPDATE_TAGS_VM_DEFAULT_DISPLAY_TYPE=Vm ${VmName} tag default display 
type was updated
Line 627: UPDATE_TAGS_VM_DEFAULT_DISPLAY_TYPE_FAILED=Failed to update Vm 
${VmName} tag default display type


http://gerrit.ovirt.org/#/c/29057/1/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/storage/StorageDomainHelper.java
File 
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/storage/StorageDomainHelper.java:

Line 14:     /**
Line 15:      * If the storage domain given in the parameter is a block domain, 
the number of LVs on this domain will be fetched
Line 16:      * and if it exceeds the maximum number of LVs defined in the 
AlertOnNumberOfLVs config value, an audit log will
Line 17:      * be logged to indicate that the number of LVs on this domain 
exceeded the allowed number of LVs
Line 18:      * @param storageDomainId
> So remove it
Done
Line 19:      */
Line 20:     public static void checkNumberOfLVsForBlockDomain(Guid 
storageDomainId) {
Line 21:         StorageDomainStatic domain = 
DbFacade.getInstance().getStorageDomainStaticDao().get(storageDomainId);
Line 22:         if (domain.getStorageType().isBlockDomain()) {


Line 23:             long numOfLVs = 
DbFacade.getInstance().getStorageDomainDao().getNumberOfImagesInStorageDomain(storageDomainId);
Line 24:             Integer maxNumOfLVs = 
Config.getValue(ConfigValues.AlertOnNumberOfLVs);
Line 25:             if (numOfLVs >= maxNumOfLVs) {
Line 26:                 AuditLogableBase logable = new AuditLogableBase();
Line 27:                 logable.setStorageDomainId(storageDomainId);
> let's just add the value of the storage domain name, no need to set the id 
I agree, done
Line 28:                 logable.addCustomValue("maxNumOfLVs", 
maxNumOfLVs.toString());
Line 29:                 AuditLogDirector.log(logable, 
AuditLogType.NUNBER_OF_LVS_ON_STORAGE_DOMAIN_EXCEEDED_THRESHOLD);
Line 30:             }
Line 31:         }


-- 
To view, visit http://gerrit.ovirt.org/29057
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ie701a4b622b4f93690020922f96279d28903abc8
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Tal Nisan <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Liron Aravot <[email protected]>
Gerrit-Reviewer: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: Tal Nisan <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to