For Single Server:

for vscsi in `lsdev -C |grep vscsi |grep Available |awk '{print $1}'`
do
host=`echo "cvai $vscsi" | kdb |grep partition_name |awk '{print $6}'`
vio=`echo "cvai $vscsi" | kdb |grep part_name |awk '{print $8}'`
vhost=`echo "cvai $vscsi" | kdb |grep host_name |awk '{print $6}'`
echo $vscsi,$vio,$vhost
done

Step 1: Choose a server where you can access all your LPAR’s
Step 2: Generate a key from the chosen server and then scp same key to LPAR under /root
Step 3: Now, You can execute the below script from chosen server

Note:- In our case, We have chosen NIM server as our source server where the script to be executed
server – Should contain LPAR or server name
Name of the script: vscsi_mapping.sh

echo Server Name,VSCSI,VIO Server,Vhost

for vscsi_mapping_list in `cat server`
do
for vscsi in `ssh $vscsi_mapping_list lsdev -C |grep vscsi |grep Available |awk '{print $1}'`
do
host=`ssh $vscsi_mapping_list "echo "cvai $vscsi" | kdb" |grep partition_name |awk '{print $6}'`
vio=`ssh $vscsi_mapping_list "echo "cvai $vscsi" | kdb" |grep part_name |awk '{print $8}'`
vhost=`ssh $vscsi_mapping_list "echo "cvai $vscsi" | kdb" |grep host_name |awk '{print $6}'`
echo $vscsi_mapping_list,$vscsi,$vio,$vhost
done
done