HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- primary alternate path script.
Operating System - HP-UX
1827775
Members
2601
Online
109969
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2004 05:31 AM
02-16-2004 05:31 AM
primary alternate path script.
Just looking for a script that checks to see if the paths are balanced. Also looking for a script to run if you need to balance the paths.
History: we build our VG's alternating between channels. But, on occasion, a path will fail and LVM adjusts to address this. However, once tha path becomes available again, LVM doesnt always fail back as hoped.
Therefore, I am hoping someone else has seen this and has written a script to alert on this condition, as well as simplify the resolution. I was told about a switchpath script, but couldnt find anything relating to it on itrc. Thanks,
History: we build our VG's alternating between channels. But, on occasion, a path will fail and LVM adjusts to address this. However, once tha path becomes available again, LVM doesnt always fail back as hoped.
Therefore, I am hoping someone else has seen this and has written a script to alert on this condition, as well as simplify the resolution. I was told about a switchpath script, but couldnt find anything relating to it on itrc. Thanks,
Wondeful, never had it so good...
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2004 06:22 AM
02-16-2004 06:22 AM
Re: primary alternate path script.
Hi,
Attached is one script I wrote long back that uses sar output and prints the %utililzation of each path. It may not give accurate information but gives a good idea on how the controllers are balanced.
As you said before, you don't need any script to switch the paths. As long as your /etc/lvmtab is defined correctly, the paths will switch back after the physical volumes are available again. I usually do the following to switch the alternate and primary paths. If your vg contains say c0t0d0, c0t1d0 with alternates c1t0d0 and c1t1d0, then
#vgreduce vgxx /dev/dsk/c0t1d0
#vgextend vgxx /dev/dsk/c0t1d0
will make c1t1d0 as the primary path.
-Sri
Attached is one script I wrote long back that uses sar output and prints the %utililzation of each path. It may not give accurate information but gives a good idea on how the controllers are balanced.
As you said before, you don't need any script to switch the paths. As long as your /etc/lvmtab is defined correctly, the paths will switch back after the physical volumes are available again. I usually do the following to switch the alternate and primary paths. If your vg contains say c0t0d0, c0t1d0 with alternates c1t0d0 and c1t1d0, then
#vgreduce vgxx /dev/dsk/c0t1d0
#vgextend vgxx /dev/dsk/c0t1d0
will make c1t1d0 as the primary path.
-Sri
You may be disappointed if you fail, but you are doomed if you don't try
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2004 07:03 AM
02-16-2004 07:03 AM
Re: primary alternate path script.
Thanks, A more detailed example of what we see on occasion is:
a VG should have a balance of 8 primary and 8 alternate. Sometimes we see an imbalance of 10 and 6.
I have a clunky script way of getting this information, but was hoping to see if anyone spent more time on it. Noting: The VG's where created in a balanced in the first place.
I create an input file per VG and that doesnt include any PVG data. I then use this command to test the primary alternate pairs.
grep /c7 Prialtlink_list|grep Alt|wc -l
I also was hoping for a script that autobalance using the pvchange -s option.
One of our HP reps told me about a script I think was called "switch paths" or something.
Anyone know anything about that. Thanks,
a VG should have a balance of 8 primary and 8 alternate. Sometimes we see an imbalance of 10 and 6.
I have a clunky script way of getting this information, but was hoping to see if anyone spent more time on it. Noting: The VG's where created in a balanced in the first place.
I create an input file per VG and that doesnt include any PVG data. I then use this command to test the primary alternate pairs.
grep /c7 Prialtlink_list|grep Alt|wc -l
I also was hoping for a script that autobalance using the pvchange -s option.
One of our HP reps told me about a script I think was called "switch paths" or something.
Anyone know anything about that. Thanks,
Wondeful, never had it so good...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2004 07:21 AM
02-16-2004 07:21 AM
Re: primary alternate path script.
Hi,
Since you have defined PVGs, you will need to parse out the information contained in the physical volume groups area of 'vgdisplay' command.
I would tend to write a small script that will do it for you. For ex.,
num_PRI=$(vgdisplay -v vgHDSAPP04 |sed -n '/--- Physical volumes ---/,/--- Physical volume groups ---/p' |grep "PV Name" |grep -v Alternate|wc -l)
num_ALT=$(vgdisplay -v vgHDSAPP04 |sed -n '/--- Physical volumes ---/,/--- Physical volume groups ---/p' |grep "PV Name" |grep Alternate|wc -l)
You can compare the above two and find the difference to see if all the alternate paths have been defined.
pvchange -s is to temporarily switch the paths. It will not sustain a reboot. You can probably write a script that goes into loop, checks for the load balance and alter tne paths accordingly. But the danger is if one PV is heavily utilized, your script will keep on switching the paths.
You can get good loadbalancing if you striped the logical volumes. If there are 4 disks in the stripe, you can define two with one path and other two with another path.
For true loadbalancing, you will need to use softwares like autopath, powerpath etc.,
-Sri
Since you have defined PVGs, you will need to parse out the information contained in the physical volume groups area of 'vgdisplay' command.
I would tend to write a small script that will do it for you. For ex.,
num_PRI=$(vgdisplay -v vgHDSAPP04 |sed -n '/--- Physical volumes ---/,/--- Physical volume groups ---/p' |grep "PV Name" |grep -v Alternate|wc -l)
num_ALT=$(vgdisplay -v vgHDSAPP04 |sed -n '/--- Physical volumes ---/,/--- Physical volume groups ---/p' |grep "PV Name" |grep Alternate|wc -l)
You can compare the above two and find the difference to see if all the alternate paths have been defined.
pvchange -s is to temporarily switch the paths. It will not sustain a reboot. You can probably write a script that goes into loop, checks for the load balance and alter tne paths accordingly. But the danger is if one PV is heavily utilized, your script will keep on switching the paths.
You can get good loadbalancing if you striped the logical volumes. If there are 4 disks in the stripe, you can define two with one path and other two with another path.
For true loadbalancing, you will need to use softwares like autopath, powerpath etc.,
-Sri
You may be disappointed if you fail, but you are doomed if you don't try
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP