AIX RPM Dependency Hell
Anyone that’s ever worked in a mixed OS environment has surely encountered a time when they’ve needed to install rpm’s on AIX. Whether is was to get the latest GNU version of utilities for more flexible scripting, to support 3rd party monitoring tools, or because you’re developers were too lazy to properly compile installp bundles, we’ve almost all been there. It does, however, seem as if IBM added the rpm support and then has been on vacation ever since. The single most annoying limitation is the lack of dependency resolution. RPM “a” requires rpm’s “a-l” and each of those rpm’s require others, and it goes on and on and on. A simple port of YUM would be stupendous, but alas, we are left without. One man, Michael Perzl, of “http://www.perzl.org/” has graciously supported maintaining various rpm’s compiled for AIX and has even taken some great strides to setting up an infrastructure to support rpm dependency trees for AIX. Michael has setup the rpm distribution and has programmatically generated some dependency lists for those rpm’s. The last remaining step of the rpm dependency hell resolution is to have dependency lists for all rpm’s in the tree sorted and downloaded automatically. I think I’ve fixed the final piece with a script that recursively calls a function to build a list and download all unique rpm’s in the tree.. I’ve tested locally to much success, but as always, feel free to try it out and let me know if anything breaks. My tools are meant to be free, open, and a product of the larger Power community, so I’ve added this out to GitHub to make distribution easier.
Let me know if you have any questions or additions/corrections.
AIX RPM Dependency Script at GitHub
Scripts to the Rescue!
It’s been a while since I’ve added anything new to the site, but hopefully that will change soon. I’m no longer traveling every week and I’m back in a Production Shop so I should be able to generate some juicy content! While you all wait for that, I’m uploaded some scripts I’ve written for various things here and there to GitHub. Some are polished and have a good amount of logic….some are NOT! Feel free to peruse and hopefully they can be of use to someone out there.
https://github.com/jmsearcy/scripts/tree/master/AIX
I will eventually move these to a dedicated DDPWR GitHUb account, but they will be under my personal account for now. If you have any personal scripts you’re fond of, feel free to shoot them this way and I can add them to the collection (or add you to the repo on GitHub).
Enjoy!
Migrating an LV from one VG to another
In a perfect world you define a standard build (Golden Image), deploy it, and then let it be, never touching it again…..right? If you can answer “yes” to this, I’d like to shake your hand. In most of the environments I’ve worked in, even the term “standard” is relative. You have a patches that are released, configs that change, and technology that gets updated or made obsolete. There are many forces that would cause your beloved golden image to be made “null and void”. That being said, you sometimes have to revisit older machines deployed in the beginning and bring them up to new standards.
In a few environments, you may even be faced with picking up the pieces where other, less skilled folk, may have been in charge. This can often leave you scratching your head asking, “What in the heck were they thinking…” One common scenario I’ve encountered is when someone built the system and included application/database volumes within “rootvg”. Although not a complete wreck, I highly recommend not doing this, for more reasons than it’s worth to explain. This leads me to the topic if this post, how to migrate a logical volume from one volume group to another. Let’s dive in:
NOTE: This example shows how to migrate the “optopenv” LV from “rootvg’ to “nbuvg” and renames the LV to “nbu_optopenv_lv”
Create new VG (or use an existing VG)
1 | $ mkvg -S -y [vgname] -s [pp size in MB] [pv1] [pv2] ... |
EXAMPLE:
1 | $ mkvg -S -y nbuvg -s 512 hdisk3 |
Copy the LV to the new VG
NOTE: The LV being copied needs to be inactive for this, please make sure the associated FS is unmounted
1 | $ cplv -v [new vg] [lv name] |
EXAMPLE:
1 | $ cplv -v nbuvg optopenv |
NOTE: The new LV will have a generic name similar to “lv00”
Setup LV log
– For inline log FS’s
1 | $ logform /dev/[lvname] |
EXAMPLE:
1 | $ logform /dev/lv00 |
– For external log
1 | $ mklv -t jfs2log [vg name] 1 |
EXAMPLE:
1 | $ mklv -t jfs2log nbuvg 1 |
NOTE: this will create a new log LV similar to “loglv00”
1 | $ logform /dev/loglv00 |
Change the FS to reference the new log
– For inline log FS’s
1 | $ chfs -a /dev/[lv name] -a log=INLINE /filesystem |
EXAMPLE:
1 | $ chfs -a /dev/lv00 -a log=INLINE /opt/openv |
– For external log FS’s
1 | $ chfs -a /dev/[lv name] -a log=/dev/[log lv name] /filesystem |
EXAMPLE:
1 | $ chfs -a /dev/lv00 -a log=/dev/loglv00 /opt/openv |
Perform a FS integrity check
1 | $ fsck -p /dev/[lv name] |
EXAMPLE:
1 | $ fsck -p /dev/lv00 |
NOTE: It is common to receive errors after running fsck -p /dev/lvname prior to mounting the filesystem.
These errors are due to a known bug that development is currently aware of and which will be resolved in a future release of AIX.
Once the filesystem is mounted, a future fsck with the filesystem unmounted should no longer produce an error.
Mount the FS
1 | $ mount /[fs name] |
EXAMPLE:
1 | $ mount /opt/openv |
Remove old LV
1 | $ rmlv [old lv name] |
EXAMPLE:
1 | $ rmlv optopenv |
Rename new LV
1 | $ chlv -n [new name] [old name] |
EXAMPLE:
1 | $ chlv -n nbu_optopenv_lv lv00 |
DDPWR is now on Twitter!
You can now follow DDPWR on Twitter: @ddpwr
We’ll tweet a link for all new articles posted to give you even more ways to access our content.
PowerVM I/O Balancing Part I: VSCSI Traffic
This is the first part in a series of posts concerning balancing the I/O traffic of client LPARS across multiple VIOS. This part is focused on VSCSI traffic in a client LPAR configured with MPIO with paths coming from two VIOS. I’m not going to spend a lot of time describing what’s involved to get to this point just so I can keep these short and sweet. So let’s go ahead and dive in.
View the current priority for an individual path:
1 | $ lspath -l -p -E |
Example with output:
1 2 | $ lspath -l hdisk0 -p vscsi0 -E priority 1 Priority True |
To set priority for an individual path:
1 | $ chpath -l -p -a priority= |
Example:
1 | $ chpath -l hdisk0 -p vscsi1 -a priority=2 |
Simple right?! There’s really not much to it at all. The hard part is establishing your standard for how you balance traffic across your entire environment. Do you balance all odd number LPARS to VIOS1 and all even to VIOS2, do you split each managed system in half? That answer I can’t give you as it will depend on your specific scenario, as well as your needs. In ending this first part, here’s a short script you can use to set priority for all disks in an LPAR.
1 2 3 4 5 | for i in `lspv | awk '{ print $1 }'` do chpath -l $i -p vscsi1 -a priority=2 echo "$i's path for vscsi1 is now set to Priority 2" done |
[UPDATE]
Here’s a little more advanced script for setting the path priority based on an even/odd hdisk numbering scheme (ie. hdisk2, hdisk3, etc.)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 | #!/usr/bin/ksh # # PowerVM vSCSI Path Balancing Script # by: Joe M. Searcy # email: jmsearcy@thewebroot.com # # # This script is used to direct vSCSI path priority to "$VSCSI0" for all even numbered disks, and to # "$VSCSI1" for all odd number disks. This is to help balance the CPU/Memory load attributed to vSCSI # traffic across 2 VIO Servers. # # v1.0 -> 08-16-2012 # Initial script # # # Variables ###### EVENS="0" ODDS="1" TOTDISKS=`lspv | awk '{ print $1 }' | wc -l | sed 's/^ *//'` TOTDISKS2="$TOTDISKS" VSCSI0="vscsi0" VSCSI1="vscsi1" # Print total number of disks echo echo "Total disks in this system: $TOTDISKS" echo # Determine even or odd number of disks let x="$TOTDISKS % 2" if [ $x -gt 0 ] then ISODD=true else ISODD=false fi # Uncomment for DEBUG #echo "This is an odd number of disks: $ISODD" #echo # Main Routine if [ $ISODD == true ] then let LASTEVEN="$TOTDISKS - 1" let LASTODD="$TOTDISKS" echo "#### EVEN DISKS ############" echo while [ $EVENS -le $LASTEVEN ] do chpath -l hdisk$EVENS -p $VSCSI0 -a priority=1 chpath -l hdisk$EVENS -p $VSCSI1 -a priority=2 echo "hdisk$EVENS's path for $VSCSI0 is now set to Priority 1" ((EVENS+=2)) if [ $EVENS -gt $LASTEVEN ] then echo "No more even numbered disks." echo echo else echo "The next even numbered disk is \"hdisk$EVENS\"" echo fi done echo "#### ODD DISKS ############" echo while [ $ODDS -le $LASTODD ] do chpath -l hdisk$ODDS -p $VSCSI0 -a priority=2 chpath -l hdisk$ODDS -p $VSCSI1 -a priority=1 echo "hdisk$ODDS's path for $VSCSI1 is now set to Priority 2" ((ODDS+=2)) if [ $ODDS -gt $LASTODD ] then echo "No more odd numbered disks." echo echo else echo "The next odd numbered disk is \"hdisk$ODDS\"" echo fi done else let LASTEVEN="$TOTDISKS" let LASTODD="$TOTDISKS - 1" echo "#### EVEN DISKS ############" echo while [ $EVENS -le $LASTEVEN ] do chpath -l hdisk$EVENS -p $VSCSI0 -a priority=1 chpath -l hdisk$EVENS -p $VSCSI1 -a priority=2 echo "hdisk$EVENS's path for $VSCSI0 is now set to Priority 1" ((EVENS+=2)) if [ $EVENS -gt $LASTEVEN ] then echo "No more even numbered disks." echo echo else echo "The next even numbered disk is \"hdisk$EVENS\"" echo fi done echo "#### ODD DISKS ############" echo while [ $ODDS -le $LASTODD ] do chpath -l hdisk$ODDS -p $VSCSI0 -a priority=2 chpath -l hdisk$ODDS -p $VSCSI1 -a priority=1 echo "hdisk$ODDS's path for $VSCSI1 is now set to Priority 2" ((ODDS+=2)) if [ $ODDS -gt $LASTODD ] then echo "No more odd numbered disks." echo echo else echo "The next odd numbered disk is \"hdisk$ODDS\"" echo fi done fi exit |
[/UPDATE]
[UPDATE2]
Here’s yet another update. After helping a customer increase performance for an LPAR using vSCSI storage I developed this script to balance path priority in a situation where you may have multiple vSCSI server adapters. For example:
The customer has 200 LUN’s mapped in a round robin format across 8 different vSCSI server adapters (4 per VIOS using MPIO in the client).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 | #!/usr/bin/ksh93 # set -x # # PowerVM Multi-vSCSI Path Balancing Script # by: Joe M. Searcy # email: jmsearcy@us.ibm.com # # # This script is used to dynamically balance hdisk path priority across multiple vSCSI adapters # for all disks within a system. # # This was developed for customers who have vSCSI disks federated across multiple vSCSI adapters # for improved performance. # # v1.0 -> # 01-18-2013 - Joe Searcy -> Initial script # 01-18-2013 - Joe Searcy -> Added filter for non-vSCSI disks # 01-18-2013 - Joe Searcy -> Added logic for single path vSCSI disks # 01-25-2013 - Joe Searcy -> Fixed vSCSI count array arithmetic # 01-27-2013 - Joe Searcy -> Added some additional comments and configured to # perform changes instead of only echoing to stdout # 03-07-2014 - Joe Searcy -> Added debug mode and fixed variable values (stuff never removed from testing) # #### Variables #### DEBUG=echo LSPATH_OUT=`lspath` DISKLIST=`echo ${LSPATH_OUT} | awk '{print $2}' | sort -u | grep "vscsi"` VSCSILIST=`echo ${LSPATH_OUT} | awk '{print $3}' | sort -u | grep "vscsi" | sed 's/vscsi//'` #### Create Arrays #### typeset -a vscsiCountArray typeset -A path1Array typeset -A path2Array #### Build vscsiCountArray #### for vscsi in $VSCSILIST do vscsiCountArray[$vscsi]=0 done #### Build path1Array #### for hdisk in $DISKLIST do PATH1=`echo ${LSPATH_OUT} | grep "${hdisk} " | head -1 | awk '{ print $3 }' | sed s/vscsi//` path1Array[$hdisk]=$PATH1 done #### Build path2Array #### for hdisk in $DISKLIST do PATH2=`echo ${LSPATH_OUT} | grep "$hdisk " | tail -1 | awk '{ print $3 }' | sed s/vscsi//` path2Array[$hdisk]=$PATH2 done #### Main Loop to set path priority per hdisk #### for hdisk in $DISKLIST do PATH1=${path1Array[$hdisk]} PATH2=${path2Array[$hdisk]} if [ $PATH1 == $PATH2 ] then echo echo "Disk \"$hdisk\" does not have multiple paths" echo echo "#######################################################" echo else # Compare Path 1 count to Path 2 count and set priority if [ ${vscsiCountArray[$PATH1]} == ${vscsiCountArray[$PATH2]} ] then echo "$hdisk uses \"vscsi${path1Array[$hdisk]}\" & \"vscsi${path2Array[$hdisk]}\"" #### Begin DEBUG #### #echo "Path 1 count: ${vscsiCountArray[$PATH1]}" #echo "Path 2 count: ${vscsiCountArray[$PATH2]}" #echo #### End DEBUG #### echo # Actually change path priority (comment out for DEBUG) ${DEBUG} chpath -l $hdisk -p vscsi$PATH1 -a priority=1 ${DEBUG} chpath -l $hdisk -p vscsi$PATH2 -a priority=2 ((vscsiCountArray[$PATH1]+=1)) #### Begin DEBUG #### #echo "Path 1 count: ${vscsiCountArray[$PATH1]}" #echo "Path 2 count: ${vscsiCountArray[$PATH2]}" #### End DEBUG #### echo echo "#######################################################" echo else echo "$hdisk uses \"vscsi${path1Array[$hdisk]}\" & \"vscsi${path2Array[$hdisk]}\"" #### Begin DEBUG #### #echo "Path 1 count: ${vscsiCountArray[$PATH1]}" #echo "Path 2 count: ${vscsiCountArray[$PATH2]}" #### End DEBUG #### echo # Actually change path priority (comment out for DEBUG) ${DEBUG} chpath -l $hdisk -p vscsi$PATH1 -a priority=2 ${DEBUG} chpath -l $hdisk -p vscsi$PATH2 -a priority=1 ((vscsiCountArray[$PATH2]+=1)) #### Begin DEBUG #### #echo "Path 1 count: ${vscsiCountArray[$PATH1]}" #echo "Path 2 count: ${vscsiCountArray[$PATH2]}" #### End DEBUG #### echo echo "#######################################################" echo fi fi done |
Calling all Power Fanatics…
The desire I have for this site is to provide a place for the Power systems community to contribute practical knowledge that could be useful to an admin beginning his first day of work, all the way up to the seasoned grey beard. I’ve often scavenged the web in the heat of an outage for an article to help with the current situation, only to find that there aren’t many sites that provide brief or concise information to help. Typically I end up having to read through a ton of information that’s just not useful before I get to the meat of the solution. All of that being said, if you feel you have information that the viewers of this site could find useful, please send your article to submissions@ddpwr.com. Please only submit original articles.
Recent Comments