[openstack-helm] How to specify nova override for multiple pci alias

Eric Fried openstack at fried.cc
Wed Feb 6 21:34:50 UTC 2019



On 2/6/19 3:24 PM, Gauld, James wrote:
> Eric,
> I had assistance from portdirect in IRC who provided the 'multistring' solution to this problem.
> This solution does not require a change on nova side, or a change to nova chart.  I should have replied a day ago.
> 
> The nova solution WIP you coded would work. It requires slight documentation change to remove the one-line-per-entry input limitation.
> 
> The following helm multistring method works for OSLO.conf compatible with oslo_config.MultiStringOpt().
> I get correct nova.conf output if I individually JSON encode each string in the list of values (eg, for PCI alias, PCI passthrough whitelist).
> 
> Here is sample YAML for multistring :
> conf:
>   nova:
>     pci:
>       alias:
>         type: multistring
>         values:
>           - '{"vendor_id": "8086", "product_id": "0435", "name": "qat-dh895xcc-pf"}'
>           - '{"class_id": "030000", "name": "gpu"}'
> 
> Here is the resultant nova.conf :
> [pci]
> alias = {"vendor_id": "8086", "product_id": "0435", "name": "qat-dh895xcc-pf"}
> alias = {"class_id": "030000", "name": "gpu"}
> 
> This solution does not require a change on nova side, or a change to nova helm chart.
> IMO, I did not find the multistring example obvious when I was looking for documentation.
> 
> -Jim Gauld
> 
> -----Original Message-----
> From: Eric Fried [mailto:openstack at fried.cc] 
> Sent: February-06-19 10:45 AM
> To: openstack-discuss at lists.openstack.org
> Subject: Re: [openstack-helm] How to specify nova override for multiple pci alias
> 
> Folks-
> 
> On 2/6/19 4:13 AM, Jean-Philippe Evrard wrote:
>> On Wed, 2019-01-30 at 15:40 +0000, Gauld, James wrote:
>>> How can I specify a helm override to configure nova PCI alias when 
>>> there are multiple aliases?
>>> I haven't been able to come up with a YAML compliant specification 
>>> for this.
>>>
>>> Are there other alternatives to be able to specify this as an 
>>> override? I assume that a nova Chart change would be required to 
>>> support this custom one-alias-entry-per-line formatting.
>>>
>>> Any insights on how to achieve this in helm are welcomed.
> 
> <snip>
> 
>>> The following nova configuration format is desired, but not as yet 
>>> supported by nova:
>>> [pci]
>>> alias = [{dict 1}, {dict 2}]
>>>
>>> The following snippet of YAML works for PCI passthrough_whitelist, 
>>> where the value encoded is a JSON string:
>>>
>>> conf:
>>>   nova:
>>>   overrides:
>>>     nova_compute:
>>>       hosts:
>>>       - conf:
>>>           nova:
>>>             pci:
>>>               passthrough_whitelist: '[{"class_id": "030000",
>>> "address": "0000:00:02.0"}]'
> 
> <snip>
> 
> I played around with the code as it stands, and I agree there doesn't seem to be a way around having to specify the alias key multiple times to get multiple aliases. Lacking some fancy way to make YAML understand a dict with repeated keys ((how) do you handle HTTP headers?), I've hacked up a solution on the nova side [1] which should allow you to do what you've described above. Do you have a way to pull it down and try it?
> 
> (Caveat: I put this up as a proof of concept, but it (or anything that messes with the existing pci passthrough mechanisms) may not be a mergeable solution.)
> 
> -efried
> 
> [1] https://review.openstack.org/#/c/635191/
> 



More information about the openstack-discuss mailing list