Bug #5171

KVM detach_nic should check if NIC is not present anymore

Added by Vlastimil Holer over 3 years ago. Updated over 3 years ago.

Status:ClosedStart date:05/25/2017
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Drivers - Network
Target version:Release 5.4
Resolution:fixed Pull request:
Affected Versions:OpenNebula 5.2

Description

Apparently, there can be edge cases (bugs) when the NIC detach on KVM fails, but the libvirt returns success:

# time virsh detach-interface one-39643 bridge --mac 02:00:ac:11:00:59
Interface detached successfully

real    0m4.023s
user    0m0.012s
sys    0m0.007s

# time virsh detach-interface one-39643 bridge --mac 02:00:ac:11:00:59
Interface detached successfully

real    0m4.029s
user    0m0.012s
sys    0m0.010s

# time virsh domiflist one-39643
Interface  Type       Source     Model       MAC
-------------------------------------------------------
one-39643-0 bridge     onebr1100  virtio      02:00:ac:11:10:d2
one-39643-1 bridge     onebr1047  virtio      02:00:ac:11:10:68
one-39643-2 bridge     onebr1176  virtio      02:00:ac:11:11:6b
one-39643-3 bridge     onebr1183  virtio      02:00:ac:11:11:79
one-39643-4 bridge     onebr1000  virtio      02:00:ac:11:10:0a
one-39643-5 bridge     onebr912   virtio      02:00:ac:11:00:59

In this case, also the kvm/detach_nic returns success to the OpenNebula:

# ./detach_nic one-39643 02:00:ac:11:00:59
#

which unfortunately leads to the inconsistency between the OpenNebula view and real libvirt/KVM state.

It would be better to check for the success on our own, similarly as it's done for the kvm/detach_disk.

Seen on CentOS 7 with:
  • kernel 3.10.0-327.36.3.el7.x86_64
  • libvirt-2.0.0-10.el7_3.5.x86_64
  • qemu-kvm-1.5.3-126.el7_3.6.x86_64

Associated revisions

Revision 3a0ff50e
Added by Vlastimil Holer over 3 years ago

B #5171: Check if NIC is really absent after detach on KVM

Revision c0a0ff5c
Added by Javi Fontan over 3 years ago

Merge pull request #314 from vholer/bug-5171

B #5171: Check if NIC is really absent after detach on KVM

History

#1 Updated by Vlastimil Holer over 3 years ago

This PR https://github.com/OpenNebula/one/pull/314
only follows the code of the detach_disk.

Fails if NIC is still present after detach:

# ./detach_nic one-39643 02:00:ac:11:00:59
ERROR MESSAGE --8<------
Could not detach NIC (02:00:ac:11:00:59) from one-39643
ERROR MESSAGE ------>8--

#2 Updated by Vlastimil Holer over 3 years ago

  • Status changed from Pending to Closed
  • Resolution set to fixed

Also available in: Atom PDF