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.
Created attachment 1381404 [details] CFME_Service_Requests.png See Request 5
Created attachment 1381405 [details] evm.log
Created attachment 1381406 [details] automation.log
Created attachment 1381407 [details] rhevm.log
It doesn't seem to me as a blocker moving to 5.9.1
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?
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
https://github.com/ManageIQ/manageiq-providers-ovirt/pull/224
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(-)
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)
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.