Bug 1154201

Summary: [nova][PCI-Passthrough] TypeError: pop() takes at most 1 argument (2 given)
Product: [Community] RDO Reporter: Joe Talerico <jtaleric>
Component: openstack-novaAssignee: Eoghan Glynn <eglynn>
Status: CLOSED EOL QA Contact: Shai Revivo <srevivo>
Severity: high Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: beagles, berrange, dasmith, eglynn, jtaleric, rbryant, sbauza, sferdjao, sgordon, srevivo, stoner, vromanso
Target Milestone: ---   
Target Release: Juno   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1154737 (view as bug list) Environment:
Last Closed: 2016-05-19 16:00:34 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1154737    

Description Joe Talerico 2014-10-17 21:02:54 UTC
Description of problem:
Setting the configuration to passthrough a device, I get the following:
 
CRITICAL nova [-] TypeError: pop() takes at most 1 argument (2 given) 
2014-10-17 15:28:59.968 7153 CRITICAL nova [-] TypeError: pop() takes at most 1 argument (2 given)
2014-10-17 15:28:59.968 7153 TRACE nova Traceback (most recent call last):
2014-10-17 15:28:59.968 7153 TRACE nova   File "/usr/bin/nova-compute", line 10, in <module>
2014-10-17 15:28:59.968 7153 TRACE nova     sys.exit(main())
2014-10-17 15:28:59.968 7153 TRACE nova   File "/usr/lib/python2.7/site-packages/nova/cmd/compute.py", line 72, in main
2014-10-17 15:28:59.968 7153 TRACE nova     db_allowed=CONF.conductor.use_local)
2014-10-17 15:28:59.968 7153 TRACE nova   File "/usr/lib/python2.7/site-packages/nova/service.py", line 275, in create
2014-10-17 15:28:59.968 7153 TRACE nova     db_allowed=db_allowed)
2014-10-17 15:28:59.968 7153 TRACE nova   File "/usr/lib/python2.7/site-packages/nova/service.py", line 148, in __init__
2014-10-17 15:28:59.968 7153 TRACE nova     self.manager = manager_class(host=self.host, *args, **kwargs)
2014-10-17 15:28:59.968 7153 TRACE nova   File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 631, in __init__
2014-10-17 15:28:59.968 7153 TRACE nova     self.driver = driver.load_compute_driver(self.virtapi, compute_driver)
2014-10-17 15:28:59.968 7153 TRACE nova   File "/usr/lib/python2.7/site-packages/nova/virt/driver.py", line 1402, in load_compute_driver
2014-10-17 15:28:59.968 7153 TRACE nova     virtapi)
2014-10-17 15:28:59.968 7153 TRACE nova   File "/usr/lib/python2.7/site-packages/nova/openstack/common/importutils.py", line 50, in import_object_ns
2014-10-17 15:28:59.968 7153 TRACE nova     return import_class(import_value)(*args, **kwargs)
2014-10-17 15:28:59.968 7153 TRACE nova   File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/driver.py", line 405, in __init__
2014-10-17 15:28:59.968 7153 TRACE nova     self.dev_filter = pci_whitelist.get_pci_devices_filter()
2014-10-17 15:28:59.968 7153 TRACE nova   File "/usr/lib/python2.7/site-packages/nova/pci/pci_whitelist.py", line 88, in get_pci_devices_filter
2014-10-17 15:28:59.968 7153 TRACE nova     return PciHostDevicesWhiteList(CONF.pci_passthrough_whitelist)
2014-10-17 15:28:59.968 7153 TRACE nova   File "/usr/lib/python2.7/site-packages/nova/pci/pci_whitelist.py", line 68, in __init__
2014-10-17 15:28:59.968 7153 TRACE nova     self.specs = self._parse_white_list_from_config(whitelist_spec)
2014-10-17 15:28:59.968 7153 TRACE nova   File "/usr/lib/python2.7/site-packages/nova/pci/pci_whitelist.py", line 49, in _parse_white_list_from_config
2014-10-17 15:28:59.968 7153 TRACE nova     spec = pci_devspec.PciDeviceSpec(jsonspec)
2014-10-17 15:28:59.968 7153 TRACE nova   File "/usr/lib/python2.7/site-packages/nova/pci/pci_devspec.py", line 132, in __init__
2014-10-17 15:28:59.968 7153 TRACE nova     self._init_dev_details()
2014-10-17 15:28:59.968 7153 TRACE nova   File "/usr/lib/python2.7/site-packages/nova/pci/pci_devspec.py", line 137, in _init_dev_details
2014-10-17 15:28:59.968 7153 TRACE nova     self.vendor_id = details.pop("vendor_id", ANY)

