brvirt: when brctl meets virsh


Hypervisors diversity is definitely one of the benefits of having Nuage managing your next-generation network. That means that we, as Nuage engineers, have to play with all kinds of hypervisors — like KVM, ESXi and Hyper-V to be more precise. As to me, I love to work with KVM most, simply because it gives you that feel that you are in control and can fine-tune or troubleshoot with granularity you want. Thanks to opensource tools like tcpdump, virsh, ss, top, brctl and many many others!

But these tools won’t fit perfectly for every situation every time. For example consider a simple case of a Linux host with a bunch of VMs connected via Linux bridges and answer a simple question: how to determine what VM names correspond to what virtual network interfaces connected to what bridges? I have to say that this question arises quite often when you troubleshoot network connectivity between VMs or gathering network stats.

And the answer to this question can not be provided with above mentioned tools without some scripting. Indeed, in this post I will share a script called brvirt which does the job by combining iproute2 and virsh outputs.

Link: Github repo.