Gracefully disabling paths for a Virtual SCSI adapter before VIO Server maintenance
brian_s 270002K5X3 Comment (1) Visits (6832)
I recently got a question about how to script disabling paths for a Virtual SCSI adapter so you can prepare to take a VIO server down for maintenance.
Of course you can just take down the VIO server and the Virtual SCSI will failover to the other path, however it is generally more graceful and less impactful to use the chpath command to disable the path by lowering it's priority.
Lets suppose we want to take down the "VIO2" server which on the AIX client maps back to vscsi1. If you are not sure which vscsi adapters map to which VIO servers, then check out my previous posting/script: AIX/
So in this scenario we want to disable all the paths on "vscsi1" on an AIX client (you would need to do this same procedure on each AIX client of the VIO server). But first, we want to record what the current settings are so we can restore them back after the maintenance.
If we run this one liner, it will show the CURRENT path priority settings for everything on "vscsi1" on our AIX client in the form of command lines to set the priorities. We can save this off and simply run these commands after the VIO maintenance to restore everything like it was originally.
The output will look something like this. Again, note that this command doesn't actually change anything - it just shows you the command lines needed to get back to your original settings.
Now, we can run this command line to set the priority to 255 for all vscsi1 paths which should cause the traffic to switchover to the other vscsi path.
The output will look something like this:
After the VIO maintenance is complete, you can simply run the commands you had previously recorded and it will restore your original VSCSI path priority settings.