Description

In OpenContrail, there are two types of VMs (virtual machines) that can be spawned:

  1. VMs running general applications.
  2. VMs running network services such as a virtual load balancer or a virtual firewall.
Regardless of the type of VM spawned, an associated tap interface is also created on the compute node host. The number of tap interfaces spawned depends on the number of interfaces a VM contains. For example, a vSRX service instance may contain left and right interfaces which translates to multiple tap interfaces on the compute node.

This article describes using the CLI method to find the associated tap interface for a VM running on Contrail.

Symptoms

What is the tap interface associated with the VM instance's interface on Contrail? The tap interface information can be used to debug connectivity issues using tools such as tcpdump.

Solution

Navigate to http:// <openstak-ip> /horizon/admin/instances / and note the following:

  • IP address of the VM/Interface for which the associated tap interface is to be found. The ‘IP Address’ column of the web page can be used for this.
  • The physical host point that the VM is spawned on. The ‘Host’ column of the web page can be used for this.

In the following screenshot, we are trying to find the associated tap interface for the VM with the IP address 10.10.10.6 .

alt

Notice the virtual machine with the IP 10.10.10.6 is sitting on compute node host ‘ host1 ’.

After the items above are determined, ssh to the compute node hosting the VM. In this example, it is ‘host1’. Then run the following commands:

root@host1:~# source /etc/contrail/openstackrc

root@host1:~# cd /etc/libvirt/qemu/

root@host1:/etc/libvirt/qemu# nova list | grep 10.10.10.6 | cut -d "|" -f2
8335b3f7-def1-43e8-9f55-fbef670e39e7

The above output provides the UUID of the instance. Use this output as a parameter for grep in the following command to find out the tap interface associated:

root@host1:/etc/libvirt/qemu# grep "8335b3f7-def1-43e8-9f55-fbef670e39e7" *.xml | awk '{print $1}' | head -1 | cut -d ":" -f1 | xargs cat | grep tap
<target dev='tap4e3a2fe8-7d'/>

The associated tap interface of the VM’s interface bearing the IP address 10.10.10.6 is tap4e3a2fe8-7d .