[openstack-helm] How to specify nova override for multiple pci alias
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. Background: There is a limitation in the nova.conf specification of PCI alias in that it does not allow multiple PCI aliases as a list. The code says "Supports multiple aliases by repeating the option (not by specifying a list value)". Basically nova currently only supports one-alias-entry-per-line format. Ideally I would specify global pci alias in a format similar to what can be achieved with PCI passthrough_whitelist, which can takes JSON list of dictionaries. This is what I am trying to specify in nova.conf (i.e., for nova-api-osapi and nova-compute): [pci] alias = {dict 1} alias = {dict 2} . . . 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"}]' Jim Gauld
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.
Background: There is a limitation in the nova.conf specification of PCI alias in that it does not allow multiple PCI aliases as a list. The code says "Supports multiple aliases by repeating the option (not by specifying a list value)". Basically nova currently only supports one-alias- entry-per-line format.
Ideally I would specify global pci alias in a format similar to what can be achieved with PCI passthrough_whitelist, which can takes JSON list of dictionaries.
This is what I am trying to specify in nova.conf (i.e., for nova-api- osapi and nova-compute): [pci] alias = {dict 1} alias = {dict 2} . . .
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"}]'
Jim Gauld
Could the '?' symbol (for complex keys) help here? I don't know, but I would love to see an answer, and I can't verify that now. Regards, JP
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/
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@fried.cc] Sent: February-06-19 10:45 AM To: openstack-discuss@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/
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@fried.cc] Sent: February-06-19 10:45 AM To: openstack-discuss@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
James- 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.
Ah, I'm glad you got it figured out. I'll abandon my change.
IMO, I did not find the multistring example obvious when I was looking for documentation.
I don't know if you're referring to the nova docs or something else, but I couldn't agree more. The syntax of both this and passthrough_whitelist is very confusing. We're working to come up with nicer ways to talk about device passthrough. It's been a multi-release effort, but we're getting closer all the time. Stay tuned. -efried
participants (3)
-
Eric Fried
-
Gauld, James
-
Jean-Philippe Evrard