Bug 1425068
Summary: | Provisioning against amazon fail because of unset flavor variable in best_fit_amazon stock placement method | ||
---|---|---|---|
Product: | Red Hat CloudForms Management Engine | Reporter: | Felix Dewaleyne <fdewaley> |
Component: | Provisioning | Assignee: | Patrik Kománek <pkomanek> |
Status: | CLOSED ERRATA | QA Contact: | Leo Khomenko <lkhomenk> |
Severity: | urgent | Docs Contact: | |
Priority: | medium | ||
Version: | 5.6.0 | CC: | cpelland, fdewaley, gmccullo, jhardy, lkhomenk, obarenbo, pkomanek, simaishi, tfitzger |
Target Milestone: | GA | ||
Target Release: | 5.8.0 | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | |||
Fixed In Version: | 5.8.0.6 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2017-05-31 14:35:31 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Felix Dewaleyne
2017-02-20 13:48:29 UTC
It is not a typo, but a minor difference in the way Rails finders work. The "find" method will raise an error if the object cannot be found. However, changing this to "find_by_id" will return a nil object if the object is not found. The last debugging line is setup to handle a nil flavor by using "flavor.try(:name)". I would suggest changing the line to the following and we will get the method updated as well. flavor = $evm.vmdb('flavor').find_by(:id => instance_id) (In reply to Greg McCullough from comment #3) > It is not a typo, but a minor difference in the way Rails finders work. The > "find" method will raise an error if the object cannot be found. However, > changing this to "find_by_id" will return a nil object if the object is not > found. > > The last debugging line is setup to handle a nil flavor by using > "flavor.try(:name)". > > I would suggest changing the line to the following and we will get the > method updated as well. > > flavor = $evm.vmdb('flavor').find_by(:id => instance_id) I recommended that action but it looks like the same error is produced at checkprovisioned (error in placement). I'll wait for more logs to comment further... Hi Felix, The case message from Feb17 states that the problem occurs with straight VM provisioning. ".... It has also been stated already in this issue that this problem appears also when provisioning is attempted using automatic placement while not using service catalog but instances -> lifecycle -> provision ... which does not use preconfiguredialog at all. Both problems surface when automatic placement is attempted, as something there goes wrong, but it's not that instance_type (which in Amazon EC2 *is* the flavor) hasn't been provided....." Lets take the Service Provision complexity out of play here and ask the customer to do a VM provision using automatic placement and send us the automation.log and evm.logs showing the error. Is there something new in the customer environment? Did they just upgrade? Did this ever work properly? Thanks, Tina Hi Felix, The failing method is in the cloudforms_essentials domain. The cloudforms essentials repo does not contain that method. Can you ask the customer for all of the Automate domains? Thanks, Tina (In reply to Tina Fitzgerald from comment #12) > Hi Felix, > > The failing method is in the cloudforms_essentials domain. > The cloudforms essentials repo does not contain that method. > > Can you ask the customer for all of the Automate domains? > > Thanks, > Tina if you look up, we did the changes that were recommended in this very same bz to the method to progress. see https://bugzilla.redhat.com/show_bug.cgi?id=1425068#c3 I'll collect an automate export if you want but the customer confirms he hasn't done any other change to the method. the method best_fit_amazon definitely is included in the manageIQ domain. the method is /ManageIQ/Cloud/VM/Provisioning/Placement/best_fit_amazon Felix - Two things: 1) There is a typo in the method that was updated. Line 46 of /CloudForms_Essentials/Cloud/VM/Provisioning/Placement/best_fit_amazon is: flavor = $evm.vmdb('flavor').find_by(:id=>instance_id)* should be: flavor = $evm.vmdb('flavor').find_by(:id=>instance_id) (Note: Removed the "*" from the end of the line) 2) I would highly recommend NOT copying methods from the based ManageIQ domain to the CloudForms_Essentials domain. They should have copied this to their own domain or possibly a new domain. It is very confusing at first but easy to verify that this method did not come from CloudForms_Essentials. Please have them edit their custom best_fit_amazon method and fix the typo noted above and retest. (In reply to Greg McCullough from comment #15) > Felix - Two things: > > 1) There is a typo in the method that was updated. > > Line 46 of > /CloudForms_Essentials/Cloud/VM/Provisioning/Placement/best_fit_amazon is: > flavor = $evm.vmdb('flavor').find_by(:id=>instance_id)* > should be: > flavor = $evm.vmdb('flavor').find_by(:id=>instance_id) > > (Note: Removed the "*" from the end of the line) > > > 2) I would highly recommend NOT copying methods from the based ManageIQ > domain to the CloudForms_Essentials domain. They should have copied this to > their own domain or possibly a new domain. It is very confusing at first > but easy to verify that this method did not come from CloudForms_Essentials. > > > Please have them edit their custom best_fit_amazon method and fix the typo > noted above and retest. ack, passed. Sorry for missing the * Felix - Can this issue be dropped to a lower severity? Patrik - We should still make the change mentioned in https://bugzilla.redhat.com/show_bug.cgi?id=1425068#c3. This means updating the best_fit_amazon method changing the flavor lookup to use this updated syntax: flavor = $evm.vmdb('flavor').find_by(:id => instance_id) (In reply to Greg McCullough from comment #17) > Felix - Can this issue be dropped to a lower severity? > > Patrik - We should still make the change mentioned in > https://bugzilla.redhat.com/show_bug.cgi?id=1425068#c3. > > This means updating the best_fit_amazon method changing the flavor lookup to > use this updated syntax: > > flavor = $evm.vmdb('flavor').find_by(:id => instance_id) working on getting a lower severity. The case is getting there. Moving to POST now that https://github.com/ManageIQ/manageiq-content/pull/63 has been merged. verified on 5.8.0.7 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 |