digiturf.net

How to MAP a disk to LPAR which is provisioned to VIOs and add it to VG in LPAR Server

* * * FIRST and FOREMOST I’VE RECEIVED THE FOLLOWING DETAILS FROM STORAGE TEAM ABOUT “100 GB” LUN ALLOCATION.

Device ID  : 143
Device WWN : 600014400000001071206ebda58e4c9
size of the drive : 100 GB
Disk Mapped to servers “odc-vio1 & 2”

[root@odc-vio1:/] cfgmgr                    >> I’ve run this on both VIO servers.
[root@odc-vio1:/] lspv | tail
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
hdiskpower140     00c5dbb6f88d7bf4           None
hdisk916               none                                 None
hdiskpower143     none                                 None

* * * Then I’ve run the following command on “hdiskpower143” to verify and see if the “Device WWN” provided by Storage team is matching… and it did. rest of the commands after this are used to find more details on LUN.

[root@odc-vio1:/] powermt display dev=hdiskpower143
Pseudo name=hdiskpower143
VPLEX ID=CKM00132500764
Logical device ID=6000144000000010701206EBDA58E4C9
state=alive; policy=ADaptive; queued-IOs=0
==============================================================================
————— Host —————   – Stor –  — I/O Path —   — Stats —
###  HW Path               I/O Paths    Interf.  Mode     State   Q-IOs Errors
==============================================================================
1 fscsi0                 hdisk916    CL1-0E   active   alive      0      0
1 fscsi0                 hdisk915    CL1-02   active   alive      0      0
0 fscsi1                 hdisk914    CL1-0B   active   alive      0      0
0 fscsi1                 hdisk913    CL1-07   active   alive      0      0

[root@odc-vio1:/] lsattr -El hdiskpower143 -a lun_id
lun_id 0x8f000000000000 LUN ID False

[root@odc-vio1:/] lscfg -vl hdiskpower143
hdiskpower143    U78A0.001.DNWK6DG-P1-C2-T1-L389  PowerPath Device
Manufacturer…………….EMC
Machine Type and Model……Invista
ROS Level and ID…………5210
Serial Number……………CKM00132500764
Subsystem Vendor/Device ID..APM000824019860
Device Specific.(PQ)……..00
Device Specific.(VS)……..da58e4c9701206eb
Device Specific.(UI)……..6000144000000010701206EBDA58E4C9
FRU Label……………….0200
Device Specific.(Z0)……..10
Device Specific.(Z1)……..10

[root@odc-vio1:/] lsattr -El hdisk916 -a lun_id
lun_id 0x8f000000000000 Logical Unit Number ID False

[root@odc-vio1:/] lsattr -El hdisk915 -a lun_id
lun_id 0x8f000000000000 Logical Unit Number ID False

[root@odc-vio1:/] lsattr -El hdisk914 -a lun_id
lun_id 0x8f000000000000 Logical Unit Number ID False

[root@odc-vio1:/] lsattr -El hdisk913 -a lun_id
lun_id 0x8f000000000000 Logical Unit Number ID False

[padmin@odc-vio2:/home/padmin] lspv -free              -> This command only runs as “padmin” in VIO server which shows unallocated / non-used disks details.
NAME                  PVID                   SIZE(megabytes)
hdisk84                none                     51200
hdiskpower143    non                     102400

[padmin@odc-vio1:/home/padmin] lspv -free
NAME                  PVID                                SIZE(megabytes)
hdisk400              none                                 51200
hdiskpower143    none                                102400

[padmin@odc-vio2:/home/padmin] chdev -dev hdiskpower143 -attr pv=yes   -> ran as “padmin” user, this allocates the “PVID” to disk which makes it easy to locate the disks easily anywhere ( in LPAR and VIO’s ).
hdiskpower143 changed

[padmin@odc-vio1:/home/padmin] chdev -dev hdiskpower143 -attr pv=yes
hdiskpower143 changed

* * * NOW [padmin]# lspv -free , should show PVID to the ” disk – hdiskpower143 ” as shown below on both the servers. PVID will be same for a DISK on both the servers.

NAME                        PVID                         SIZE(megabytes)
hdiskpower143   00c5dbb6c39d6d74             102400            – Server “odc-vio1”
hdiskpower143   00c5dbb6c39d6d74             102400            – Server “odc-vio2”

* * * Now we need to identify “Virtual Host Device” on each VIO. For that 1st we need to find the “LPAR ID”. Here in this scenario LPAR server is “plussrv”, login to that server and execute the command ” # lparstat -i ” Which will give “LPAR (plussrv) ID” in DECIMAL format. Then We need to convert that from DECIMAL to HEXADECIMAL and then execute ” # lsmap ” command shown below in EACH of the VIO’s. ” Numeric 4 ” is Hexadecimal number that is mentioned in the command.

[root@plussrv:/] lparstat -i
Node Name                                  : plussrv
Partition Name                             : plussrv
Partition Number                           : 4
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – –

 * * * LPAR ID is nothing but, “LPAR Partition Number” as shown below. Numeric 4 is same in DEC & HEX.

[padmin@odc-vio1:/home/padmin] lsmap -all|grep vhost|grep 4
vhost0          U8204.E8A.065DBB6-V1-C15                     0x00000004

[padmin@odc-vio2:/home/padmin] lsmap -all|grep vhost|grep 4
vhost0          U8204.E8A.065DBB6-V2-C16                     0x00000004

* * * Now, we need to map the “Virtual SCSi Disk” to “vhost0” as per above output on both the VIO’s.

[padmin@odc-vio1:/home/padmin] mkvdev -vdev hdiskpower143 -vadapter vhost0 -dev plsrvtrmtrkvgd4
plsrvtrmtrkvgd4 Available

