On Wed, May 8, 2019 at 5:58 PM, Matt Riedemann <mriedemos@gmail.com> wrote:
On 5/7/2019 2:19 AM, Balázs Gibizer wrote:
3) The request pre-filters [7] run before the placement a_c query is generated. But these today changes the fields of the RequestSpec (e.g. requested_destination) that would mean the regeneration of RequestSpec.requested_resources would be needed. This probably solvable by changing the pre-filters to work directly on RequestSpec.requested_resources after we solved all the other issues.
Yeah this is something I ran into while hacking on the routed networks aggregate stuff [1]. I added information to the RequestSpec so I could use it in a pre-filter (required aggregates) but I can't add that to the requested_resources in the RequestSpec without resources (and in the non-bw port case there is no RequestSpec.requested_resources yet), so what I did was hack the unnumbered RequestGroup after the pre-filters and after the RequestSpec was processed by resources_from_request_spec, but before the code that makes the GET /a_c call. It's definitely ugly and I'm not even sure it works yet (would need functional testing).
What I've wondered is if there is a way we could merge request groups in resources_from_request_spec so if a pre-filter added an unnumbered RequestGroup to the RequestSpec (via the requestd_resources attribute) that resources_from_request_spec would then merge in the flavor information. That's what I initially tried with the multiattach required traits patch [2] but the groups weren't merged for whatever reason and GET /a_c failed because I had a group with a required trait but no resources.
If we only need to merge once then it feels doable. We just add new things to the pre-existing unnumbered group from the flavor and image. But if we ever need to update what we already merged into the unnumbered group then we would need access to the old flavor / image to first subtract them from the unnumbered group and then add the requests from the new flavor / image to the unnumbered group. The other way would be to store the extra traits separately as well in the RequestSpec and only generate the unnumbered group from all the input when needed. Cheers, gibi
[1] https://review.opendev.org/#/c/656885/3/nova/scheduler/manager.py [2] https://review.opendev.org/#/c/645316/
--
Thanks,
Matt