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:
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]
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.
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?
Created attachment 1212644 [details] Attach1
Created attachment 1212645 [details] attach2
Created attachment 1212646 [details] png
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.
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.
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.
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.
https://github.com/ManageIQ/manageiq/pull/12450
Adam - Can you please confirm the patch for 3.2.
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.
Customer confirmed the hotfix worked
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(+)
was fixed in latest 5.7.0.*
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