[nova][ptg] Summary: Implicit trait-based filters

Matt Riedemann mriedemos at gmail.com
Wed May 8 15:58:30 UTC 2019


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.

[1] https://review.opendev.org/#/c/656885/3/nova/scheduler/manager.py
[2] https://review.opendev.org/#/c/645316/

-- 

Thanks,

Matt



More information about the openstack-discuss mailing list