Red Hat Bugzilla – Bug 1303640
[SR-IOV] - PF is no longer considered as a PF after the VM shuts down, if it was attached/added directly to VM via Host Devices sub tab
Last modified: 2016-04-21 10:42:26 EDT
Description of problem:
[SR-IOV] - PF is no longer considered as a PF after the VM shuts down, if it was attached/added directly to VM via Host Devices sub tab.
Direct attachment of a PF to VM via Host Devices sub tab and then shutting the VM down, will cause the NIC to no longer be considered as a PF.
Once running VM with PF a direct attachment, his record deleted from host_nic_vfs_config table, since it has a foreign key on the vds_interface table and after shutting the VM, the host_nic_vfs_config record is not recovered.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Attach a PF to VM as direct attachment via the Host Devices sub tab
2. Run the VM
3. Shut down the VM
PF/s no longer considered as PF/s, but as regular NICs(no sr-iov icon, no edit option).
PF should remain PF
An oVirt user had a similar problem-
The names of the nics were switched.
The user had a host with 4 sriov nics.
The sriov nics were - eth2, eth3, eth4 and eth5.
After a reboot, the names were switched - eth1, eth3, eth4 and eth6 became the sriov nics.
Since the pci devices didn't change and only the 'net_iface_name' on the net devices was changed, 'host_nic_vfs_config' table is not being updated (currently, the code updates it only if the pci devices are changed).
Since the id value in vds_interface table is resolved by the nic_name reported from by getVdsCap. The vds_interface table ids and names are staying the same, just the data is switched. If previously id 'id1' referenced to name 'eth1', after the name switching id 'id1' will still reference to name 'eth1'.
The entries in 'host_nic_vfs_config' table refer via the nic_id to 'vds_interface' table.
It means that they refer to the same nic_names they referred before the switch.
Since after the names switch this nic_name no longer refer to sriov nic. It cause NPE when trying to open the 'Host setup networks' dialog of the related host (it assumes the nic is sriov and has 'total_num_of_vfs'. This assumption is wrong and causes NPE).
Verified on - 3.6.5-0.1.el6 and vdsm-4.17.25-0.el7ev.noarch