Hi Sean,

Thanks for your answer and confirming it is something not optimal that could be improved without too much pain... Even if we have to leave with it in the short term if I understood correctly.

Best regards,

Michel
Sent from my mobile

Le 6 juin 2025 18:07:42 Sean Mooney <smooney@redhat.com> a écrit :

On 06/06/2025 15:12, Michel Jouvin wrote:
Hi Thomas,

Thanks for your answer. We identified that it was the documented way 
to do it, my question was wether there was a one-line alternative. But 
I managed to find 
https://docs.openstack.org/mitaka/config-reference/config-format.html 
which is pretty old (does not seem to exist under latest) but is clear 
that a multi-valued parameter is different from a list in OpenStack 
and must be defined as a repeated paramter in the config file. So I'm 
afraid there is no one-line alternative..


so yes this is a know issue

the pci alise si defiend as a multi-valued

https://docs.openstack.org/nova/latest/configuration/config.html#pci.alias

a long time ago when 
https://docs.openstack.org/nova/latest/configuration/config.html#pci.device_spec

was stilll called pci_passthrough_whitelist

we actully added suport for definign it as a json list on one line


device_spec = [{"product_id":"0001", "vendor_id":"8086"},
                {"product_id":"0002", "vendor_id":"8086"}]


both the aliias and dev_secect value need to be valid json.

it would not neessiarly be a lot of work to correct this gap and just supprot a list of json obejct for the alias as well
we  just never got around to it.

there is no technial reason not to do that, its just that no one has wirttign the patch to do it.

this is a somewhat trivial feature to add and i think it woudl fit in the scope of a specless blueprint

i know it was intentionally not done when i twas doen for the pci_passthrough_whitelist but beyond limiting scope i dont recall
the reason why both were not updated. so its not a bug but it is a painpoint for anyone who tryes to treat oslo.config files as ini files
they are not and ini parser dont supprot multi-value filed


Michel

Le 06/06/2025 à 15:33, Thomas Goirand a écrit :
On 6/6/25 13:08, Michel Jouvin wrote:
Hi,

We need to support several GPU models in our Nova configuration. 
This normally requires to add multiple `alias` entries (lines) in 
the [pci] section of nova.conf. Unfortunately for us, it complicates 
a lot the generation of nova.conf by our system configuration 
management tool (where the section is represented by a dict/hash, 
meaning that there is only 1 possible entry for 'alias'). Before 
trying to hack our tool, we were wondering if there is a way to put 
the different values as a list for a single 'alias' line and what 
should be the separator or syntax ?

I was not able to identify a generic description of the syntax for 
multivalued parameters, if there is a generic rule. I already found 
this limitation (but we could live with it) for Keystone 
[federation]trusted_dashboard for example...

Thanks in advance for any hint. Best regards,

Michel


As much as I know, you *must* define multiple times the alias 
directive. For example, in your nova-scheduler / nova-api / 
nova-conductor nodes (I believe it should be in your scheduler nodes, 
not sure if api and conductor needs that...) you must have something 
like this:

alias={"vendor_id":"10de","product_id":"25b6","name":"nvidia-a2","device_type":"type-PF"} 


alias={"vendor_id":"10de","product_id":"27b8","name":"nvidia-l4","device_type":"type-PF"} 


to define aliases for Nvidia A2 and L4. This should match what you 
have it compute nodes, that may have the same alias directive.

I hope this helps,
Cheers,

Thomas Goirand (zigo)