Bug 1534520 - [RHV] VM Reconfigure: Down VM Memory increase fail on cannot exceed maximum memory
Summary: [RHV] VM Reconfigure: Down VM Memory increase fail on cannot exceed maximum m...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Providers
Version: 5.9.0
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: GA
: 5.10.0
Assignee: Moti Asayag
QA Contact: Angelina Vasileva
URL:
Whiteboard: rhv:vm reconigure
Depends On:
Blocks: 1553384 1565358
TreeView+ depends on / blocked
 
Reported: 2018-01-15 12:22 UTC by Ilanit Stein
Modified: 2019-08-19 10:36 UTC (History)
8 users (show)

Fixed In Version: 5.10.0.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1553384 1565358 (view as bug list)
Environment:
Last Closed: 2019-02-11 14:05:16 UTC
Category: Bug
Cloudforms Team: RHEVM
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
CFME_Service_Requests.png (155.28 KB, image/png)
2018-01-15 12:23 UTC, Ilanit Stein
no flags Details
evm.log (2.56 MB, application/x-gzip)
2018-01-15 12:23 UTC, Ilanit Stein
no flags Details
automation.log (151.39 KB, application/x-gzip)
2018-01-15 12:24 UTC, Ilanit Stein
no flags Details
rhevm.log (298.03 KB, application/x-gzip)
2018-01-15 12:25 UTC, Ilanit Stein
no flags Details

Description Ilanit Stein 2018-01-15 12:22:08 UTC
Description of problem:
From CFME side, Memory Cold add fail, 
if the Maximum memory is smaller, than the value we try to set to:

"Error: Fault reason is "Operation Failed". Fault detail is "[Cannot edit VM. Memory size (3072MB) cannot exceed maximum memory size (2048MB).]". HTTP response code is 409."
(Request last message)
 
On RHV side: 
- For a Down VM:
VM edit to a value that is higher than the VM maximum memory - 
it will succeed, and automatically will set maximum value to memory new value*4
There is also this bug, that according to it, from RHV-4.1.1 via RESTapi memory increase will set maximum memory to memory*4: 
Bug 1430795 - Automatically increase max memory if necessary in REST

- For UP VM:
VM edit to a value that is higher than the VM maximum memory - 
it will fail on validation, that memory can't be set to a value higher than maximum memory.

Based on the above, it seems that memory increase for a Down VM,
done rom CFME side, should succeed, 
even if the maximum memory is set to a lower value.

Version-Release number of selected component (if applicable):
CFME-5.9.0.16
RHV-4.1.8

Additional info:
According to the following bug, fixed in RHV-4.1.1:
via REST api, memory increase will set maximum memory to memory*4 automatically: 
Bug 1430795 - Automatically increase max memory if necessary in REST

Also possible to add an RFE for adding CFME VM Max memory missing parameter, 
since ATM it is possible to change it only from the RHV side.

Comment 3 Ilanit Stein 2018-01-15 12:23:15 UTC
Created attachment 1381404 [details]
CFME_Service_Requests.png

See Request 5

Comment 4 Ilanit Stein 2018-01-15 12:23:53 UTC
Created attachment 1381405 [details]
evm.log

Comment 5 Ilanit Stein 2018-01-15 12:24:29 UTC
Created attachment 1381406 [details]
automation.log

Comment 6 Ilanit Stein 2018-01-15 12:25:28 UTC
Created attachment 1381407 [details]
rhevm.log

Comment 7 Martin Perina 2018-01-16 08:54:23 UTC
It doesn't seem to me as a blocker moving to 5.9.1

Comment 8 Jan Zmeskal 2018-02-26 11:28:19 UTC
I also noticed that the same behaviour can be seen on CFME 5.8.3.4.

Reproduction steps:
1. Provisiong a VM with memory 2GB and max memory 8GB
2. Try to reconfigure that VM to memory 10 GB

Result:
Error: Fault reason is "Operation Failed". Fault detail is "[Cannot edit VM. Memory size (10240MB) cannot exceed maximum memory size (8192MB).]". HTTP response code is 409.

Should a clone of this bug for 5.8 be created?

Comment 9 Martin Perina 2018-03-06 08:21:15 UTC
We don't have maximum memory available in CloudForms and maximum memory is set automatically only when VM is created as mentioned in BZ1430795, but no automatic changes are made when VM is updated. So we need to simulate the same behavior which exists in the webadmin:

1. Fetch actual VM from RHV to get current max memory
2. If new actual memory is higher than existing max memory, we need also to update max memory when updating VM in RHV using following algorithm:
    a. If actual memory is lesser than 1 TB, then set max memory to 4 * actual memory
    b. If actual memory equals or greater than 1TB, set max memory the same value as actual memory

Comment 11 CFME Bot 2018-03-08 12:32:49 UTC
New commit detected on ManageIQ/manageiq-providers-ovirt/master:

https://github.com/ManageIQ/manageiq-providers-ovirt/commit/42bfd8aef417935c99380c527bf6fa5852133adb
commit 42bfd8aef417935c99380c527bf6fa5852133adb
Author:     Moti Asayag <masayag>
AuthorDate: Thu Mar  8 05:18:21 2018 -0500
Commit:     Moti Asayag <masayag>
CommitDate: Thu Mar  8 05:18:21 2018 -0500

    Provide max memory on VM reconfigure

    Since ManageIQ doesn't support max memory, there is a need to provider a
    value for it when modifying the vm memory limit.

    The max memory will be calculated as follow:
    1. Fetch actual VM from RHV to get current max memory
    2. If new actual memory is higher than existing max memory, the max memory will
       be updated as well:
     a. If actual memory is lesser than 1 TB, then set max memory to 4 * actual memory
     b. If actual memory equals or greater than 1TB, set max memory the same value as
        actual memory

    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1534520

 app/models/manageiq/providers/redhat/infra_manager/ovirt_services/strategies/v4.rb | 37 +-
 spec/models/manageiq/providers/redhat/infra_manager/ovirt_services/strategies/v4_spec.rb | 66 +-
 2 files changed, 98 insertions(+), 5 deletions(-)

Comment 14 Jan Zmeskal 2018-09-17 10:59:33 UTC
Verified on: CFME 5.10.0.15

Verification steps:
1. Have a CFME appliance with RHV provider
2. Provision a VM from template. In Hardware tab, fill this in:
Memory (MB) == 2048
VM Limits -> Memory (MB) == 8192
After provision, such VM has there attributes on RHV:
Memory Size == 2048 MB
Maximum Memory == 8192 MB
3. Shut this VM down.
4. In CFME UI, go to your VM's detail page.
5. Click Configuration -> Reconfigure this VM.
6. Increase Memory to 10 GB and submit your reconfiguration request.
7. Wait for the request to be successfully finished.
8. Go to RHV webadmin UI and check that Memory Size == 10 GB for you VM.
9. SSH to your VM and check that the memory is actually 10 GB (e.g. using "free" command)

Comment 15 Ilanit Stein 2018-10-11 06:38:53 UTC
Verified also case: b. If actual memory equals or greater than 1TB, set max memory the same value as actual memory: 

For a RHV down VM with 4G and 8G Max memory, 
VM reconfigure, and set memory to 2T. 
The VM was updated to 2T memory, and 2T Max memory.


Note You need to log in before you can comment on or make changes to this bug.