On Thu, 2024-04-25 at 16:32 +0200, Eugen Block wrote:
Hi,
I'm playing around with host aggregates and the aggregate_instance_extra_specs for flavors. I successfully created a host aggregate, it allows me to schedule instances with a specific flavor on that aggregate only. But is there a way to prevent other VMs from starting on that aggregate (which were launched with different flavors)?
The only thing coming to mind is to put that compute node(s) into a different availbility zone. Since the default is "nova", this would prevent anything else to start on that hypervisor. Is there anything I missed with aggregates? Any pointers are appreciated! you could use AZ but that si not what its for. even with an az you would still need to use one of the filters above or write your own to do the enforcemnt
there are a few ways depending on exactly what you want to do and if you want to write your own filter or not the first way to do this is via https://docs.openstack.org/nova/latest/reference/isolate-aggregates.html if you use isolating aggreates in placment you first have to tag each of the host in that aggreate with a trait then you configure that trait as a required trait in the host agreate metadata finally you create a flavor that request that required trait. the easies way to tag the compute nodes with that custom trait it to use provider.yaml https://docs.openstack.org/nova/latest/admin/managing-resource-providers.htm... but you can also do ti via the rest api this will enforce the isolation in placment instead of nova and is the most scalable solution you can use the https://docs.openstack.org/nova/latest/admin/scheduling.html#aggregateinstan... filter to do this to do this but its much slower then using placemnt the next approch which is the one i would recomend is to use the AggregateTypeAffinityFilter https://docs.openstack.org/nova/latest/admin/scheduling.html#aggregatetypeaf... this is the older way to do that and was designed for this exact usecase dont be fooled by the name instance_type is what flavors used to be called. the AggregateTypeAffinityFilter allwo you to create a host aggrate and then spcify a comma seperated list of flavors that are allowed the main downside is that thre is a change that if the placement result set is set too low (default is 1000 allcoation candiates) on a large cloud you might not get an allcoation candiate for one of the host in that aggreate. if you have less then 1000 compute nodes that not na isssue. that is what i ment by writing code. if the exsting filters do not work you can write one out of tree for your own deployment but i belive the AggregateTypeAffinityFilter is what you are loooking for.
Thanks! Eugen