PciPassthroughFilter throws exception if host has no pci devices

Bug #1435981 reported by Przemyslaw Czesnowicz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
James Chapman

Bug Description

When booting a VM with pci devices the PciPassthroughFilter will raise an exception if one of the hosts doesn't have any assignable pci devices (because pci_stats is set to None on host_state in that case)

Traceback (most recent call last):
2015-03-24 16:51:46.744 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 142, in _dispatch_and_repl
y
2015-03-24 16:51:46.744 TRACE oslo_messaging.rpc.dispatcher executor_callback))
2015-03-24 16:51:46.744 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 186, in _dispatch
2015-03-24 16:51:46.744 TRACE oslo_messaging.rpc.dispatcher executor_callback)
2015-03-24 16:51:46.744 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 130, in _do_dispatch
2015-03-24 16:51:46.744 TRACE oslo_messaging.rpc.dispatcher result = func(ctxt, **new_args)
2015-03-24 16:51:46.744 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/server.py", line 142, in inner
2015-03-24 16:51:46.744 TRACE oslo_messaging.rpc.dispatcher return func(*args, **kwargs)
2015-03-24 16:51:46.744 TRACE oslo_messaging.rpc.dispatcher File "/shared/stack/nova/nova/scheduler/manager.py", line 86, in select_destinations
2015-03-24 16:51:46.744 TRACE oslo_messaging.rpc.dispatcher filter_properties)
2015-03-24 16:51:46.744 TRACE oslo_messaging.rpc.dispatcher File "/shared/stack/nova/nova/scheduler/filter_scheduler.py", line 67, in select_destinations
2015-03-24 16:51:46.744 TRACE oslo_messaging.rpc.dispatcher filter_properties)
2015-03-24 16:51:46.744 TRACE oslo_messaging.rpc.dispatcher File "/shared/stack/nova/nova/scheduler/filter_scheduler.py", line 138, in _schedule
2015-03-24 16:51:46.744 TRACE oslo_messaging.rpc.dispatcher filter_properties, index=num)
2015-03-24 16:51:46.744 TRACE oslo_messaging.rpc.dispatcher File "/shared/stack/nova/nova/scheduler/host_manager.py", line 451, in get_filtered_hosts
2015-03-24 16:51:46.744 TRACE oslo_messaging.rpc.dispatcher hosts, filter_properties, index)
2015-03-24 16:51:46.744 TRACE oslo_messaging.rpc.dispatcher File "/shared/stack/nova/nova/filters.py", line 78, in get_filtered_objects
2015-03-24 16:51:46.744 TRACE oslo_messaging.rpc.dispatcher list_objs = list(objs)
2015-03-24 16:51:46.744 TRACE oslo_messaging.rpc.dispatcher File "/shared/stack/nova/nova/filters.py", line 44, in filter_all
2015-03-24 16:51:46.744 TRACE oslo_messaging.rpc.dispatcher if self._filter_one(obj, filter_properties):
2015-03-24 16:51:46.744 TRACE oslo_messaging.rpc.dispatcher File "/shared/stack/nova/nova/scheduler/filters/__init__.py", line 27, in _filter_one
2015-03-24 16:51:46.744 TRACE oslo_messaging.rpc.dispatcher return self.host_passes(obj, filter_properties)
2015-03-24 16:51:46.744 TRACE oslo_messaging.rpc.dispatcher File "/shared/stack/nova/nova/scheduler/filters/pci_passthrough_filter.py", line 48, in host_passes
2015-03-24 16:51:46.744 TRACE oslo_messaging.rpc.dispatcher if not host_state.pci_stats.support_requests(pci_requests.requests):
2015-03-24 16:51:46.744 TRACE oslo_messaging.rpc.dispatcher AttributeError: 'NoneType' object has no attribute 'support_requests'

Changed in nova:
assignee: nobody → James Chapman (james-p-chapman)
Changed in nova:
importance: Undecided → Low
status: New → Confirmed
Changed in nova:
status: Confirmed → In Progress
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/167817

Changed in nova:
status: In Progress → Confirmed
status: Confirmed → In Progress
Revision history for this message
Sylvain Bauza (sylvain-bauza) wrote :

Sounds a good candidate for fixing it in RC1

Changed in nova:
milestone: none → kilo-rc1
Changed in nova:
importance: Low → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/167817
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=69ec3b6f0ceba5db714e35f6d72d40f14ef51ad3
Submitter: Jenkins
Branch: master

commit 69ec3b6f0ceba5db714e35f6d72d40f14ef51ad3
Author: James Chapman <email address hidden>
Date: Wed Apr 8 10:31:04 2015 +0100

    Manage compute node that exposes no pci devices

    Booting a VM with a pci device causes an exception when the host doesnt
    have any assignable pci devices.
    If a host doesnt expose any pci devices to nova, its pci_stats are set
    to None. This causes an exception when the PciPassthroughFilter checks
    if the host can support the pci requests.

    Closes-Bug: #1435981
    Change-Id: Ia9fbec9c7a3afa9b7ea73c43b21db0909a195a36

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: kilo-rc1 → 2015.1.0
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.