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:
- 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.
- 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:
- CPU Mode (capped/uncapped)
- CPU Weight
- CPU Min/Desired/Max
- Virtual CPU Min/Desired/Max
- Memory Min/Desired/Max
- Maximum Virtual Slots
- Virtual SCSI Slots
- Virtual Ethernet Slots
- Virtual Fibre Channel slots (NPIV)
- Physical I/O adapters
Installation / Use
Download the script from: https://sourceforge.net/projects/prdiff/files/
You must run the script from a server that has SSH keys setup with your HMC.
Usage ./prdiff.pl -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
Examples:
Check everything on frame p520:
./prdiff.pl -h hscroot@hmcserver1 -m p520
Check aix1 LPAR on frame p520:
./prdiff.pl -h hscroot@hmcserver1 -m p520 -l aix1
Explanation of Virtual Slot formatting:
Virtual SCSI:
slot_num/adapter_type/remote_lpar_id/remote_lpar_name/remote_slot_num/is_required
Virtual Fibre Channel (NPIV):
slot_num/adapter_type/remote_lpar_id/remote_lpar_name/remote_slot_num/wwpns/is_required
Virtual Ethernet:
slot_num/ieee_virtual_eth/port_vlan_id/addl_vlan_ids/trunk_priority/is_required
Change Log
Version 1.0 RC3 (12/02/12).
- Improved I/O adapter support - the physical address of the I/O adapter is now shown instead of the unfamiliar DRC index number.
- Several Bug fixes
- Quite a bit of code changes/improvements. Please let me know if you see any issues with this version or if it incorrectly reports differences or misses any differences. Thanks!
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!
- Improved Virtual Slot differences display. Virtual slots are first compared on the slot number, and then on the rest of the fields. So if a virtual adapter has the same slot number in the profile and in the running configuration it will be on the same line in the output, if any of the rest of the fields don't match it will still show as a difference.
- Will show if the currently running profile is the default or not
- When using the "-d" (Only show differences option) LPAR's with no differences are not shown at all
- New optional "-f" flag that will prompt user asking if they would like to save running configuration to profile for each LPAR that differences are found on. Note: This will overwrite the profile with the running config.
- Virtual Slots are sorted in the output
- Improved support for dedicated CPU LPAR's
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 ./prdiff.pl 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
http://pslot.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/>.