Bug 1384122 - Setting memory_reserve lower than vm_memory failed
Summary: Setting memory_reserve lower than vm_memory failed
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Provisioning
Version: 5.4.0
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: GA
: 5.8.0
Assignee: Adam Grare
QA Contact: Leo Khomenko
URL:
Whiteboard: vsphere:provision
Depends On:
Blocks: 1496597
TreeView+ depends on / blocked
 
Reported: 2016-10-12 15:18 UTC by Saif Ali
Modified: 2021-06-10 11:35 UTC (History)
5 users (show)

Fixed In Version: 5.8.0.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1496597 (view as bug list)
Environment:
Last Closed: 2017-05-31 14:22:25 UTC
Category: ---
Cloudforms Team: VMware
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
evm_current logs (7.88 MB, application/x-xz)
2016-10-12 15:18 UTC, Saif Ali
no flags Details
Attach1 (5.42 KB, text/plain)
2016-10-20 21:35 UTC, Saif Ali
no flags Details
attach2 (2.58 KB, text/plain)
2016-10-20 21:35 UTC, Saif Ali
no flags Details
png (16.33 KB, image/png)
2016-10-20 21:36 UTC, Saif Ali
no flags Details
Set MemoryReservationLockedToMax to false (182.80 KB, application/x-gzip)
2016-11-03 15:17 UTC, Adam Grare
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2017:1367 0 normal SHIPPED_LIVE Moderate: CFME 5.8.0 security, bug, and enhancement update 2017-05-31 18:16:03 UTC

Description Saif Ali 2016-10-12 15:18:18 UTC
Created attachment 1209654 [details]
evm_current logs

Description of problem:
Setting the provisioning option ':memory_reserve' in the vm provisioning automate state machine to any value lower than the ':vm_memory' in the pre provisioning state produces a  '[VimFault]: A specified parameter was not correct.' error in the post provisioning state.


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

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 2 Greg McCullough 2016-10-13 09:00:27 UTC
Adam - Can you take an initial look at this issue and work with Brandon if needed.

Found the following VIM error message in the evm.log:
[----] E, [2016-10-11T10:39:40.666939 #21687:f5fe88] ERROR -- : Q-task_id([miq_provision_10000000000340]) MIQ(MiqProvisionVmware#provision_error) [[VimFault]: A specified parameter was not correct. 
spec.memoryAllocation.reservation] encountered during phase [customize_destination]

Comment 3 Adam Grare 2016-10-13 15:49:00 UTC
I don't get that error with upstream/master, I deployed a VM with 1024MB RAM and 64MB reservation.  I'll see if I can reproduce with 5.4.5.2.

Comment 4 Adam Grare 2016-10-18 17:30:47 UTC
I tried reproducing with CFME 5.4.5.2 and a v5.5 vCenter and I still am able to successfully set a lower memory reservation than total memory (128MB/1024MB).

Can you collect a log bundle from the vc and get the rbvmomi code so I can compare that to what we run as part of provisioning?

Comment 5 Saif Ali 2016-10-20 21:35:02 UTC
Created attachment 1212644 [details]
Attach1

Comment 6 Saif Ali 2016-10-20 21:35:27 UTC
Created attachment 1212645 [details]
attach2

Comment 7 Saif Ali 2016-10-20 21:36:06 UTC
Created attachment 1212646 [details]
png

Comment 8 Adam Grare 2016-11-02 13:35:39 UTC
Hi Saif, thanks for the rbvmomi script.  Can you collect a log bundle from the VC?
I'm hoping to see some more information in the vc logs about why it failed to set it.

Comment 9 Adam Grare 2016-11-02 16:33:54 UTC
Thanks for the logs Saif, clearing needinfo.

I found the reconfigure request in the logs and see an interesting error:
2016-10-20T19:50:35.309Z [7F90FA850700 info 'vmprovisioning' opID=2fe61944] Invalid memory reservation spec 0 while locked

I see this for every failed reconfigure request that resulted in the invalid parameter.

I'll try to track down where this is coming from, but an initial google search has turned up nothing.

Comment 10 Adam Grare 2016-11-03 13:10:25 UTC
From that error in the log and the customer's RbVmomi script disabling MemoryReservationLockedToMax I'm assuming that VMs are having their memory reservation locked by default (we leave the value unset).

On my VC if I set memoryReservationLockedToMax to true and also set a memory_reservation less that total guest memory the reserve just gets overridden by the locked property and there is no error so this must be some configuration/version nuance of the VC the customer is running.

I'll prepare a test patch to see if explicitly disabling memoryReservationLockedToMax fixes the customer's issue.

Comment 11 Adam Grare 2016-11-03 15:17:26 UTC
Created attachment 1217053 [details]
Set MemoryReservationLockedToMax to false

scp 54z_vm_memory_reservation_hotfix.tar.gz to /var/www/miq (NOT /var/www/miq/vmdb)

tar tfz 54z_vm_memory_reservation_hotfix.tar.gz 
lib/VMwareWebService/wsdl41/methods/VirtualMachineConfigInfo.yml
lib/VMwareWebService/wsdl41/methods/VirtualMachineConfigSpec.yml
lib/VMwareWebService/wsdl41/vimws25MappingRegistry.rb
vmdb/app/models/miq_provision_vmware/configuration/container.rb

This adds the memoryReservationLockedToMax to VirtualMachineConfigInfo and VirtualMachineConfigSpec, and explicitly sets it to false if the requested memory reservation is less than the total vm memory.

Comment 14 Saif Ali 2016-11-07 15:27:34 UTC
Adam - Can you please confirm the patch for 3.2.

Comment 15 Adam Grare 2016-11-07 15:51:05 UTC
Saif, I created the patch against the 5.4.z branch so yes 3.2.  The 41 in wsdl41 is the vSphere version not the CF version.

Comment 16 Adam Grare 2016-11-11 13:01:45 UTC
Customer confirmed the hotfix worked

Comment 17 CFME Bot 2016-11-30 15:21:06 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/3872563265a3183923ee5651b5d32ea0aa4d96f2

commit 3872563265a3183923ee5651b5d32ea0aa4d96f2
Author:     Adam Grare <agrare>
AuthorDate: Wed Nov 2 16:26:08 2016 -0400
Commit:     Adam Grare <agrare>
CommitDate: Tue Nov 29 13:35:17 2016 -0500

    Set memoryReservationLockedToMax in vm clone
    
    Set memoryReservationLockedToMax when customizing a cloned VM on
    vSphere 5.0 and newer, otherwise setting the memory reservation
    to less than the current memory can fail.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1384122

 .../providers/vmware/infra_manager/provision/configuration/container.rb | 2 ++
 1 file changed, 2 insertions(+)

Comment 18 Leo Khomenko 2017-02-06 17:17:21 UTC
was fixed in latest 5.7.0.*

Comment 20 errata-xmlrpc 2017-05-31 14:22:25 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://access.redhat.com/errata/RHSA-2017:1367


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