Bug 844652 - ovirt-engine-backend [Quota]: cannot remove last quota when removing one by one
Summary: ovirt-engine-backend [Quota]: cannot remove last quota when removing one by one
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine
Version: 3.1.0
Hardware: x86_64
OS: Linux
high
high
Target Milestone: ---
: ---
Assignee: ofri
QA Contact: Dafna Ron
URL:
Whiteboard: sla
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-07-31 09:41 UTC by Dafna Ron
Modified: 2016-02-10 20:18 UTC (History)
9 users (show)

Fixed In Version: si14
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-12-04 20:01:13 UTC
oVirt Team: SLA
Target Upstream Version:
Embargoed:


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

Description Dafna Ron 2012-07-31 09:41:05 UTC
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 16:19:18 UTC
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 09:05:07 UTC
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 13:03:26 UTC
verified on si14


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