Bug 1130163

Summary: FreeSpaceCriticalLowInGB variable causes unclear behavior when running a vm with disks on insufficient space domain
Product: [oVirt] ovirt-engine Reporter: Ori Gofen <ogofen>
Component: GeneralAssignee: Shahar Havivi <shavivi>
Status: CLOSED CURRENTRELEASE QA Contact: Israel Pinto <ipinto>
Severity: high Docs Contact:
Priority: unspecified    
Version: ---CC: acanan, amureini, bugs, ecohen, gklein, michal.skrivanek, ogofen, rbalakri, yeylon
Target Milestone: ovirt-3.6.0-rcFlags: rule-engine: ovirt-3.6.0+
ylavi: planning_ack+
rule-engine: devel_ack+
rule-engine: testing_ack+
Target Release: 3.6.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: virt
Fixed In Version: 3.6.0-12 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-12-22 13:28:44 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Virt RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ori Gofen 2014-08-14 13:11:35 UTC
Description of problem:

FreeSpaceCriticalLowInGB variable blocks with CDA the attempt to run a vm on a domain with insufficient space,popup error window explains:
"Error while executing action:

vm_state:

    Cannot run VM. Low disk space on Storage Domain iscsi."

but the only case I could think of that make sense to block this operation is when having at least { a thin provision disk on the domain && the read_only flag on the disk is not marked }

there is no reason to block a vm run with CDA when having preallocated disks or read only disks on the domain.

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

How reproducible:
100%

Steps to Reproduce:
1.run engine-config -g FreeSpaceCriticalLowInGB (make sure it is set to 5G)
2.run vm+with disk on the domain(preallocated or read only or both)
3.fill the domain so it has less than 5G
4.power off the vm
5.run the vm

Actual results:
engine CDA block

Expected results:
shouldn't block unless the disk is thin provisioned

Additional info:

Comment 1 Allon Mureinik 2014-08-14 17:38:36 UTC
From examining the code this seems as though it should only happen if you're running the VM stateless.
Ori - Are you sure you aren't running as stateless by mistake?

Comment 2 Ori Gofen 2014-08-17 07:13:07 UTC
Yes

Comment 3 Allon Mureinik 2014-08-25 12:28:32 UTC
Did some digging - org.ovirt.engine.core.bll.validator.RunVmValidator#validateStorageDomains calls StorageDomainValidator#allDomainsWithinThresholds() - not quite sure why its needed and what the benefit it.

Defering to virt to check if this was intentional or not, and acts accordingly.

Comment 4 Arik 2014-08-25 13:09:21 UTC
(In reply to Allon Mureinik from comment #3)
It doesn't look right, we should check only for:
1. stateless/vm in pool: need to check every storage domain which contains disk that we're about to take snapshot for
2. each storage domain that contains disk which is not pre-allocated and not read-only

Comment 5 Israel Pinto 2015-12-07 14:46:04 UTC
Verify with:
RHEVM version: 3.6.1.1-0.1.el6
vdsm: 3.6.1.1-0.1.el6
libvirt: 3.6.1.1-0.1.el6

Steps to reproduce:
1. check that Critical Space Action Blocker size is 5G
2. Fill storage domain, free space: ~3G
3. Test cases 
Case 1: Create VM with preallocated disk with size 20G.
        Expected: Can Do Action: can't add disk low disk space
Case 2: Create VM with thin provision disk with size 20G, run VM: 
        Expected: Can Do Action: can't run vm low  disk space
Case 3: Create VM with read only disk with size 20G, run VM: 
        Expected: VM should run
Case 4: Update disk allocation policy from Read only to thin provision. 
        Expected: Can Do Action: can't run vm low  disk space 

Results:
Case1: Per allocate disk: Error massage:
Cannot add Virtual Machine Disk. Low disk space on Storage Domain <>.
Case2: Thin provision:Error massage:
Cannot run VM. Low disk space on Storage Domain <>. 
Case3: Read Only: VM  runing
Case2: Update to Thin provision:Error massage:
Cannot run VM. Low disk space on Storage Domain <>. 

All cases PASS

Comment 6 Sandro Bonazzola 2015-12-22 13:28:44 UTC
oVirt 3.6.0 has been released and the bz verified, moving to closed current release.