Let's start
1.
Check ha_mode on multiple shared ethernet adapter in VIO .
for i in `lsdev -Cc adapter | grep -i shared |awk '{print $1}'`
do
echo "-------shared SEA $i ha mode------ "
lsattr -El $i |grep -i ha_mode
sleep 2
done
≠==≠=========
Output will be:
All shared ethernet adapter in VIO and their ha_mode
2.Script to display shared ethernet adapter "state, priority and active status.
for i in `lsdev -Cc adapter | grep -i shared |awk '{print $1}'`
do
echo "-------shared SEA $i state priority and active status ------ "
entstat -d $i | grep -E "^ *state|priority.*Active"
echo "---------------------"
sleep 2
done
3.Script to change shared ethernet adapter "ha_mode" . This script useful for failover and failback.
If Unix admin execute following script on vio server on which shared ethernet adapter is primary it will become backup.
for i in `lsdev -Cc adapter | grep -i shared |awk '{print $1}'`
do
echo "-------shared SEA $i failover to partner VIO------ "
chdev -l $i -a ha_mode=standby
echo "---------------------"
sleep 2
done
4.If Unix admin execute following script on primary VIO where shared ethernet adapter already fail overed to its partner VIO because of some incident and admin wanted to failback from parter VIO or secondary VIO to primary VIO .
for i in `lsdev -Cc adapter | grep -i shared |awk '{print $1}'`
do
echo "-------shared SEA $i failback to primary VIO------ "
chdev -l $i -a ha_mode=auto
echo "---------------------"
sleep 2
done
Thanks!!!!