alias can not support list for pci device

Bug #1786870 reported by fupingxie
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
fupingxie

Bug Description

when add alias in pci section in nova.conf, can not use a list. Like this:
alias = [{"product_id":"1b06","address":"02:00.0"},{"product_id":"1b06","address":"03:00.0"}]

Tags: pci
Revision history for this message
fupingxie (fpxie) wrote :

1. If alias is a list, it will fail in function _get_alias_from_config when creating VM using pci device.
2. whitelist in nova.conf can support a list.

Changed in nova:
assignee: nobody → fupingxie (fpxie)
Revision history for this message
melanie witt (melwitt) wrote :

Based on the docstrings in the nova.conf for 'pci', it looks like both the 'alias' and 'passthrough_whitelist' options should be able to support a JSON list of JSON dictionaries as shown in this bug report. For example:

    ...

    cfg.MultiStrOpt('passthrough_whitelist',
        default=[],
        deprecated_name='pci_passthrough_whitelist',
        deprecated_group='DEFAULT',
        help="""

    ...

    passthrough_whitelist = [{"product_id":"0001", "vendor_id":"8086"},
                             {"product_id":"0002", "vendor_id":"8086"}]

So, if this is not working, it is a valid bug.

[1] https://github.com/openstack/nova/blob/9e628766570e0af5b69aab416e5234f633498eab/nova/conf/pci.py

tags: added: pci
Changed in nova:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

Changed in nova:
status: Confirmed → In Progress
Revision history for this message
Eric Fried (efried) wrote :

But you can specify the 'alias' key multiple times, right?

 [pci]
 alias = { ... }
 alias = { ... }

Changed in nova:
assignee: fupingxie (fpxie) → Eric Fried (efried)
Eric Fried (efried)
Changed in nova:
assignee: Eric Fried (efried) → fupingxie (fpxie)
Changed in nova:
assignee: fupingxie (fpxie) → Eric Fried (efried)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/592243
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=d086389366ca9f76750c60c33db1d948a8bc69ff
Submitter: Zuul
Branch: master

commit d086389366ca9f76750c60c33db1d948a8bc69ff
Author: fpxie <email address hidden>
Date: Thu Aug 16 10:05:23 2018 +0800

    Add an example to add more pci devices in nova.conf

    The help for the [pci]aliases config option was confusing in that it
    wasn't clear how to specify multiple aliases. The default value being []
    made it seem like you ought to be able to specify a list as:

     alias = [{...}, {...}, ...]

    This won't actually work; you instead have to say:

     alias = {...}
     alias = {...}
     ...

    So this patch adds a multi-alias example to the help string and
    explicitly calls out the fact that you can't use list values.

    See the referenced bug for more details.
    Change-Id: I71d4c440340db31d22a73a8b3e3abc51771aa7bc
    Closes-Bug: #1786870

Changed in nova:
status: In Progress → Fix Released
fupingxie (fpxie)
Changed in nova:
assignee: Eric Fried (efried) → fupingxie (fpxie)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 19.0.0.0rc1

This issue was fixed in the openstack/nova 19.0.0.0rc1 release candidate.

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.