[nova] Fail to detach vhostuser vif type from VM

Arches, Maria (Nokia - HU/Budapest) luisa.arches at nokia.com
Mon Dec 10 14:35:03 UTC 2018


Hello all,

I tried to detach a vhostuser vif from VM. My network setup is neutron+ ovs dpdk  and using Libvirt/KVM. I'm using Openstack Queens.
Network interface was unplugged but was not removed from libvirt/VM.
I also created a bug for this in Launchpad. Wrote here to find/discuss possible solutions.
https://bugs.launchpad.net/nova/+bug/1807340

I got the following logs from nova-compute:

2018-12-10 12:29:49.008 3223 INFO os_vif [req-ffd43a33-b0b9-4b4d-a7ce-700b7aee2822 7f6d35b7b85042daa470658debca14c3 b8668325f4fa4b9085fd2ac43170dd42 - default default] Successfully unplugged vif VIFVHostUser(active=True,address=fa:16:3e:ca:4e:16,has_traffic_filtering=False,id=90ca01ab-9a43-4d5f-b0bd-cb334d07e22b,mode='server',network=Network(e108697b-f031-45cb-bf47-6031c69afd4b),path='/var/run/openvswitch/vhu90ca01ab-9a',plugin='ovs',port_profile=VIFPortProfileOpenVSwitch,preserve_on_delete=False,vif_name='vhu90ca01ab-9a')
2018-12-10 12:29:49.011 3223 WARNING nova.virt.libvirt.driver [req-ffd43a33-b0b9-4b4d-a7ce-700b7aee2822 7f6d35b7b85042daa470658debca14c3 b8668325f4fa4b9085fd2ac43170dd42 - default default] [instance: a4dd7fb5-d234-4b2a-9ebd-b1e3f657ac3e] Detaching interface fa:16:3e:ca:4e:16 failed because the device is no longer found on the guest.

Tried to investigate further the code and it seems that get_interface_cfg() does not find any interface that matches because target_dev is not the same.
https://github.com/openstack/nova/blob/0f4cecb70c2d11593f18818523a61059c0196d88/nova/virt/libvirt/guest.py#L247

vhostuser backend does not set any value for target_dev, while LibvirtGuestInterface does.
https://github.com/openstack/nova/blob/0f4cecb70c2d11593f18818523a61059c0196d88/nova/virt/libvirt/designer.py#L151
https://github.com/openstack/nova/blob/0f4cecb70c2d11593f18818523a61059c0196d88/nova/virt/libvirt/config.py#L1467

First question is, is it on purpose that vhostuser vif does not set any target_dev?
Possible solution that I can think of:
1. Add setting of target_dev in set_vif_host_backend_vhostuser_config()
2. Skipping target_dev check when vif type is vhostuser.

I also noticed, that when a vhostuser interface type is attached to VM during run-time there was no target dev present in the virsh dumpxml.
First interface is created during creation. Second one, was attached run-time.
    <interface type='vhostuser'>
      <mac address='fa:16:3e:d8:47:73'/>
      <source type='unix' path='/var/run/openvswitch/vhu5b00f2b1-02' mode='server'/>
      <target dev='vhu5b00f2b1-02'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <interface type='vhostuser'>
      <mac address='fa:16:3e:9c:93:db'/>
      <source type='unix' path='/var/run/openvswitch/vhu70a4f277-36' mode='server'/>
      <model type='virtio'/>
      <alias name='net1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </interface>



More information about the openstack-discuss mailing list