What you are looking for is the AggregateInstanceExtraSpecsFilter. Simply add some metadata to an aggregate, eg:
compute_standard: "True"
and then add extra specs to the flavor you want to map to that aggregate like:
"aggregate_instance_extra_specs:compute_standard": "True"
see:
From: Ken D'Ambrosio <ken@jots.org>
Sent: 28 March 2024 10:29
To: Openstack Discuss <openstack-discuss@lists.openstack.org>
Subject: Nova filter based on VM metadata?
CAUTION: This email originates from outside THG
Hey, all. I'm looking for a way to to filter to a particular aggregate
based on arbitrary VM metadata. (E.g., maybe FACTER facts from Puppet
that we pass to the VM as metadata.) Could someone point me toward
documentation that might outline how to accomplish that? As I see it,
there's really one thing I need to understand -- the rest I can probably
glean from extant filters: how (or if) a filter could access a given
VM's metadata from the API creation request (if that's even possible).
Thanks!
-Ken