Description of problem: Set Quota to some special value cannot run VM. Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1.Edit a DataCenter, set Quota Mode to "Audit" 2.Switch to the sub-tab of Quota, Add a Qouta 3.Input a name, and Click the button of 'Edit', popup the sub window of "Edit Quota" 4.Set Memory limit to 0 MB, and CPU limit to 1 vCPUS, Save the data 5.Save the Quota data. 6.New a VM, select the Quota of above Adding, set other abtributes of VM, Save the VM data. 7.Run this VM. Actual results: Cannot run this VM Expected results: If cannot run this VM, give some information or make some strict limitation to the quota's value. Additional info:
Tony, Audit should only warn (as opposed to enforcing mode). Can you please provide the engine log?
When i do this operation, the engine log: 2017-02-20 19:43:11,751+08 INFO [org.ovirt.engine.core.bll.RunVmCommand] (default task-2) [5656603e-294b-4bc7-afee-0c36bc00b5b6] Lock Acquired to object 'EngineLock:{exclusiveLocks='[22cd3033-06b0-4469-8236-a2f484dd6420=<VM, ACTION_TYPE_FAILED_OBJECT_LOCKED>]', sharedLocks='null'}' 2017-02-20 19:43:11,778+08 INFO [org.ovirt.engine.core.vdsbroker.IsVmDuringInitiatingVDSCommand] (default task-2) [5656603e-294b-4bc7-afee-0c36bc00b5b6] START, IsVmDuringInitiatingVDSCommand( IsVmDuringInitiatingVDSCommandParameters:{runAsync='true', vmId='22cd3033-06b0-4469-8236-a2f484dd6420'}), log id: 1e6fdfa5 2017-02-20 19:43:11,779+08 INFO [org.ovirt.engine.core.vdsbroker.IsVmDuringInitiatingVDSCommand] (default task-2) [5656603e-294b-4bc7-afee-0c36bc00b5b6] FINISH, IsVmDuringInitiatingVDSCommand, return: false, log id: 1e6fdfa5 2017-02-20 19:43:11,802+08 WARN [org.ovirt.engine.core.bll.RunVmCommand] (default task-2) [5656603e-294b-4bc7-afee-0c36bc00b5b6] Validation of action 'RunVm' failed for user admin@internal-authz. Reasons: VAR__ACTION__RUN,VAR__TYPE__VM 2017-02-20 19:43:11,803+08 INFO [org.ovirt.engine.core.bll.RunVmCommand] (default task-2) [5656603e-294b-4bc7-afee-0c36bc00b5b6] Lock freed to object 'EngineLock:{exclusiveLocks='[22cd3033-06b0-4469-8236-a2f484dd6420=<VM, ACTION_TYPE_FAILED_OBJECT_LOCKED>]', sharedLocks='null'}' Here are some of my conclusions: The basic reason: Use the IntegerValidation validate Long type value in EditQuotaClusterModel and EditQuotaStorageModel. In the IntegerValidation, the validate(Object value) method need the value's type is Integer, but the LongEntityModelTextBoxEditor will provide a Long type value. Use IntegerValidation validate Long type value will cause some mistakes. Such as, the value 0 can pass the Validatioin, but in the QuotaManager, the checkQuotaClusterLimits(...) need the vCUPs > 0 and MemorySize > 0.
Thanks for your contribution Tony!
Verified on rhevm-4.1.2-0.1.el7.noarch UI does not allow to set memory 0 to the quota Message: "This field must contain a number greater than or equal to 1"