Bug 1397649

Summary: Beaker randomly picks OpenStack flavors that are larger than necessary
Product: [Retired] Beaker Reporter: Dan Callaghan <dcallagh>
Component: generalAssignee: Hui Wang <huiwang>
Status: CLOSED CURRENTRELEASE QA Contact: tools-bugs <tools-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 23CC: dcallagh, huiwang, mjia, rjoost
Target Milestone: 24.0Keywords: EasyFix, Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-02-21 18:48:36 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 Dan Callaghan 2016-11-23 04:42:49 UTC
When Beaker is dynamically creating an OpenStack instance to run a recipe, it's supposed to pick the "cheapest" flavor which meets the recipe's host requirements. We approximate "cheapest" by sorting flavors in order of least to greatest RAM, and then picking the first applicable one.

However when Beaker applies host requirements in needproperty.xml filter_openstack_flavor() methods, some methods are using set() which means the ordering of the passed-in list is discarded. As a result the sorting has no effect, Beaker effectively picks any random flavor meeting the host requirements, not the one with the least RAM.

Comment 1 Hui Wang 2016-12-12 08:42:26 UTC
https://gerrit.beaker-project.org/#/c/5491/

Comment 3 Hui Wang 2016-12-22 06:02:43 UTC
Verified this issue.
The result is PASS.
Version Beaker 24.0.git.227.68bc3de 

Details:

Submit a job that has no memory host requirement.
It will take a instance with 1G memory(the cheapest one) to install in openstack.

Comment 4 Dan Callaghan 2017-02-21 18:48:36 UTC
Beaker 24.0 has been released.