Bug 1430795

Summary: Automatically increase max memory if necessary in REST
Product: [oVirt] ovirt-engine Reporter: jniederm
Component: RestAPIAssignee: jniederm
Status: CLOSED CURRENTRELEASE QA Contact: Israel Pinto <ipinto>
Severity: high Docs Contact:
Priority: high    
Version: 4.1.1CC: bugs, mgoldboi, michal.skrivanek, vshypygu
Target Milestone: ovirt-4.1.1Flags: rule-engine: ovirt-4.1+
mgoldboi: exception+
rule-engine: planning_ack+
rule-engine: devel_ack+
mavital: testing_ack+
Target Release: 4.1.1.5   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Engine 4.1 adds new VM-like entities property - max memory. Rest api scripts creating VM that were designed for engine 4.0 may customize a VM memory. If such script was executed against engine 4.1 and specified custom memory was larger than max memory in template / instance type used then vm creation failed - max memory was lower than memory. Now if memory is customized and max memory is not, then max memory is automatically set to 4 * memory size. UI uses similar approach. User can still explicitly specify max memory.
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-04-21 09:45:47 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 jniederm 2017-03-09 15:41:33 UTC
Description of problem:
If a VM is created using REST api and 
* max memory is not specified
* and memory is specified larger than max memory in the template
then vm creation fails. This breaks backward compatibility of engine 4.1 with 4.0.

Automatically increase max memory if memory was specified and max memory was omitted in the rest request.

Comment 1 Vladimir 2017-03-22 14:12:50 UTC
Verified on 4.1.1.5-0.1.el7

1. Created VM via REST API script without max_memory specified - max_memory was updated to 4 x memory
2. Updated every instance type memory value via REST API - max_memory was updated to 4 x memory

Comment 2 Israel Pinto 2017-03-22 14:15:14 UTC
(In reply to Vladimir from comment #1)
> Verified on 4.1.1.5-0.1.el7
> 
> 1. Created VM via REST API script without max_memory specified - max_memory
> was updated to 4 x memory
> 2. Updated every instance type memory value via REST API - max_memory was
> updated to 4 x memory

Verify base on this check.

Comment 3 Vladimir 2017-03-22 14:55:35 UTC
(In reply to Vladimir from comment #1)
> Verified on 4.1.1.5-0.1.el7
> 
> 1. Created VM via REST API script without max_memory specified - max_memory
> was updated to 4 x memory
> 2. Updated every instance type memory value via REST API - max_memory was
> updated to 4 x memory

Sorry, my mistake it doesn't work for instance types, updating instance types still produces 409 error: Memory size (10240MB) cannot exceed maximum memory size (2048MB)