Ask Your Question
0

Packstack pci passthrough for allinone-answers.cfg

asked 2019-08-02 15:44:53 -0500

shmitch gravatar image

I'm trying to install an OpenStack (Queens) Controller and two Compute nodes configured for PCI Passthrough. The OS is CentOS 7.6. Based on the documentation I've found, the two "allinone-answers.cfg" commands I should be using are:

CONFIG_NOVA_PCI_ALIAS={"vendor_id":"8086", "product_id":"1521", "device_type":"type-PCI", "name":"GbE_eno2"} CONFIG_NOVA_PCI_PASSTHROUGH_WHITELIST={"address":"01:00.1"}

(I obtained the values by using "lspci -nn | grep 'Network Connection'" on the Compute nodes. They are for an Intel i350 4-port GbE card.)

Regardless of the variation used (with or without spaces, quotes, curved brackets, etc.) they still generate a similar version of this error: “Evaluation Error: Error while evaluating a Function Call, Syntax error: {"vendor_id:8086", "product_id:1521", "device_type:type-PCI", "name:GbE_eno2"} is not an Array or JSON encoded String at /var/tmp/packstack/182ec9b79e4e44378e8bc7ebfde8c208/modules/nova/manifests/compute/pci.pp:24:25 on node cmpt-1.netscout.com”

Is there an additional command(s) I should be using? Is there a nuance about the two commands that I'm missing?

edit retag flag offensive close merge delete

Comments

I don't know the syntax, but if packstack wants an array, try

[・・・]

instead of

{・・・}

Plus, you may have to quote the whole thing.

Bernd Bausch gravatar imageBernd Bausch ( 2019-08-02 18:42:55 -0500 )edit

Bernd,

Thanks for the comment. I gave it a shot, but I got the same results.

Is it possible that the Packstack answer file commands aren't supposed to be interpreted as "an Array or JSON encoded"?

shmitch gravatar imageshmitch ( 2019-08-03 13:35:23 -0500 )edit

The JSON Formatter and Validator URL (https://jsonformatter.curiousconcept.com/ (https://jsonformatter.curiousconcept....)) seems to be indicating that the error is with "CONFIG_NOVA_PCI_ALIAS" ("Expecting object or array, not string"), not with "{"vendor_id":"8086", "product_id":"1521", "device_type":"type-PCI", "name":"GbE_eno2"}".

shmitch gravatar imageshmitch ( 2019-08-03 13:46:16 -0500 )edit

According to https://opendev.org/x/packstack/src/b..., it should not be a set, nor a list, but a list of sets. E.g.

[{"vendor_id":"1234", "product_id":"5678", "name":"default"}, {...}]

If you wonder how I found it: http://codesearch.openstack.org.

Bernd Bausch gravatar imageBernd Bausch ( 2019-08-03 17:44:25 -0500 )edit

1 answer

Sort by » oldest newest most voted
0

answered 2019-08-20 14:52:20 -0500

shmitch gravatar image

The problem was a mis-match between two components of the configuration. According to "https://docs.openstack.org/nova/queens/admin/pci-passthrough.html" there are several steps to configuring PCI-Passthrough. (1) One of those steps is to "Configure a flavor" on the Controller node. The website's example is '# openstack flavor set m1.large --property "pci_passthrough:alias"="a1:2"' where the ":2" means two PCI devices. In other words, ONLY those Compute nodes that have two matching PCI devices will be able to use this flavor. (2) The other of those two mis-matched steps is to "Configure PCI devices" on the Compute node, or more precisely, to configure each Compute node's whitelist. The number of entries in each whitelist MUST match the number of PCI devices specified in its corresponding flavor defined in the "Configure a flavor" step. The website's example for a PCI device's address is 'passthrough_whitelist = { "address": "0000:41:00.0" }'. Notice that the flavor example specifies two PCI devices, but the whitelist example only specifies one address. That was the problem. The syntax to specify two whitelisted addresses (to match the flavor's requested number of PCI devices) is 'passthrough_whitelist = { "address": "0000:41:00.0" }, { "address": "0000:41:00.1"}]'. To specify only one, use the format of the whitelist example and change the flavor command from ":2" to ":1".

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2019-08-02 15:44:53 -0500

Seen: 13 times

Last updated: Aug 20