Nova filter based on VM metadata?
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
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
Apologies, accidentally sent that before I added the documentation: https://docs.openstack.org/nova/latest/admin/aggregates.html#example-specify... ________________________________ From: Danny Webb <Danny.Webb@thg.com> Sent: 28 March 2024 11:55 To: Ken D'Ambrosio <ken@jots.org>; Openstack Discuss <openstack-discuss@lists.openstack.org> Subject: Re: Nova filter based on VM metadata? 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
i dont think that is actully what they are requesting nova supports seting metadata on an instance when you created it and i sound like the OP is asking is there an existing filter that looks at that per instance metadata which could be mapped to host aggrates. the answer ot that is no. we have been avoiding adding more Aggregate* type filters since they tend to be quite slow but a new AggregateInstanceMetadata filter could be created either out of tree as this is a plugable endpoint in the schduler or proposed upstream as an intree filter https://docs.openstack.org/nova/latest/admin/scheduling.html#custom-schedule... im not sure how other would feel about that, currently i do not belive the instance metadata is part of the RequestSpec object and terefor is not avoialable to the existing filters to use. we would have to confirm that. we have a related concept called Scheduler Hints https://docs.openstack.org/nova/latest/reference/scheduler-hints-vs-flavor-e... those are freeform and can be used with filters like the JsonFilter but that does not have aggreate awareness either perhaps one way to avoid an object change would be to add a aggreateHints filter that used schduler hits to match against host aggregates or host aggregate metadata i think the scheduler hint approch is more accpable upstream then instnace metadata one of the problems with instance metadata is i can change at any point meaning that an instance may become invlid for the host its currently on if it is changed after the fact. that could lead to operatoions like rebuild failing. scheduler hints are fixed for the lifetime of the vm and aovid that problem as a result. the closest you can get today without any code changes is annotating the instance via the flaovr or image rather then per instnace. regards sean. On Thu, 2024-03-28 at 11:56 +0000, Danny Webb wrote:
Apologies, accidentally sent that before I added the documentation:
https://docs.openstack.org/nova/latest/admin/aggregates.html#example-specify... ________________________________ From: Danny Webb <Danny.Webb@thg.com> Sent: 28 March 2024 11:55 To: Ken D'Ambrosio <ken@jots.org>; Openstack Discuss <openstack-discuss@lists.openstack.org> Subject: Re: Nova filter based on VM metadata?
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
participants (3)
-
Danny Webb
-
Ken D'Ambrosio
-
smooney@redhat.com