How to assign disks to AIX partition via VIO

root's picture

What I am showing you below is not hard at all but it needs extra attention and the steps must be followed accordingly.

First of all you must have the information regarding the assigned LUNS, either created by you or by the storage admin.
Once you have them, open 3 sessions: one to each VIO and another to the target partition. They will be referred below as gzv1, gzv2 and gzaix.

Scan for new devices on first VIO:

gzv1# cfgmgr

Now make sure the new disks correspond to the expected UIDs (you will have to do it for each one):

gzv1# pcmpath query device | grep -p hdiskXX | grep SERIAL

Once you have the disks visible to this VIO, force them to get pvid:

gzv1# chdev -l hdiskXX -a pv=yes

Also, it is important to get the attributes of the disk and make sure of the following parameters are met:

gzv1# lsattr -El hdiskXX

Algorithm		load_balance
hcheck_mode		nonactive
hcheck_interval	60
reserve_policy	no_reserve

If the parameters above are not met, make sure you modify them.

Now it's time to switch to the second VIO. You should get the disks with pvid already set. The disk numbers are not the same across the vios, they being automatically generated. You will search them by pvid.

gzv2# cfgmgr
gzv2# lspv

Switching to the target partition, you need first to get the partition number and convert it to hexadecimal:

gzaix# lparstat -i | grep 'Partition Number'

gzaix# echo "obase=16 ; N" | bc
where N is the partition number in decimal.

Back to the first VIO, as user padmin, find out to which vhost your partition corresponds (replace N with the value from above result):

gzv1# su - padmin
gzv1-padmin# lsmap -all | grep -e '^vhost' | grep -e 'N$'

Make sure you have the same output from the 2nd VIO:

gzv2-padmin# lsmap -all | grep -e '^vhost' | grep -e 'N$'

Assign the disk to the partition (with -dev you create a name - it is your choice to create it, according to your configuration and to find it easier)

gzv1-padmin# mkvdev -vdev hdiskXX -vadapter vhostXX -dev HOSTNAME_GB_NUM

Same command must be done on the 2nd vio. It is important to have the configurations perfectly mirrored across all VIOs.

gzv2-padmin# mkvdev -vdev hdiskXX -vadapter vhostXX -dev HOSTNAME_GB_NUM

Make sure that your disk is assigned:

gzv1-padmin# lsmap -vadapter vhostXX
gzv2-padmin# lsmap -vadapter vhostXX

Finally, head back to the target partition and scan for new devices:

gzaix# cfgmgr
gzaix# lspv

Also, make sure your freshly detected disk(s) has 2 paths:

gzaix# lspath | grep hdiskXX


Thou shalt not steal!

If you want to use this information on your own website, please remember: by doing copy/paste entirely it is always stealing and you should be ashamed of yourself! Have at least the decency to create your own text and comments and run the commands on your own servers and provide your output, not what I did!

Or at least link back to this website.

Recent content