prdiff - Show differences between LPAR Profile and Running configuration on IBM POWER servers

prdiff is a Perl program designed to show the differences between the saved profile of an LPAR and its currently running configuration. 

Any time a server is shut down and then reactivated there is a potential for problems.   If changes were DLPAR'd in to the LPAR while it was running and not saved to its profile, the next time it is shut down and restarted it might have the wrong amount of resources or might not even boot.   Troubleshooting a non-booting LPAR in this state is very difficult. 

Profiles and the running configuration get out of sync in 2 different ways:
  1. Changes are DLPAR'd to the running server and not saved to the profile.   This can include CPU, Memory, weight, CPU mode, Virtual devices, physical I/O devices, etc.
  2. Changes are made to the profile of a running server.   Anything can be changed in the profile, but it doesn't take effect until the next shutdown / restart of the LPAR.  So even without DLPAR things can get out of sync. 
prdiff compares the profile and the running configuration and produces a report. 

Below is a screen shot of the report prdiff produces:


The following items are compared:

Installation / Use

Download the script from:

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

Usage ./ -h hmcserver -m managedsystem [-l lpar] [-c] [-d] [-f]
 -h specifies hmcserver name (can also be username@hmc)
 -m specifies managed system name
 [-l lpar] optionally only check specific lpar
 [-c] Disable Color output
 [-d] Only show differences
 [-f] For LPAR's with differences, prompt user to ask
      if the running config should be saved to the profile

Check everything on frame p520:
   ./ -h hscroot@hmcserver1 -m p520
Check aix1 LPAR on frame p520:
   ./ -h hscroot@hmcserver1 -m p520 -l aix1

Explanation of Virtual Slot formatting:
  Virtual SCSI:
  Virtual Fibre Channel (NPIV):
  Virtual Ethernet:

Change Log

Version 1.0 RC3 (12/02/12). 
Version 1.0 RC2 (11/26/12).  Fixed issue with physical I/O adapter comparisions.   Added explanation for Physical I/O adapters to usage statement. 

Version 1.0 RC1  (11/25/12).   Note that a signifigant amount of the comparision logic was changed in this version to support the new features below.   Please let me know if you see any issues with this version or prdiff incorrectly reports differences or misses any differences.   Thanks!

Version 0.6 (11/20/12) - Fixed issue with Virtual Ethernet comparisons (running configuration was incorrectly looking at is_trunk, rather than trunk_priority).  Thanks to Sebastian Thomas for reporting. 

Version 0.5 (11/19/12) - Added explanation for Virtual Slot formatting in prdiff help (just run ./ to display).   Improved support for dedicated CPU LPAR's. 

Version 0.4 (11/16/12) - Now supports Virtual Fibre Channel (NPIV) adapters.  Improved support for dedicated CPU LPAR's. 

Version 0.3 (11/13/12) - Virtual Ethernet VLAN's are now sorted before comparision so that they compare correctly even if running config and profile list different VLAN orders. 

Version 0.2 (10/19/12) - Fixed issue with comparing Virtual Ethernet adapters that contained multiple VLAN's

Version 0.1 (10/14/12) - Initial release

Related scripts

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
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 <>.