Tanti Technology

My photo
Bangalore, karnataka, India
Multi-platform UNIX systems consultant and administrator in mutualized and virtualized environments I have 4.5+ years experience in AIX system Administration field. This site will be helpful for system administrator in their day to day activities.Your comments on posts are welcome.This blog is all about IBM AIX Unix flavour. This blog will be used by System admins who will be using AIX in their work life. It can also be used for those newbies who want to get certifications in AIX Administration. This blog will be updated frequently to help the system admins and other new learners. DISCLAIMER: Please note that blog owner takes no responsibility of any kind for any type of data loss or damage by trying any of the command/method mentioned in this blog. You may use the commands/method/scripts on your own responsibility. If you find something useful, a comment would be appreciated to let other viewers also know that the solution/method work(ed) for you.

Friday 8 November 2013

How to find vhost assigned to a particular VIO Client?


Easiest method:      

Using two commands/steps we can easily find out the vhost information of the particular disk.



login to the vio client, and find out the disk's slot number ( for ex: hdisk1) 
                
                   Command:>  lscfg|grep hdisk1 
                   Output:>       hdisk1   U9133.55A.065040H-V21-C19  Virtual SCSI Server Adapter

login to the vio server and execute the below command to find out the vhost information of the particular disk.

                          Command:>  lsdev -slots|grep C19
                            Output:>       vhost3

Using the above output we can confirm that the vhost3 is assigned to the hdisk1.


New method:


Using kdb, we can easily trace the vscsi configuration in aix. This command will save much time when we compare with the old method to do the same.

In the old method, We can find out the slot number (like C13 or C14) of vscsi in the client server, after that login to the vio server and find out the appropriate vhost information for the vscsi.


#echo "cvai" | kdb | grep vscsi

read vscsi_scsi_ptrs OK, ptr = 0x59A03C0
vscsi0 0x000007 0x0000000000 0x0 vios1->vhost8
vscsi1 0x000007 0x0000000000 0x0 vios2->vhost8


Using above command from the client server to find out the appropriate VHOST information for our VSCSI and the name of the VIO servers as well.



Method One:


Login to the VIO client and get into the VG and make note of the PVID of the disk. Now login to the VIO Server and run "lsmap -all | more" and search the pvid of our VIO Client, now we can able to get the appropriate vhost name with the corresponding PVID.


Method Two:


As per Target's standard VTD naming convention, VTD name will contain the VIO client name & LUN ID of the disk used for backing device. So we can run a lsmap -all | more and find the VTD with VIO Client we are searching for. Below output shows that vhost3 is the Server SCSI adapter for VIO Client "testmachine"


$ lsmap -all | more
Physloc               U7311.D20.067DDBB-P1-C02-T1-L23

VTD                   esvdevcmsweb-42e
Status                Available
LUN                   0x9500000000000000
Backing device        hdiskpower16
Physloc               U7311.D20.067DDBB-P1-C02-T1-L19

SVSA            Physloc                                      Client Partition ID
--------------- -------------------------------------------- ------------------
vhost3          U9133.55A.065040H-V22-C16                    0x00000003

VTD                   testmachine-16
Status                Available
LUN                   0x8700000000000000
Backing device        hdiskpower54
Physloc               U7311.D20.067DDBB-P1-C02-T1-L113

VTD                   testmachine-15
Status                Available
LUN                   0x9200000000000000
Backing device        hdiskpower30
Physloc               U7311.D20.067DDBB-P1-C02-T1-L66


