Bug 1451682 - PciInvalidAlias Invalid PCI alias definition is not of type 'object'
Summary: PciInvalidAlias Invalid PCI alias definition is not of type 'object'
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: puppet-nova
Version: 10.0 (Newton)
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: z5
: 10.0 (Newton)
Assignee: Ollie Walsh
QA Contact: Joe H. Rahme
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-05-17 09:45 UTC by Sid Ahmed Sadouni
Modified: 2017-09-28 16:35 UTC (History)
19 users (show)

Fixed In Version: puppet-nova-9.6.0-1.el7ost
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-09-28 16:35:22 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
pci_alias_log_error (7.00 KB, text/plain)
2017-05-17 09:45 UTC, Sid Ahmed Sadouni
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Launchpad 1696955 0 None None None 2017-07-24 15:25:29 UTC
OpenStack gerrit 472611 0 'None' MERGED Fix invalid PCI alias definition 2020-08-03 13:26:13 UTC
OpenStack gerrit 494217 0 'None' MERGED Fix handling of nova pci MultiStrOpt params 2020-08-03 13:26:13 UTC
Red Hat Product Errata RHBA-2017:2825 0 normal SHIPPED_LIVE Red Hat OpenStack Platform 10 director Bug Fix Advisory 2017-09-28 20:33:35 UTC

Description Sid Ahmed Sadouni 2017-05-17 09:45:39 UTC
Created attachment 1279612 [details]
pci_alias_log_error

Hi,

We are facing an issue when we want to configure pci_alias through Director.

The template examples says :
https://github.com/openstack/puppet-nova/blob/master/manifests/api.pp#L77-L81
#[*pci_alias*]
#   (optional) Pci passthrough for controller:
#   Defaults to undef
#   Example
#   "[ {'vendor_id':'1234', 'product_id':'5678', 'name':'default'}, {...} ]"

In my env. file for parameters we set according to this :
ControllerExtraConfig:
  nova::api::pci_alias: '"[{ \"vendor_id\": \"1137\", \"product_id\": \"0043\", \"name\": \"nic_pf\"}]"'

This end on the node with this line in nova.conf :
pci_alias=[{ "vendor_id": "1137", "product_id": "0043", "name": "nic_pf"}]

Which seem correct according to the example above on the code.

BUT if we run a pci_passthrough instance using this config we get the following error message (find attached the complete log) :

777:2017-05-16 13:32:24.685 7607 ERROR nova.api.openstack.extensions Failed validating 'type' in schema:
778:2017-05-16 13:32:24.685 7607 ERROR nova.api.openstack.extensions     {'additionalProperties': False,
779:2017-05-16 13:32:24.685 7607 ERROR nova.api.openstack.extensions      'properties': {'capability_type': {'enum': ['pci'],
780:2017-05-16 13:32:24.685 7607 ERROR nova.api.openstack.extensions                                         'type': 'string'},
781:2017-05-16 13:32:24.685 7607 ERROR nova.api.openstack.extensions                     'device_type': {'enum': ['type-PCI',
782:2017-05-16 13:32:24.685 7607 ERROR nova.api.openstack.extensions                                              'type-PF',
783:2017-05-16 13:32:24.685 7607 ERROR nova.api.openstack.extensions                                              'type-VF'],
784:2017-05-16 13:32:24.685 7607 ERROR nova.api.openstack.extensions                                     'type': 'string'},
785:2017-05-16 13:32:24.685 7607 ERROR nova.api.openstack.extensions                     'name': {'maxLength': 256,
786:2017-05-16 13:32:24.685 7607 ERROR nova.api.openstack.extensions                              'minLength': 1,
787:2017-05-16 13:32:24.685 7607 ERROR nova.api.openstack.extensions                              'type': 'string'},
788:2017-05-16 13:32:24.685 7607 ERROR nova.api.openstack.extensions                     'product_id': {'pattern': '^([\\da-fA-F]{4})$',
789:2017-05-16 13:32:24.685 7607 ERROR nova.api.openstack.extensions                                    'type': 'string'},
790:2017-05-16 13:32:24.685 7607 ERROR nova.api.openstack.extensions                     'vendor_id': {'pattern': '^([\\da-fA-F]{4})$',
791:2017-05-16 13:32:24.685 7607 ERROR nova.api.openstack.extensions                                   'type': 'string'}},
792:2017-05-16 13:32:24.685 7607 ERROR nova.api.openstack.extensions      'required': ['name'],
793:2017-05-16 13:32:24.685 7607 ERROR nova.api.openstack.extensions      'type': 'object'}
794:2017-05-16 13:32:24.685 7607 ERROR nova.api.openstack.extensions
795:2017-05-16 13:32:24.685 7607 ERROR nova.api.openstack.extensions On instance:
796:2017-05-16 13:32:24.685 7607 ERROR nova.api.openstack.extensions     [{u'name': u'nic_pf', u'product_id': u'0043', u'vendor_id': u'1137'}]

798:2017-05-16 13:32:24.736 7607 INFO nova.api.openstack.wsgi [req-46fe1440-740f-4297-8dca-3057f1bfab50 ac6792dca2e3403ab6ce39ccbaf53c4d c6d5152354584c069a4798cc813f07aa - default default] HTTP exception thrown: Unexpected API Error. Please report this at http://bugs.launchpad.net/nova/ and attach the Nova API log if possible.

If we change the pci_alias syntax in nova.conf as below and following openstack documentation :
pci_alias: { "vendor_id": "1137", "product_id": "0043", "name": "nic_pf"}

We don't have this error anymore and the pci_passthrough instance boot successfully.

Ref : openstack documentation : https://docs.openstack.org/admin-guide/compute-pci-passthrough.html

the code  here https://github.com/openstack/puppet-nova/blob/master/manifests/api.pp#L535-L539 is done to manage multiple pci_alias.
That's why if we remove the [ ] in the parameters env file, we can't deploy ... and we also may need to configure multiple pci_alias with Director.

Comment 3 Ollie Walsh 2017-08-16 15:23:42 UTC
https://review.openstack.org/494217 is required to resolve this.

Also the parameter should no longer require complex quoting e.g

ControllerExtraConfig:
  nova::api::pci_alias:
    - vendor_id: "0000"
      product_id: "0000"
      name: "foo"
    - vendor_id: "FFFF"
      product_id: "FFFF"
      name: "bar"

Comment 8 Joe H. Rahme 2017-09-25 12:21:01 UTC
I have verified that giving this to the director overcloud deployment:

  parameter_defaults:
      ControllerExtraConfig:
          nova::api::pci_alias:
          -   name: nic_pf
              product_id: '0043'
              vendor_id: '1137'


has generated this in the nova.conf on the controller:

    [heat-admin@controller-0 ~]$ sudo grep -i pci /etc/nova/nova.conf
    pci_alias={"product_id":"0043","name":"nic_pf","vendor_id":"1137"}

Comment 10 errata-xmlrpc 2017-09-28 16:35:22 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:2825


Note You need to log in before you can comment on or make changes to this bug.