Bug 848028

Summary: ovirt-engine-backend [Quota]: unable to create snapshot due to wrong quota calculation after commit
Product: Red Hat Enterprise Virtualization Manager Reporter: Dafna Ron <dron>
Component: ovirt-engineAssignee: ofri <omasad>
Status: CLOSED CURRENTRELEASE QA Contact: Dafna Ron <dron>
Severity: high Docs Contact:
Priority: urgent    
Version: 3.1.0CC: dfediuck, dyasny, hateya, iheim, lpeer, mkenneth, Rhev-m-bugs, sgordon, sgrinber, yeylon, ykaul
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: sla
Fixed In Version: si19 Doc Type: Release Note
Doc Text:
Since the size of the consumed part of a quota is referring to the part allocated and not to the part actually used by the user there might differences between the used storage size appearing in the storage tab to the consumed storage appearing in the Quota>storage sub-tab.
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-12-04 20:07:51 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:
Embargoed:
Attachments:
Description Flags
log
none
logs and screen shots none

Description Dafna Ron 2012-08-14 11:08:11 UTC
Created attachment 604264 [details]
log

Description of problem:

I created a vm and created several snapshots until the quota blocked me. 
I committed the snapshots (merge of snapshots) which should collapse all the snapshots below the one I selected. 
I can see in UI that the quota was changed back to the original disk size but I am still getting CanDoAction from engine that Quota is not valid. 

I am however able to create a new disk so it seems that we might not be cleaning the snapshot table. 

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

si13.2

How reproducible:

100%

Steps to Reproduce:
1. create a quota of 30G and a vm with preallocated 5GB disk
2. create snapshots until you are blocked by backend
3. commit the first snapshot (all other snapshots should be merged)
4. try to create a new snapshot 
  
Actual results:

we cannot create more snapshots after commit because of wrong calculation

Expected results:

after commit we should be able to create new snapshots

Additional info:log

Comment 1 ofri 2012-08-20 07:04:35 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Since the calculation of the size of the snapshot is dependent of the actual size on disk, it may lead to different behaviors on different file systems and storage systems.

Comment 3 Dafna Ron 2012-09-02 11:54:16 UTC
check in si16. 

I created a quota with 30GB and vm with 5GB disk.
I was blocked by quota after the first snapshot and quota is reporting 10GB out of 30 is used. 
moving back to devel 

Error while executing action: Cannot ${action} ${type}. Quota has no sufficient storage resources.

Comment 4 Dafna Ron 2012-09-02 11:54:40 UTC
Created attachment 609070 [details]
logs and screen shots

Comment 7 Dafna Ron 2012-09-09 18:12:18 UTC
we are still getting wrong calculation although they very from the first snapshot. 

tested in si17 with Quota of 30GB and vm with 1 disk of 5GB preallocated.  

I compare the quota to the storage tab -> vm's:

Snapshot#    |Toatal for Quota    | Toatal for VM's under storage tab  
--------------------------------------------------------------------
1            | 10GB               | 6GB                    
--------------------------------------------------------------------
2            | 11GB               | 7GB                     
--------------------------------------------------------------------
3            | 12GB               | 8GB
--------------------------------------------------------------------
4            | 13GB               | 9GB
--------------------------------------------------------------------
5            | 14GB               | 10GB
--------------------------------------------------------------------

after commit we see the same in vm under main storage and under the quota which is 6Gb but adding more snapshot I am still seeing the same behaviour. 

you can also see that the vm's tab under the storage tab is reporting the same numbers that we are seeing in the storage main tab.

Comment 8 ofri 2012-09-13 10:24:09 UTC
This is a storage issue. The return value of DiskImage.getActualValue() is wrong when called on the first snapshot creation for an iSCSI disk.

Comment 9 ofri 2012-09-24 06:59:00 UTC
The numbers described in comment 7 are not a bug. this is the usual behavior for thin provision (snapshot is always thin provision). Nevertheless, a tool-tip would be added to the “Used storage/Total” column in Quota>Storage sub-tab saying: These calculations represents the max growth potential and may differ from the actual consumption. Please refer documentation for further explanations. A Guides-Admin BZ was opened: BZ#859732.

Comment 10 ofri 2012-09-24 09:23:57 UTC
Posted to upstream: http://gerrit.ovirt.org/#/c/8153/

Comment 12 Dafna Ron 2012-10-02 13:52:11 UTC
verified on si19

Comment 13 Stephen Gordon 2012-11-01 20:12:47 UTC
Hey Miki does this actually need a release note anymore? I checked the bug referred to (Bug # 859732) and this actually made it into the admin guide before the translation freeze.

Comment 14 Miki Kenneth 2012-11-08 12:25:04 UTC
Agree that it can be removed.

Comment 15 Stephen Gordon 2012-11-08 14:39:08 UTC
Removing requires_doc_text- and also removing from release notes document.