PciInvalidAlias Invalid PCI alias definition is not of type 'object'

Bug #1696955 reported by Rajesh Tailor
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
puppet-nova
Fix Released
High
Rajesh Tailor

Bug Description

We are facing an issue when we want to configure pci_alias using TripleO.

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.

Rajesh Tailor (ratailor)
Changed in puppet-nova:
assignee: nobody → Rajesh Tailor (ratailor)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to puppet-nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/472611

Changed in puppet-nova:
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to puppet-nova (master)

Reviewed: https://review.openstack.org/472611
Committed: https://git.openstack.org/cgit/openstack/puppet-nova/commit/?id=9dde5a4108df2448bfd43010112d313f1a73395b
Submitter: Jenkins
Branch: master

commit 9dde5a4108df2448bfd43010112d313f1a73395b
Author: Rajesh Tailor <email address hidden>
Date: Fri Jun 9 15:02:14 2017 +0530

    Fix invalid PCI alias definition

    The PCI alias config type is changed in recent release from
    'oslo_config.ListOpt' to 'oslo_config.MultiStrOpt'.

    Here nova expects a multi valued option instead of a list.

    Change-Id: Ie27dbbc510c73c685b239a9be4af2700a0eb42f0
    Closes-Bug: #1696955

Changed in puppet-nova:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to puppet-nova (stable/ocata)

Fix proposed to branch: stable/ocata
Review: https://review.openstack.org/475636

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to puppet-nova (stable/ocata)

Reviewed: https://review.openstack.org/475636
Committed: https://git.openstack.org/cgit/openstack/puppet-nova/commit/?id=1f4356c8b1b3fc3963df7768a32ecc46cfcfd31d
Submitter: Jenkins
Branch: stable/ocata

commit 1f4356c8b1b3fc3963df7768a32ecc46cfcfd31d
Author: Rajesh Tailor <email address hidden>
Date: Fri Jun 9 15:02:14 2017 +0530

    Fix invalid PCI alias definition

    The PCI alias config type is changed in recent release from
    'oslo_config.ListOpt' to 'oslo_config.MultiStrOpt'.

    Here nova expects a multi valued option instead of a list.

    Conflicts:
            manifests/api.pp

    Change-Id: Ie27dbbc510c73c685b239a9be4af2700a0eb42f0
    Closes-Bug: #1696955
    (cherry picked from commit 9dde5a4108df2448bfd43010112d313f1a73395b)

tags: added: in-stable-ocata
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to puppet-nova (stable/newton)