* * * Named “hdiskpower143” to “plsrvtrmtrkvgd4”, so that it can be easily understood to find to which server and “VG” it is allocated to…! Name of the disk should not be more than 15 characters.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

* * * While trying to execute the same # mkvdev command, encountered the following error in VIO2.

[padmin@odc-vio2:/home/padmin] mkvdev -vdev hdiskpower143 -vadapter vhost0 -dev plsrvtrmtrkvgd4
Cannot access a device.

[padmin@odc-vio2:/home/padmin] oem_setup_env
# cfgmgr
# chdev -l hdiskpower143 -a pv=yes -a reserve_policy=no_reserve hdiskpower143 changed

* * * After doing above 3 STEPS in VIO2, still the error ” Cannot access a device ” is coming. When i’ve executed the above 3 STEPS on “VIO1” i’ve got the following error.

# chdev -l hdiskpower143 -a pv=yes -a reserve_policy=no_reserve
Method error (/etc/methods/chgpowerdisk):
        0514-062 Cannot perform the requested function because the
                 specified device is busy.

* * * A nice way to know if the disk is locked by the other vio is doing a ” # bootinfo -s hdiskXX “, if output returned value is 0 instead of the disk size in Mb then something is wrong.I’ve got the following output.
      
[padmin@odc-vio2:/home/padmin] bootinfo -s hdiskpower143
102400

>> >> >> THE FOLLOWING STEPS HELPED OVERCOME THE ABOVE ERROR ” CANNOT ACCESS A DEVICE “.

[padmin@odc-vio1:/home/padmin] rmvdev -vtd plsrvtrmtrkvgd4         >> This is on VIO1 where i could successfully ran / used # mkvdev command.
dfplstrmtrkvgd4 deleted

* * * Following commands are executed on both the servers ” odc-vio[1,2] “.

[padmin@odc-vio1:/home/padmin] rmdev -dev hdiskpower143
hdiskpower143 deleted

[padmin@odc-vio1:/home/padmin] cfgdev

[padmin@odc-vio1:/home/padmin] chdev -dev hdiskpower143 -attr reserve_policy=no_reserve
hdiskpower143 changed

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

* * * After doing the above STEPS to solve / overcome ” Cannot access a device ” error on 2nd VIO, Finally i am able to successfully run ” # mkvdev ” on both the VIO servers.

[padmin@odc-vio1:/home/padmin] mkvdev -vdev hdiskpower143 -vadapter vhost0 -dev plsrvtrmtrkvgd4
plsrvtrmtrkvgd4 Available

[padmin@odc-vio2:/home/padmin] mkvdev -vdev hdiskpower143 -vadapter vhost0 -dev plsrvtrmtrkvgd4
plsrvtrmtrkvgd4 Available

* * * Now ” # lsmap ” should show the disk we’ve added to vhosts. Run the following command on both the VIO’s and Verify that it shows the disk on both of them.

[padmin@odc-vio1:/home/padmin] lsmap -vadapter vhost0 | grep -i plsrvtrmtrkvgd4
VTD                          plsrvtrmtrkvgd4                   _______________________________________________________________________________

* * * NOW, as a FINAL STEP is to login to LPAR Server “plussrv” and SCAN for new Disk and CONFIGURE it and then add to VG.

[root@plussrv:/] cfgmgr

[root@plussrv:/] lspv | egrep “00c5dbb6c39d6d74”         >> After scanning for new DEV’s, searching for disk with “PVID” which is assigned to it by running ” #chdev ” CMD on both VIO’s earlier.
hdisk162        00c5dbb6c39d6d74            None

* * * As the disk is mapped to LPAR Server “plussrv” from both the “VIO Servers”, now we need to add “hdisk162” to VG “trmtrkvg” in “plussrv” server as per requirement. Before adding the Disk to mentioned VG, please check the attributes of disk on if anything is to be changed.

[root@plussrv:/] lsattr -El hdisk162
PCM             PCM/friend/vscsi                 Path Control Module        False
algorithm       fail_over                        Algorithm                  True
hcheck_cmd      test_unit_rdy                    Health Check Command       True
hcheck_interval 0                                Health Check Interval      True
hcheck_mode     nonactive                        Health Check Mode          True
max_transfer    0x40000                          Maximum TRANSFER Size      True
pvid            00c5dbb6c39d6d740000000000000000 Physical volume identifier False
queue_depth     3                                Queue DEPTH                True
reserve_policy  no_reserve                       Reserve Policy             True

[root@plussrv:/] lspv | grep -i trmtrkvg         -Before adding the disk to VG, there are “3 Disks” available under this VG also see the “FREE PPs” Count.
hdisk118        003d081c28f46bf9                    trmtrkvg        active
hdisk136        003d081c2906a6ff                    trmtrkvg        active
hdisk153        003d081c07387d25                  trmtrkvg        active

[root@plussrv:/] lsvg trmtrkvg | grep -i “FREE PPs”
MAX LVs:            256           FREE PPs:       396 (50688 megabytes)

[root@plussrv:/] extendvg trmtrkvg hdisk162      -Adding “hdisk162” to “trmtrkvg” VG. Now check the # of disks and “FREE PPs” count on this VG, it should increase.

[root@plussrv:/] lspv | grep -i trmtrkvg
hdisk118        003d081c28f46bf9                    trmtrkvg        active
hdisk136        003d081c2906a6ff                    trmtrkvg        active
hdisk153        003d081c07387d25                  trmtrkvg        active
hdisk162        00c5dbb6c39d6d74                  trmtrkvg        active

[root@plussrv:/] lsvg trmtrkvg | grep -i “FREE PPs”
MAX LVs:            256                      FREE PPs:       1195 (152960 megabytes)

Leave a Reply