Bug 844652 - ovirt-engine-backend [Quota]: cannot remove last quota when removing one by one
ovirt-engine-backend [Quota]: cannot remove last quota when removing one by one
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine (Show other bugs)
3.1.0
x86_64 Linux
high Severity high
: ---
: ---
Assigned To: ofri
Dafna Ron
sla
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-31 05:41 EDT by Dafna Ron
Modified: 2016-02-10 15:18 EST (History)
9 users (show)

See Also:
Fixed In Version: si14
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-12-04 15:01:13 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: SLA
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
log (18.68 KB, application/x-xz)
2012-07-31 05:41 EDT, Dafna Ron
no flags Details

  None (edit)
Description Dafna Ron 2012-07-31 05:41:05 EDT
Created attachment 601491 [details]
log

Description of problem:

if I select multiple quota's I can remove all quota objects from the system 
when I remove one by one we get a CanDoAction on the last one. 

2012-07-31 12:42:53,371 WARN  [org.ovirt.engine.core.bll.RemoveQuotaCommand] (http-/0.0.0.0:8080-1) CanDoAction of action RemoveQuota failed. Reasons:VAR__ACTION__REMOVE,VAR__TYPE__QUOTA,ACTION_TYPE_FAILED_DATA_CENTER_MUST_HAVE_AT_LEAST_ONE_QUOTA

Version-Release number of selected component (if applicable):

si12

How reproducible:

100%

Steps to Reproduce:
1. create several quota's
2. remove one by one
3.
  
Actual results:

we get a CanDoAction from backend


Expected results:

we should be able to remove last quota in multiple and single action

Additional info:log
Comment 1 Doron Fediuck 2012-08-05 12:19:18 EDT
It looks like a reminder of past default Quota.
So we'll allow removing ther last Quota object.

Note that this means there's no Qota defined and no VM can start,
but the only way to remove this Quota is if it's not being used,
which means the user already detached it.

Please remove the relevant CanDoAction check.
Comment 2 ofri 2012-08-06 05:05:07 EDT
The CanDoAction logic is faulty.
It should be: If the quota is in use by a vm or image - return false (if the quota id is in ether 'vm_static' or 'images' tables).
Comment 5 Dafna Ron 2012-08-16 09:03:26 EDT
verified on si14

Note You need to log in before you can comment on or make changes to this bug.