Bug 1003839

Summary: Not possible to remove vm or re-assign quota of vm disk, when vm had assigned quota which no longer exists.
Product: Red Hat Enterprise Virtualization Manager Reporter: Ondra Machacek <omachace>
Component: ovirt-engineAssignee: Gilad Chaplik <gchaplik>
Status: CLOSED CURRENTRELEASE QA Contact: Lukas Svaty <lsvaty>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 3.3.0CC: acathrow, dfediuck, iheim, lpeer, mavital, omachace, Rhev-m-bugs, yeylon
Target Milestone: ---Keywords: Triaged
Target Release: 3.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: sla
Fixed In Version: is17 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-21 22:18:22 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: SLA RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
engine.log none

Description Ondra Machacek 2013-09-03 10:35:43 UTC
Created attachment 793111 [details]
engine.log

Description of problem:
Not possible to remove vm or reassing quota of vm disk, when vm had assigned 
quota which no longer exists. When dc in enforing mode. When DC is switched to 
audit, then reassing of disk quota or removing of vm works OK.

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

How reproducible:
always

Steps to Reproduce:
1. Set DC to enforced mode.
2. Create quota_1 and quota_2.
3. Create vm with disk, assign both quota_1.
4. Set DC to disabled mode.
5. Remove quota_1.
6. Set DC to enforced mode.
7. Try to remove vm, or try to assign different quota to vm disk.

Actual results:
When Removing vm:

Error while executing action:
Cannot remove VM. The quota associated with VM my_vm is no longer available. This may be a result of an import or snapshot restoring actions. Please 
reassign a quota to this VM.

When assigning different quota for vm disk:

Error while executing action: Cannot assign Quota. The quota associated with VM
null is no longer available. This may be a result of an import or snapshot 
restoring actions. Please reassign a quota to this VM.


Expected results:
Both actions should be executed successufully.

Additional info:

Comment 1 Itamar Heim 2013-09-03 21:52:04 UTC
how can we have a VM with a deleted quota?

Comment 2 Doron Fediuck 2013-09-16 13:48:42 UTC
Ondra,
Is this a fresh install or an upgrade?
Also, was this the last quota allocation?

Comment 3 Ondra Machacek 2013-09-18 13:40:57 UTC
Reproduced on fresh is15.
last quota allocation? Quota was assigned to vm, and in disabled mode was removed.
Thus in db vm stay attached to this quota.

before deletion of quota:
engine=# select quota_id from vm_static where vm_guid = '6fc1253b-2ea5-4c20-af40-be81bd055e16';
               quota_id               
--------------------------------------
 3556ef35-b391-404b-904b-293afe857900
(1 row)


after deletion of quota:
engine=# select quota_id from vm_static where vm_guid = '6fc1253b-2ea5-4c20-af40-be81bd055e16';
               quota_id               
--------------------------------------
 3556ef35-b391-404b-904b-293afe857900
(1 row)


Quota stay assinged to vm. So when removing quota which is assinged to some
vms/disks in disabled mode, also quota_id of vms & disk should be changed to 
00000000-0000-0000-0000-000000000000

Comment 4 Lukas Svaty 2013-10-01 08:51:03 UTC
tested on is17

Comment 5 Itamar Heim 2014-01-21 22:18:22 UTC
Closing - RHEV 3.3 Released

Comment 6 Itamar Heim 2014-01-21 22:24:43 UTC
Closing - RHEV 3.3 Released