Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-7337

Hostdev interface can not be plugged back after unplugged with failover setting

Details

    • sst_virtualization_networking
    • ssg_virtualization
    • 1
    • False
    • Hide

      None

      Show
      None
    • Unspecified
    • Known Issue
    • Hide
      .A `hostdev` interface with failover settings cannot be hot-plugged after being hot-unplugged

      After removing a `hostdev` network interface with failover configuration from a running virtual machine (VM), the interface currently cannot be re-attached to the same running VM.
      Show
      .A `hostdev` interface with failover settings cannot be hot-plugged after being hot-unplugged After removing a `hostdev` network interface with failover configuration from a running virtual machine (VM), the interface currently cannot be re-attached to the same running VM.
    • Done

    Description

      Description of problem:
      Hostdev interface can not be plugged back after unplugged with failover setting

      Version-Release number of selected component (if applicable):
      libvirt-8.0.0-3.el9.x86_64
      qemu-kvm-6.2.0-7.el9.x86_64

      How reproducible:
      100%

      Steps to Reproduce:
      1. Start vm with failover interface setting:

      1. virsh dumpxml rhel9 | grep /interface -B9
        ......
        <interface type='network'>
        <mac address='52:54:00:aa:1c:ef'/>
        <source network='hostbridge'/>
        <model type='virtio'/>
        <teaming type='persistent'/>
        <alias name='ua-backup0'/>
        <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
        </interface>
        <interface type='network'>
        <mac address='52:54:00:aa:1c:ef'/>
        <source network='hostdev-net'/>
        <teaming type='transient' persistent='ua-backup0'/>
        <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
        </interface>

      2. Login the vm and check there are 3 interfaces and the network works well;

      3. Hot unplug the hostdev device, all things are expected, unplug succeed and the network works well;

      Dump the hostdev interface xml as below:

      1. cat hostdevinterface.xml
        <interface type='hostdev' managed='yes'>
        <mac address='52:54:00:aa:1c:ef'/>
        <driver name='vfio'/>
        <source>
        <address type='pci' domain='0x0000' bus='0x82' slot='0x10' function='0x1'/>
        </source>
        <teaming type='transient' persistent='ua-backup0'/>
        <alias name='hostdev0'/>
        <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
        </interface>
      1. virsh detach-device rhel9 hostdevinterface.xml
        Device detached successfully

      on guest, check network works well:

      1. ping www.baidu.com
        ...
        64 bytes from 182.61.200.7 (182.61.200.7): icmp_seq=151 ttl=48 time=2.97 ms
        [ 206.393009] pcieport 0000:00:02.3: pciehp: Slot(0-3): Attention button pressed
        [ 206.394346] pcieport 0000:00:02.3: pciehp: Slot(0-3): Powering off due to button press
        64 bytes from 182.61.200.7 (182.61.200.7): icmp_seq=152 ttl=48 time=3.04 ms
        ...
        64 bytes from 182.61.200.7 (182.61.200.7): icmp_seq=156 ttl=48 time=30.4 ms
        [ 211.519313] virtio_net virtio1 enp1s0: failover primary slave:enp4s0 unregistered
        64 bytes from 182.61.200.7 (182.61.200.7): icmp_seq=158 ttl=48 time=3.14 ms
        ...
        64 bytes from 182.61.200.7 (182.61.200.7): icmp_seq=221 ttl=48 time=3.03 ms
        64 bytes from 182.61.200.7 (182.61.200.7): icmp_seq=222 ttl=48 time=3.05 ms

      4. Tried to hot plug the hostdev interface back, but it failed;

      1. virsh attach-device rhel9 hostdevinterface.xml
        error: Failed to attach device from hostdevinterface.xml
        error: internal error: unable to execute QEMU command 'device_add': Duplicate ID 'hostdev0' for device

      Update the xml to delete the alias, it still fails:

      1. cat hostdevinterface2.xml
        <interface type='hostdev' managed='yes'>
        <mac address='52:54:00:aa:1c:ef'/>
        <driver name='vfio'/>
        <source>
        <address type='pci' domain='0x0000' bus='0x82' slot='0x10' function='0x1'/>
        </source>
        <teaming type='transient' persistent='ua-backup0'/>
        </interface>
      1. virsh attach-device rhel9 hostdevinterface.xml
        error: Failed to attach device from hostdevinterface.xml
        error: internal error: unable to execute QEMU command 'device_add': Duplicate ID 'hostdev0' for device

      Actual results:
      Hostdev interface can not be plugged back after unplugged with failover setting

      Expected results:
      It should succeed to hot plug back the interface

      Additional info:
      No such issue with qemu-kvm-6.1.0-8.el9.x86_64

      Attachments

        Issue Links

          Activity

            People

              lvivier@redhat.com Laurent Vivier
              yalzhang@redhat.com Yalan Zhang
              Laurent Vivier Laurent Vivier
              Yanhui Ma Yanhui Ma
              Jiří Herrmann Jiří Herrmann
              Votes:
              0 Vote for this issue
              Watchers:
              13 Start watching this issue

              Dates

                Created:
                Updated: