Bug 1197474

Summary: Start vm that have memory and guaranteed memory above host free memory, failed with libvirtd error
Product: Red Hat Enterprise Virtualization Manager Reporter: rhev-integ
Component: ovirt-engineAssignee: Dudi Maroshi <dmaroshi>
Status: CLOSED ERRATA QA Contact: Artyom <alukiano>
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.5.0CC: dfediuck, ecohen, gklein, juwu, lpeer, lsurette, mavital, rbalakri, rgolan, Rhev-m-bugs, sherold, s.kieske, yeylon
Target Milestone: ---Keywords: ZStream
Target Release: 3.5.3   
Hardware: x86_64   
OS: Linux   
Whiteboard: sla
Fixed In Version: org.ovirt.engine-root-3.5.3-2 Doc Type: Bug Fix
Doc Text:
Previously, when creating a virtual machine, if the value for the Physical Memory Guaranteed field exceeded the free memory available on the host, a generic libvirtd error returned. With this update, a memory detection parameter was added, and a proper error message is returned.
Story Points: ---
Clone Of: 1180071 Environment:
Last Closed: 2015-06-15 13:27:06 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: SLA RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1180071    
Bug Blocks:    
Attachments:
Description Flags
vdsm and qemu log none

Comment 2 Artyom 2015-05-17 09:00:00 UTC
Created attachment 1026435 [details]
vdsm and qemu log

Checked on rhevm-3.5.3-0.2.el6ev.noarch
Have host with:
[root@alma05 ~]# free
              total        used        free      shared  buff/cache   available
Mem:       16151584      536368    14852488       41680      762728    15259472
Swap:             0           0           0

Try to run vm with memory=15000MB and guaranteed memory=1024MB under cluster Memory Optimization equal to 200%
Start vm failed with the same error as above: 
Cannot set up guest memory 'pc.ram': Cannot allocate memory
2015-04-21 13:37:24.556+0000: shutting down
So it seem we need to check if host vm have less memory(not guaranteed) than host free memory + swap

Comment 3 Doron Fediuck 2015-05-17 15:13:52 UTC
(In reply to Artyom from comment #2)
> Created attachment 1026435 [details]
> vdsm and qemu log
> 
> Checked on rhevm-3.5.3-0.2.el6ev.noarch
> Have host with:
> [root@alma05 ~]# free
>               total        used        free      shared  buff/cache  
> available
> Mem:       16151584      536368    14852488       41680      762728   
> 15259472
> Swap:             0           0           0
> 
> Try to run vm with memory=15000MB and guaranteed memory=1024MB under cluster
> Memory Optimization equal to 200%
> Start vm failed with the same error as above: 
> Cannot set up guest memory 'pc.ram': Cannot allocate memory
> 2015-04-21 13:37:24.556+0000: shutting down
> So it seem we need to check if host vm have less memory(not guaranteed) than
> host free memory + swap

The engine calculates available memory using minimal_guaranteed, and this is
what you should be using.
See: http://www.ovirt.org/Sla/FreeMemoryCalculation

Comment 4 Artyom 2015-05-18 09:56:39 UTC
Not really understand what you mean by minimal_guaranteed, if you mean "Max free Memory for scheduling new VMs" it value greater than free host memory because we have overcommitment equal to 200%, so bug still exist.

Comment 5 Doron Fediuck 2015-05-18 11:07:37 UTC
(In reply to Artyom from comment #4)
> Not really understand what you mean by minimal_guaranteed, if you mean "Max
> free Memory for scheduling new VMs" it value greater than free host memory
> because we have overcommitment equal to 200%, so bug still exist.

When creating a new VM you have a "Resource Allocation" side tab.
In this tab you have "Physical Memory Guaranteed" and this is the part that
is being used for scheduling memory calculation as you can read in the link
I provided in comment 3. If you set this one the a value greater than host
physical memory, that VM will be blocked from starting.

Comment 6 Artyom 2015-05-19 06:33:46 UTC
Doron said that we check only guaranteed memory.
Verified on rhevm-3.5.3-0.2.el6ev.noarch
Update VM with guaranteed above host free memory, run vm, receive message:
"The host cyan-vdsf.qa.lab.tlv.redhat.com did not satisfy internal filter Memory because has availabe 7372 MB memory. Insufficient free memory to run the VM."

Comment 8 errata-xmlrpc 2015-06-15 13:27:06 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-1095.html