OpenStack Networking Cookbook
上QQ阅读APP看书,第一时间看更新

Viewing the virtual interface information on the compute node

As tenants, users can create a Network, Subnet, and Instances. However, the underlying physical and virtual network details are hidden from them. This is important because the tenants should focus on their business requirements instead of the specific implementation details.

However, the OpenStack administrators need to understand the physical and virtual networking details. This is required in order to troubleshoot any problems faced by the tenants. In this recipe, we will show you how an administrator can view the virtual interface (VIF) information for an instance running on a compute node.

Getting ready

As this recipe is described from the point of view of an administrator troubleshooting a tenant problem, the following information is required:

  • The Tenant Network name
  • The virtual machine instance whose VIF information is to be identified

How to do it…

The following steps will show you how to find the VIF information on a compute node:

  1. Log in to the OpenStack Horizon dashboard using a user ID with an administrative role.
  2. In the left navigation menu, click on Admin | System | Instances. On the right-hand side, you will see a list of all the virtual machine instances.
  3. Click the checkbox next to the virtual machine instance whose VIF details you want to see. Using the drop-down menu at the end of the row, select Console:
    How to do it…
  4. This should show the VNC console for the selected instance. Log in to the instance and execute the following command:
    $ ifconfig
    
  5. You should see an output similar to the following screen. Note down the IP address, 70.70.70.2 in this case, and the MAC address (fa:16:3e:76:cb:e5):
    How to do it…
  6. In the left navigation menu, click on Admin | System | Networks. Click on the name of the Network to which the instance belongs. This will display the Network Detail for that Network. Note the Segmentation ID (VLAN ID), which is 1002 in our example:
    How to do it…
  7. You can also see the list of the OpenStack ports for that Network. Our virtual machine instance had an IP address of 70.70.70.2 and there is a Port corresponding to this IP address. Click on the Port Name to view the Port Detail. Note that the MAC and IP addresses match our virtual machine:
    How to do it…
  8. Pay attention to the ID of the port, especially the first 11 characters, a22f8551-57.
  9. Now, log in to the compute node of your setup with the appropriate credentials and execute the following command:
    openstack@compute1:~$ sudo ovs-vsctl show
    
  10. You should see an output as follows. The key thing to note is the OVS port named qvoa22f8551-57. As you can see, this port name matches the ID of the OpenStack port used for our virtual machine instance:
    How to do it…
  11. The tag used for our qvoa22f8551-57 port is 3. This is the tag used in OVS. When OVS forwards the packets from our virtual machine to the outside world, it must tag it with the VLAN ID of 1002 (Segmentation ID). We can verify this using the ovs-ofctl dump-flows br-int command. This command prints all the network flow information for the specific Open vSwitch instance. See the following highlighted output:
    How to do it…

How it works…

The OpenStack entities such as Network, port, and others are assigned a unique ID when they are created. These unique IDs are reused while configuring the physical and virtual network so that troubleshooting is easier.

In the preceding example, we identified the port ID for the instance and using this ID, we were able to view the OVS and VLAN information on the compute node. These are usually the foremost steps in identifying the networking problems on a compute node.