Fix proposed to branch: stable/newton
Review: https://review.openstack.org/477495

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to puppet-nova (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/481003

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to puppet-nova (master)

Reviewed: https://review.openstack.org/481003
Committed: https://git.openstack.org/cgit/openstack/puppet-nova/commit/?id=018c8a290065eb642ec0e436006117dfc66aa1ea
Submitter: Jenkins
Branch: master

commit 018c8a290065eb642ec0e436006117dfc66aa1ea
Author: Rajesh Tailor <email address hidden>
Date: Thu Jul 6 15:45:47 2017 +0530

    Fix pci config params name as mentioned in nova conf

    This change, modifies name of params, as mentioned in sample
    nova conf [1].
    The parameter name in PCI section should be `alias` and
    `passthrough_whitelist` instead of `pci_alias` and
    `pci_passthrough_whitelist`.

    [1] https://docs.openstack.org/nova/latest/sample_config.html

    Change-Id: Ia7d8c0c900b3cb05d809e62e5c203d183b357fce
    Related-Bug: #1696955

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to puppet-nova (stable/ocata)

Related fix proposed to branch: stable/ocata
Review: https://review.openstack.org/482033

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to puppet-nova (stable/newton)

Reviewed: https://review.openstack.org/477495
Committed: https://git.openstack.org/cgit/openstack/puppet-nova/commit/?id=2edbcb0eb3985f20292af6fad358c2d36283ec6d
Submitter: Jenkins
Branch: stable/newton

commit 2edbcb0eb3985f20292af6fad358c2d36283ec6d
Author: Rajesh Tailor <email address hidden>
Date: Fri Jun 9 15:02:14 2017 +0530

    Fix invalid PCI alias definition

    The PCI alias config type is changed in recent release from
    'oslo_config.ListOpt' to 'oslo_config.MultiStrOpt'.

    Here nova expects a multi valued option instead of a list.

    Conflicts:
            manifests/api.pp

    Change-Id: Ie27dbbc510c73c685b239a9be4af2700a0eb42f0
    Closes-Bug: #1696955
    (cherry picked from commit 9dde5a4108df2448bfd43010112d313f1a73395b)
    (cherry picked from commit 1f4356c8b1b3fc3963df7768a32ecc46cfcfd31d)

tags: added: in-stable-newton
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to puppet-nova (stable/ocata)

Reviewed: https://review.openstack.org/482033
Committed: https://git.openstack.org/cgit/openstack/puppet-nova/commit/?id=22b107f54c7910027846fa2cacc7b07564321afc
Submitter: Jenkins
Branch: stable/ocata

commit 22b107f54c7910027846fa2cacc7b07564321afc
Author: Rajesh Tailor <email address hidden>
Date: Thu Jul 6 15:45:47 2017 +0530

    Fix pci config params name as mentioned in nova conf

    This change, modifies name of params, as mentioned in sample
    nova conf [1].
    The parameter name in PCI section should be `alias` and
    `passthrough_whitelist` instead of `pci_alias` and
    `pci_passthrough_whitelist`.

    [1] https://docs.openstack.org/nova/latest/sample_config.html

    Conflicts:
            manifests/api.pp
            manifests/compute.pp
            spec/classes/nova_api_spec.rb
            spec/classes/nova_compute_spec.rb

    Change-Id: Ia7d8c0c900b3cb05d809e62e5c203d183b357fce
    Related-Bug: #1696955
    (cherry picked from commit 018c8a290065eb642ec0e436006117dfc66aa1ea)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/puppet-nova 11.2.0

This issue was fixed in the openstack/puppet-nova 11.2.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/puppet-nova 9.6.0

This issue was fixed in the openstack/puppet-nova 9.6.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to puppet-nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/492172

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to puppet-nova (master)

Reviewed: https://review.openstack.org/492172
Committed: https://git.openstack.org/cgit/openstack/puppet-nova/commit/?id=1cd349f893408803fec307f615ae3fe265d54fed
Submitter: Jenkins
Branch: master

commit 1cd349f893408803fec307f615ae3fe265d54fed
Author: Oliver Walsh <email address hidden>
Date: Wed Aug 9 15:38:49 2017 +0100

    Fix handling of nova pci MultiStrOpt params

    The changes in Ie27dbbc510c73c685b239a9be4af2700a0eb42f0 did not appear to fix
    the handling of the nova pci_* params. The config being written to nova.conf
    remains in the ListOpt format.

    As support for MultiStrOpt was added to nova_config in
    I6be7bb4cea1906bd98c513bd2d01153e4643e3ac we just need to pass an array of
    strings to nova_config to set these MultiStrOpt params.

    Nova expects the string values to be JSON encoded so that is what the parser
    function now returns. This function has also been renamed from
    'check_array_of_hash' (which it never did) to 'to_array_of_json_strings'.

    The acceptable input formats are a JSON array of objects or a puppet Array of
    Hashes. Perviously a "JSON with single quotes" format was used but should now
    be considered deprecated as it could corrupt data.

    This also removes any pci_alias entries from nova.conf when the param is not
    set.

    Change-Id: Ida3ecab717bc3113ba23553c559263f35c49c46a
    Closes-bug: #1696955

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to puppet-nova (stable/ocata)

Fix proposed to branch: stable/ocata
Review: https://review.openstack.org/494189

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to puppet-nova (stable/newton)

Fix proposed to branch: stable/newton
Review: https://review.openstack.org/494217

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to puppet-nova (stable/newton)

Reviewed: https://review.openstack.org/494217
Committed: https://git.openstack.org/cgit/openstack/puppet-nova/commit/?id=064799e31cb662745caf4ee93b3f36a82b1c4e33
Submitter: Jenkins
Branch: stable/newton

commit 064799e31cb662745caf4ee93b3f36a82b1c4e33
Author: Oliver Walsh <email address hidden>
Date: Wed Aug 9 15:38:49 2017 +0100

    Fix handling of nova pci MultiStrOpt params

    The changes in Ie27dbbc510c73c685b239a9be4af2700a0eb42f0 did not appear to fix
    the handling of the nova pci_* params. The config being written to nova.conf
    remains in the ListOpt format.

    As support for MultiStrOpt was added to nova_config in
    I6be7bb4cea1906bd98c513bd2d01153e4643e3ac we just need to pass an array of
    strings to nova_config to set these MultiStrOpt params.

    Nova expects the string values to be JSON encoded so that is what the parser
    function now returns. This function has also been renamed from
    'check_array_of_hash' (which it never did) to 'to_array_of_json_strings'.

    The acceptable input formats are a JSON array of objects or a puppet Array of
    Hashes. Perviously a "JSON with single quotes" format was used but should now
    be considered deprecated as it could corrupt data.

    This also removes any pci_alias entries from nova.conf when the param is not
    set.

    Change-Id: Ida3ecab717bc3113ba23553c559263f35c49c46a
    Closes-bug: #1696955
    (cherry picked from commit 1cd349f893408803fec307f615ae3fe265d54fed)
    (cherry picked from commit 13cfe18726c9ff189258871149f54caeb20b2a77)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to puppet-nova (stable/ocata)

Reviewed: https://review.openstack.org/494189
Committed: https://git.openstack.org/cgit/openstack/puppet-nova/commit/?id=13cfe18726c9ff189258871149f54caeb20b2a77
Submitter: Jenkins
Branch: stable/ocata

commit 13cfe18726c9ff189258871149f54caeb20b2a77
Author: Oliver Walsh <email address hidden>
Date: Wed Aug 9 15:38:49 2017 +0100

    Fix handling of nova pci MultiStrOpt params

    The changes in Ie27dbbc510c73c685b239a9be4af2700a0eb42f0 did not appear to fix
    the handling of the nova pci_* params. The config being written to nova.conf
    remains in the ListOpt format.

    As support for MultiStrOpt was added to nova_config in
    I6be7bb4cea1906bd98c513bd2d01153e4643e3ac we just need to pass an array of
    strings to nova_config to set these MultiStrOpt params.

    Nova expects the string values to be JSON encoded so that is what the parser
    function now returns. This function has also been renamed from
    'check_array_of_hash' (which it never did) to 'to_array_of_json_strings'.

    The acceptable input formats are a JSON array of objects or a puppet Array of
    Hashes. Perviously a "JSON with single quotes" format was used but should now
    be considered deprecated as it could corrupt data.

    This also removes any pci_alias entries from nova.conf when the param is not
    set.

    Change-Id: Ida3ecab717bc3113ba23553c559263f35c49c46a
    Closes-bug: #1696955
    (cherry picked from commit 1cd349f893408803fec307f615ae3fe265d54fed)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/puppet-nova 11.3.0

This issue was fixed in the openstack/puppet-nova 11.3.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/puppet-nova 9.7.0

This issue was fixed in the openstack/puppet-nova 9.7.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/puppet-nova 10.5.0

This issue was fixed in the openstack/puppet-nova 10.5.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.