I tried the following:
* create a neutron port with vnic_type direct
* change the mac address of the port in neutron
* create a server with the above port
I only see a periodic warning in the nova-compute logs. But it is independent from the fact that the VF is used or not. It only depends on the fact that the VF is whitelisted or not.
WARNING nova.pci.utils [None req-9fbb125a-021f-4bb2-9688-f47eae5bd564 None None] No net device was found for VF 0000:81:10.2: nova.exception.PciDeviceNotFoundById: PCI device 0000:81:10.2 not found
Looking at the code [1] I guess in my env the code bails out with the above WARNING and therefore I never hit the self._host.device_lookup_by_name(devname) call that blows in your env.
Based on this I think it is OK to put a try-except around self._host.device_lookup_by_name(devname) and log a WARNING there and bailing out with None.
I was not able to reproduce the issue locally.
I tried the following:
* create a neutron port with vnic_type direct
* change the mac address of the port in neutron
* create a server with the above port
I only see a periodic warning in the nova-compute logs. But it is independent from the fact that the VF is used or not. It only depends on the fact that the VF is whitelisted or not.
WARNING nova.pci.utils [None req-9fbb125a- 021f-4bb2- 9688-f47eae5bd5 64 None None] No net device was found for VF 0000:81:10.2: nova.exception. PciDeviceNotFou ndById: PCI device 0000:81:10.2 not found
Looking at the code [1] I guess in my env the code bails out with the above WARNING and therefore I never hit the self._host. device_ lookup_ by_name( devname) call that blows in your env.
Based on this I think it is OK to put a try-except around self._host. device_ lookup_ by_name( devname) and log a WARNING there and bailing out with None.
[1] https:/ /github. com/openstack/ nova/blob/ 63a03d848196320 912bcc70eb2a8e7 5425fdea84/ nova/virt/ libvirt/ driver. py#L6910