Method Three:


    * Login to VIO Client and get the Hardware location code for the virtual SCSI Client adapters (vscsi#) 

(root@testmachine)/> lsdev -Cc adapter | grep vscsi
vscsi0 Available  Virtual SCSI Client Adapter
vscsi1 Available  Virtual SCSI Client Adapter

(root@testmachine)/> lscfg -vl vscsi*

  vscsi1           U9245.55A.065040H-V3-C16-T1  Virtual SCSI Client Adapter

        Hardware Location Code......U9133.55A.065040H-V3-C16-T1

  vscsi0           U9245.55A.065040H-V3-C15-T1  Virtual SCSI Client Adapter

        Hardware Location Code......U9133.55A.065040H-V3-C15-T1

(root@testmachine)/>

In the above output make a note of the third column of the Hardware location code. C15 & C16, this is referred as Virtual Slot/ Adapter ID.

    * Login to both VIO servers and collect the hardware location codes of all virtual SCSI Server adapters (vhost#)

VIOS 1:

# lsdev -Cc adapter | grep vhost
vhost0    Available       Virtual SCSI Server Adapter
vhost1    Available       Virtual SCSI Server Adapter
vhost2    Available       Virtual SCSI Server Adapter
vhost3    Available       Virtual SCSI Server Adapter
vhost4    Available       Virtual SCSI Server Adapter
vhost5    Available       Virtual SCSI Server Adapter
# lscfg -vl vhost*
  vhost5           U9133.55A.065040H-V21-C19  Virtual SCSI Server Adapter

        Hardware Location Code......U9133.55A.065040H-V21-C19

  vhost4           U9133.55A.065040H-V21-C17  Virtual SCSI Server Adapter

        Hardware Location Code......U9133.55A.065040H-V21-C17

  vhost3           U9245.55A.065040H-V21-C15  Virtual SCSI Server Adapter

        Hardware Location Code......U9133.55A.065040H-V21-C15

  vhost2           U9133.55A.065040H-V21-C13  Virtual SCSI Server Adapter

        Hardware Location Code......U9133.55A.065040H-V21-C13

  vhost1           U9133.55A.065040H-V21-C11  Virtual SCSI Server Adapter

        Hardware Location Code......U9133.55A.065040H-V21-C11

  vhost0           U9133.55A.065040H-V21-C10  Virtual SCSI Server Adapter

        Hardware Location Code......U9133.55A.065040H-V21-C10

#


VIOS 2:

# lsdev -Cc adapter | grep vhost
vhost0    Available       Virtual SCSI Server Adapter
vhost1    Available       Virtual SCSI Server Adapter
vhost2    Available       Virtual SCSI Server Adapter
vhost3    Available       Virtual SCSI Server Adapter
vhost4    Available       Virtual SCSI Server Adapter
vhost5    Available       Virtual SCSI Server Adapter

# lscfg -vl vhost*
  vhost5           U9133.55A.065040H-V22-C20  Virtual SCSI Server Adapter

        Hardware Location Code......U9133.55A.065040H-V22-C20

  vhost4           U9133.55A.065040H-V22-C18  Virtual SCSI Server Adapter

        Hardware Location Code......U9133.55A.065040H-V22-C18

  vhost3           U9245.55A.065040H-V22-C16  Virtual SCSI Server Adapter

        Hardware Location Code......U9133.55A.065040H-V22-C16

  vhost2           U9133.55A.065040H-V22-C14  Virtual SCSI Server Adapter

        Hardware Location Code......U9133.55A.065040H-V22-C14

  vhost1           U9133.55A.065040H-V22-C12  Virtual SCSI Server Adapter

        Hardware Location Code......U9133.55A.065040H-V22-C12

  vhost0           U9133.55A.065040H-V22-C10  Virtual SCSI Server Adapter

        Hardware Location Code......U9133.55A.065040H-V22-C10

#

Same as VIO Client, third column of the Hardware location code of vhost represent the virtual slot in the VIO Server. Usually Devices will be mapped as per slots. That is, devices at the same slot will be connected together virtually. So any physical devices (physical disks, logical volumes, etc) mapped to a Virtual SCSI Server adapeter (vhost) will be accessible from the Virtual SCSI Client adapter in the same slot.

As per above Example outputs, vscsi0 has same slot as vhost3 of VIOS 1 and vscsi1 has same slot as vhost3 of VIOS 2. So the VIO client's vhost in VIO servers are, vhost3 in both VIO 1&2.

No comments:

Post a Comment