Version-Release number of selected component (if applicable):
RHEL7 w/ RDO Juno

How reproducible:
100%

Steps to Reproduce:
1. Modify /etc/nova/nova.conf to have the pci_alias and pci_passthrough_whitelist
2. restart openstack services


Actual results:
Failure to start nova-compute

Expected results:
Nova compute start...

Additional info:
The example states in nova.conf for :
# White list of PCI devices available to VMs. For example:
# pci_passthrough_whitelist =  [{"vendor_id": "8086",
# "product_id": "0443"}] (multi valued)
#pci_passthrough_whitelist=

A list [{json....}]

However, to make nova-compute not bomb out, I used : 

pci_passthrough_whitelist={"vendor_id":"8086","product_id":"10fb"}

In the python code: 
/usr/lib/python2.7/site-packages/nova/pci/pci_devspec.py

There is a code reference on line 53 that doesn't show the list either. However, upstream documentation shows to use the list : https://wiki.openstack.org/wiki/Pci_passthrough

Brent Eagles might have more to add, as he was watching me debug the system on bluejeans.

Comment 1 Joe Talerico 2014-10-17 21:03:28 UTC
This is n RHEL7

Comment 2 Daniel Berrangé 2014-10-20 07:46:19 UTC
I get the impression that they have mistakenly changed the config option format in Juno. If correct this needs to be fixed to be backwards compatible with the old format.

Comment 3 Dan Smith 2014-10-20 14:40:09 UTC
Yeah, that code was touched at the last minute too.

Can you file a bug upstream against nova?

Comment 4 Sean Toner 2015-04-10 14:54:31 UTC
I'm getting the exact same problem on the Juno A2 release on RHEL 7.1


/etc/nova/nova.conf:1641:pci_alias=[{"name": "SRIOVnic", "product_id": "1515", "vendor_id": "8086"},{"name": "SRIOVnic10G", "product_id": "10ed", "vendor_id": "8086"}]
/etc/nova/nova.conf:1651:pci_passthrough_whitelist=[{"vendor_id": "8086", "product_id": "1515"},{"vendor_id": "8086", "product_id": "10ed"}]


[root@macb8ca3a6106b4 ~]# tail -f /var/log/nova/nova-compute.log
2015-04-10 10:39:27.724 23934 TRACE nova   File "/usr/lib/python2.7/site-packages/nova/pci/pci_whitelist.py", line 68, in __init__
2015-04-10 10:39:27.724 23934 TRACE nova     self.specs = self._parse_white_list_from_config(whitelist_spec)
2015-04-10 10:39:27.724 23934 TRACE nova   File "/usr/lib/python2.7/site-packages/nova/pci/pci_whitelist.py", line 49, in _parse_white_list_from_config
2015-04-10 10:39:27.724 23934 TRACE nova     spec = pci_devspec.PciDeviceSpec(jsonspec)
2015-04-10 10:39:27.724 23934 TRACE nova   File "/usr/lib/python2.7/site-packages/nova/pci/pci_devspec.py", line 132, in __init__
2015-04-10 10:39:27.724 23934 TRACE nova     self._init_dev_details()
2015-04-10 10:39:27.724 23934 TRACE nova   File "/usr/lib/python2.7/site-packages/nova/pci/pci_devspec.py", line 137, in _init_dev_details
2015-04-10 10:39:27.724 23934 TRACE nova     self.vendor_id = details.pop("vendor_id", ANY)
2015-04-10 10:39:27.724 23934 TRACE nova TypeError: pop() takes at most 1 argument (2 given)
2015-04-10 10:39:27.724 23934 TRACE nova

Comment 7 Chandan Kumar 2016-05-19 16:00:34 UTC
This bug is against a Version which has reached End of Life.
If it's still present in supported release (http://releases.openstack.org), please update Version and reopen.