[openstack-dev] [nova] A problem about pci-passthrough

Liuji (Jeremy) jeremy.liu at huawei.com
Mon Mar 3 08:06:57 UTC 2014

Hi, all

I find a problem about pci-passthrough.

Test scenario:
1)There are two compute nodes in the environment named A and B. A has two NICs of vendor_id='8086' and product_id='105e', B has two NICs of vendor_id='8086' and product_id='10c9'.
2)I configured "pci_alias={"vendor_id":"8086", "product_id":"10c9", "name":"a1"}" in nova.conf on the controller node, and of course the pci_passthrough_whitelist on this two compute nodes seperately.
3)Finally, a flavor named "MyTest" with extra_specs= {u'pci_passthrough:alias': u'a1:1'}
4)When I create a new instance with the "MyTest" flavor, it starts or is error randomly.

The problem is in the _schedule function of nova/scheduler/filter_scheduler.py:
            chosen_host = random.choice(

            # Now consume the resources so the filter/weights
            # will change for the next instance.

while "scheduler_host_subset_size" is configured to 2, the weighed_hosts are A and B, but the chosen_host is selected randomly.
When chosen_host is B, the instance starts, but when chosen_host is A, the instance becomes error. The "consume_from_instance" will raise a exception.

I think it is a bug. Is there a problem with my test operation or need some other configuration?

Jeremy Liu

More information about the OpenStack-dev mailing list