vethgraph (Virtual Ethernet Graph) for visualizing Virtual Ethernet in a PowerVM environment

vethgraph is a Perl program designed to visualize the Virtual Ethernet adapters in a PowerVM environment. 

It centers around the VLAN's that are defined when Virtual Ethernet adapters are created. 

Each "trunk" adapter (which are generally on VIO servers) are given a unique color so you can easily identify each VIO server throughout the graph.   There are various options to highlight different parts of the graph like a specific LPAR or specific slot number.   It is also possible to only graph an individual VLAN. 

Since the graph revolves around VLAN's, LPAR's might appear in multiple places in the graph if they are a member of multiple VLAN's.   Use the LPAR highlighting feature to easily identify a specific LPAR on the graph.

NOTE: This version does not include support for Virtual Switches that are supported on POWER6 and later servers.   I am developing this script on my personal POWER5 server at home that doesn't support Virtual Switches.   The graph should still work on POWER6 and POWER7 servers that don't utilize Virtual Switches, but may not display correct results on servers that have Virtual Switches in use.  

Here is a example screenshot:

screenshot1



This can be helpful to validate your configuration is setup how you want and for documentation purposes.  

vethgraph Screen Shots

This screen shot shows how the graph can optionally be filtered down to only include a specific VLAN (-v flag)


screenshot2



Here is a screenshot showing the "highlight LPAR" mode (-l flag) which highlights a specified LPAR for easy identification:


screenshot3


This screen shot shows the "highlight slot" mode (-s flag) where a specified slot number is highlighted:

screenshot4

Installation / Use

Download the script from:  https://sourceforge.net/projects/vethgraph/files/

You must run the script from a server that has SSH keys setup with your HMC.  

Usage ./vethgraph.pl -h hmcserver -m managedsystem [-v vlan] [-l highlight_lpar] [-s highlight_slot]
 -h specifies hmcserver name (can also be username@hmc)
 -m specifies managed system name
 [-v vlan]  only graph specified VLAN (i.e. - "-v 4")
 [-l LPAR]  Highlight specified LPAR (i.e. - "-l aixlpar01")
 [-s slot#]  Highlight specified slot (i.e. - "-s 20")

Examples:
Graph all:
   ./vethgraph.pl -h hscroot@hmcserver1 -m p520
Graph only VLAN 4:
   ./vethgraph.pl -h hscroot@hmcserver1 -m p520 -v 4
Graph all, highlight aixlpar01:
   ./vethgraph.pl -h hscroot@hmcserver1 -m p520 -l aixlpar01


The script produces DOT code that Graphviz can turn in to a graph.  You will need to have Graphviz installed somewhere to produce the graph.  

Note that vethgraph uses the "circo" Graphviz command to create the graphs, NOT the "dot" command. 

You have the following options on where to install Graphviz:

If you have Graphviz installed on the computer you are running the script from you can run vethgraph.pl and pipe the output to the graphviz circo command to create the graph like this:

./vethgraph.pl -h hscroot@hmcserver1 -m p520  | circo -Tpng -o vethgraph.png

If you have graphviz installed on a different computer from where you are running the vethgraph.pl script, do this:   Run vethgraph.pl and redirect the output to a file.   Transfer this file to where you have graphviz installed and run a command like this:


  cat output.txt | circo -Tpng -o vethgraph.png


Related scripts

http://pslot.sourceforge.net/

http://graphlvm.sourceforge.net/

http://npivgraph.sourceforge.net/

About the author / Contacting the author

Script was written by Brian Smith.  I have an IBM developerWorks blog at:  Brian's AIX/UNIX/Linux blog

You can contact me at:   ixbrian at gmail dot com

License / Disclaimer

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.