Bug 848107

Summary: ovirt-engine-backend [Quota]: cannot run a stateless vm because of quota calculations
Product: Red Hat Enterprise Virtualization Manager Reporter: Dafna Ron <dron>
Component: ovirt-engineAssignee: ofri <omasad>
Status: CLOSED CURRENTRELEASE QA Contact: Dafna Ron <dron>
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: dfediuck, dyasny, hateya, iheim, lpeer, Rhev-m-bugs, sgrinber, yeylon, ykaul
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: sla
Fixed In Version: si17 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-12-04 20:04:50 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

Description Dafna Ron 2012-08-14 16:01:42 UTC
Created attachment 604349 [details]
log

Description of problem:

I have a quota for 30GB and a vm with a 16GB disk
when I tried running the vm as stateless I am blocked by quota with the following error: 

Error while executing action Run VM once: Internal oVirt Engine Error

backend log shows: 

2012-08-14 18:39:07,669 INFO  [org.ovirt.engine.core.bll.RunVmCommand] (ajp-/127.0.0.1:8009-10) [185fad7e] VdcBll.RunVmCommand.RunVmAsStateless - Creating snapshot for stateless vm Quota3 - 93102542-2bae-4fd3-b416-a566728d40a1
2012-08-14 18:39:07,699 INFO  [org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand] (ajp-/127.0.0.1:8009-10) [6fa5cdf5] Lock Acquired to object EngineLock [exclusiveLocks= key: 93102542-2bae-4fd3-b416-a566728d40a1 value: VM
, sharedLocks= ]
2012-08-14 18:39:07,704 INFO  [org.ovirt.engine.core.vdsbroker.irsbroker.IsValidVDSCommand] (ajp-/127.0.0.1:8009-10) [6fa5cdf5] START, IsValidVDSCommand(storagePoolId = 66b35d07-24eb-4bdc-952d-1cf7144f71ab, ignoreFailoverLimit = false, compatabilityVersion = null), log id: 3e3a9ae5
2012-08-14 18:39:07,705 INFO  [org.ovirt.engine.core.vdsbroker.irsbroker.IsValidVDSCommand] (ajp-/127.0.0.1:8009-10) [6fa5cdf5] FINISH, IsValidVDSCommand, return: true, log id: 3e3a9ae5
2012-08-14 18:39:07,720 INFO  [org.ovirt.engine.core.vdsbroker.irsbroker.GetImageInfoVDSCommand] (ajp-/127.0.0.1:8009-10) [6fa5cdf5] START, GetImageInfoVDSCommand(storagePoolId = 66b35d07-24eb-4bdc-952d-1cf7144f71ab, ignoreFailoverLimit = false, compatabilityVersion = null, storageDomainId = b2e0b090-0e94-421c-82c8-50b96d228f75, imageGroupId = cd7ad4f7-b997-4076-9f61-af5e02beb55c, imageId = c390ba8f-4dea-42e7-961e-2afc14393657), log id: 9ea6410
2012-08-14 18:39:08,249 INFO  [org.ovirt.engine.core.vdsbroker.irsbroker.GetImageInfoVDSCommand] (ajp-/127.0.0.1:8009-10) [6fa5cdf5] FINISH, GetImageInfoVDSCommand, return: org.ovirt.engine.core.common.businessentities.DiskImage@e243313, log id: 9ea6410
2012-08-14 18:39:08,771 WARN  [org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand] (ajp-/127.0.0.1:8009-10) [6fa5cdf5] CanDoAction of action CreateAllSnapshotsFromVm failed. Reasons:ACTION_TYPE_FAILED_QUOTA_STORAGE_LIMIT_EXCEEDED
2012-08-14 18:39:08,772 INFO  [org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand] (ajp-/127.0.0.1:8009-10) [6fa5cdf5] Lock freed to object EngineLock [exclusiveLocks= key: 93102542-2bae-4fd3-b416-a566728d40a1 value: VM
, sharedLocks= ]
2012-08-14 18:39:08,772 ERROR [org.ovirt.engine.core.bll.RunVmCommand] (ajp-/127.0.0.1:8009-10) [6fa5cdf5] RunVmAsStateless - Quota3 - failed to create snapshots
2012-08-14 18:39:08,802 ERROR [org.ovirt.engine.core.bll.RunVmOnceCommand] (ajp-/127.0.0.1:8009-10) [6fa5cdf5] Transaction rolled-back for command: org.ovirt.engine.core.bll.RunVmOnceCommand.


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

si13.3 

How reproducible:

100%

Steps to Reproduce:
1. create a quota of 30GB and a vm with 16GB disk
2. run vm as stateless (run-once)
3.
  
Actual results:

1. we are calculating the full disk size and failing snapshot creation
2. text of error should be added


Expected results:

1. fix calculation of stateless
2. fix error
3. stateless should not be calculated in quota since its temporary

Additional info:

Comment 1 Itamar Heim 2012-08-14 20:09:56 UTC
(In reply to comment #0)
...
> 
> Expected results:
> 
> 1. fix calculation of stateless

only at a fine tuning level in which the currently active leaf should be calculated as actual size as it will not be a lead once the snapshot is created.
i think we can leave this for a separate, future, bug on this level of fine tuning of the calculation.

> 2. fix error

indeed. internal error isn't nice here.

> 3. stateless should not be calculated in quota since its temporary

disagree - that doesn't mean it doesn't take storage.

Comment 2 Doron Fediuck 2012-08-15 10:05:21 UTC
(In reply to comment #1)
> (In reply to comment #0)
> ...
> > 
> > Expected results:
> > 
> > 1. fix calculation of stateless
> 
> only at a fine tuning level in which the currently active leaf should be
> calculated as actual size as it will not be a lead once the snapshot is
> created.
> i think we can leave this for a separate, future, bug on this level of fine
> tuning of the calculation.
> 
> > 2. fix error
> 
> indeed. internal error isn't nice here.
> 
> > 3. stateless should not be calculated in quota since its temporary
> 
> disagree - that doesn't mean it doesn't take storage.

I agree with Itamar.
Dafna, there are several BZs which are related to snapshot calculations.
I think it would be better if you have one BZ to concentrate all snapshot calculation issues you found, which we'll handle when we can (future for now).

In this BZ we'll make sure to handle the error.

Comment 5 Dafna Ron 2012-09-09 14:59:35 UTC
verified on si17