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.

Saturday, 20 June 2015

Creating a SEA in a VIO

Contents

·         1 Creating a SEA in a VIO
·         2 Comments

Creating a SEA in a VIO

We will see how to create a SEA to bridge packets to client LPAR

Get the list of current devices in VIOs

$ lsdev -type adapter
name             status      description
ent0             Available   2-Port 10/100/1000 Base-TX PCI-Express Adapter (14104003)
ent1             Available   2-Port 10/100/1000 Base-TX PCI-Express Adapter (14104003)
ent2             Available   Virtual I/O Ethernet Adapter (l-lan)
fcs0             Available   8Gb PCI Express Dual Port FC Adapter (df1000f114108a03)
fcs1             Available   8Gb PCI Express Dual Port FC Adapter (df1000f114108a03)
pager0           Available   Pager Kernel Extension
vasi0            Available   Virtual Asynchronous Services Interface (VASI)
vbsd0            Available   Virtual Block Storage Device (VBSD)
vhost0           Available   Virtual SCSI Server Adapter
vsa0             Available   LPAR Virtual Serial Adapter
As seen above the VIOS already has a Virtual device and Physical device for bridging. If there are no virtual devices, we can create one from HMC
If you are adding a new device use 'cfgmgr' to 'see' the new device
Note down the names of the adapters needed to bridging
Here we have
Physical: ent0 Virtual: ent2
make sure that the physical interface properties are proper (Ex. Duplex, speed etc...)
If any of the interface has IP configuration, use 'rmtcpip' to remove them

Get the current slot information

$ lsdev -slots
# Slot                       Description       Device(s)
U8233.E8B.1000A1P-V7-C0      Virtual I/O Slot  vsa0
U8233.E8B.1000A1P-V7-C11     Virtual I/O Slot  ent2
U8233.E8B.1000A1P-V7-C12     Virtual I/O Slot  vhost0
U8233.E8B.1000A1P-V7-C32769  Virtual I/O Slot  vasi0

Create SEA

$ mkvdev -sea ent0 -vadapter ent2 -defaultid 7 -default ent2                    
ent3 Available                                                                  
en3                                                                             
et3          

details
§  -sea -- the physical adapter on which to create SEA
§  -vadapter -- the virtual adapter on which to create SEA (can give multiple virtual adapters)
§  -default -- the vitual adapter to use as default adapter
§  -defaultid -- The PVID to use for the SEA. (PVID for the SEA)
The additional VID will be automatically added by VIO, based on the virtual adapters.

verify the virtual device

$ lsdev -virtual                                                                
name             status      description                                        
ent2             Available   Virtual I/O Ethernet Adapter (l-lan)               
vasi0            Available   Virtual Asynchronous Services Interface (VASI)     
vbsd0            Available   Virtual Block Storage Device (VBSD)                
vhost0           Available   Virtual SCSI Server Adapter                        
vsa0             Available   LPAR Virtual Serial Adapter                        
ent3             Available   Shared Ethernet Adapter                            
$ lsdev -type adapter
name             status      description
ent0             Available   2-Port 10/100/1000 Base-TX PCI-Express Adapter (14104003)
ent1             Available   2-Port 10/100/1000 Base-TX PCI-Express Adapter (14104003)
ent2             Available   Virtual I/O Ethernet Adapter (l-lan)
ent3             Available   Shared Ethernet Adapter
fcs0             Available   8Gb PCI Express Dual Port FC Adapter (df1000f114108a03)
fcs1             Available   8Gb PCI Express Dual Port FC Adapter (df1000f114108a03)
pager0           Available   Pager Kernel Extension
vasi0            Available   Virtual Asynchronous Services Interface (VASI)
vbsd0            Available   Virtual Block Storage Device (VBSD)
vhost0           Available   Virtual SCSI Server Adapter
vsa0             Available   LPAR Virtual Serial Adapter

Get attributes of the SEA

$ lsdev -dev ent3 -attr
attribute     value    description                                                        user_settable
 
accounting    disabled Enable per-client accounting of network statistics                 True
ctl_chan               Control Channel adapter for SEA failover                           True
gvrp          no       Enable GARP VLAN Registration Protocol (GVRP)                      True
ha_mode       disabled High Availability Mode                                             True
jumbo_frames  no       Enable Gigabit Ethernet Jumbo Frames                               True
large_receive no       Enable receive TCP segment aggregation                             True
largesend     0        Enable Hardware Transmit TCP Resegmentation                        True
netaddr       0        Address to ping                                                    True
pvid          7        PVID to use for the SEA device                                     True
pvid_adapter  ent2     Default virtual adapter to use for non-VLAN-tagged packets         True
qos_mode      disabled N/A                                                                True
real_adapter  ent0     Physical adapter associated with the SEA                           True
thread        1        Thread mode enabled (1) or disabled (0)                            True
virt_adapters ent2     List of virtual adapters associated with the SEA (comma separated) True

Assigin an IP to SEA adaper

This is not necessary. You can create a another virtual adapter on the same VLAN on the SEA's PVID or vid, then assign an IP to it
$ mktcpip -hostname sys414_vios7 -interface en3 \                               
> -inetaddr 10.6.133.142 -netmask 255.255.255.0 \                               
> -gateway 10.6.133.254                          

you can try and ping an ip within your network to verify connectivity

get routing table

# netstat -rn
Routing tables
Destination        Gateway           Flags   Refs     Use  If   Exp  Groups
 
Route Tree for Protocol Family 2 (Internet):
default            10.6.133.254      UG        1        61 en3      -      -
10.6.133.0         10.6.133.142      UHSb      0         0 en3      -      -   =>
10.6.133/24        10.6.133.142      U         2        29 en3      -      -
10.6.133.142       127.0.0.1         UGHS      0         2 lo0      -      -
10.6.133.255       10.6.133.142      UHSb      0         0 en3      -      -
127/8              127.0.0.1         U         2        77 lo0      -      -
 
Route Tree for Protocol Family 24 (Internet v6):
::1                ::1               UH        0        54 lo0      -      -

or use 'lstcpip -routtable' as padmin

Create an VSCSI disk in AIX VIO

VSCSI is required to map disk to client LPARs
VIOS will 'own' the physical resource. The VIOS will present an virtual resource (virtual target device) to the LPAR. This virtual device is backed by a physical device



We need a virtual SCSI adapter in VIOS and client LPAR for presenting a disk to client LPAR. This relationship is one-to-one. That is, for every LPAR, there must be 2 virtual SCSI adapters. Once in VIOS and one in client LPAR 

VIO scsi

Contents

·         1 Get a list of scsi adapters
·         2 Get SCSI Mapping
·         3 get list of disks
·         4 Get the size of the disk
·         5 Get the LUN id of the disk
·         6 Get the VPD of the disk
·         7 Change the reserve policy
·         10 (Optional) create an LPAR

Get a list of scsi adapters

$ lsdev -type adapter
name             status      description
ent0             Available   2-Port 10/100/1000 Base-TX PCI-Express Adapter (14104003)
ent1             Available   2-Port 10/100/1000 Base-TX PCI-Express Adapter (14104003)
ent2             Available   Virtual I/O Ethernet Adapter (l-lan)
ent3             Available   Shared Ethernet Adapter
fcs0             Available   8Gb PCI Express Dual Port FC Adapter (df1000f114108a03)
fcs1             Available   8Gb PCI Express Dual Port FC Adapter (df1000f114108a03)
pager0           Available   Pager Kernel Extension
vasi0            Available   Virtual Asynchronous Services Interface (VASI)
vbsd0            Available   Virtual Block Storage Device (VBSD)
vhost0           Available   Virtual SCSI Server Adapter
vsa0             Available   LPAR Virtual Serial Adapter
$ lsdev -virtual | grep -i scsi
vhost0           Available   Virtual SCSI Server Adapter

Get SCSI Mapping

$ lsmap -all
SVSA            Physloc                                      Client Partition ID
--------------- -------------------------------------------- ------------------
vhost0          U8233.E8B.1000A1P-V7-C12                     0x00000000
 
VTD                   NO VIRTUAL TARGET DEVICE FOUND
 
$

get list of disks

$ lsdev -type disk
name             status      description
hdisk0           Available   MPIO Other FC SCSI Disk Drive
hdisk1           Available   MPIO Other FC SCSI Disk Drive
hdisk2           Available   MPIO Other FC SCSI Disk Drive
hdisk3           Available   MPIO Other FC SCSI Disk Drive
hdisk4           Available   MPIO Other FC SCSI Disk Drive
hdisk5           Available   MPIO Other FC SCSI Disk Drive
hdisk6           Available   MPIO Other FC SCSI Disk Drive
hdisk7           Available   MPIO Other FC SCSI Disk Drive
$
we will use hdisk1 for this example

Get the size of the disk

echo "bootinfo -s hdisk1 " | oem_setup_env

Get the LUN id of the disk

$ lsdev -dev hdisk1 -attr
attribute       value                                               description                      user_settable
 
PCM             PCM/friend/fcpother                                 Path Control Module              False
algorithm       fail_over                                           Algorithm                        True
clr_q           no                                                  Device CLEARS its Queue on error True
dist_err_pcnt   0                                                   Distributed Error Percentage     True
dist_tw_width   50                                                  Distributed Error Sample Time    True
hcheck_cmd      test_unit_rdy                                       Health Check Command             True
hcheck_interval 60                                                  Health Check Interval            True
hcheck_mode     nonactive                                           Health Check Mode                True
location                                                            Location Label                   True
lun_id          0x1000000000000                                     Logical Unit Number ID           False
lun_reset_spt   yes                                                 LUN Reset Supported              True
max_retry_delay 60                                                  Maximum Quiesce Time             True
max_transfer    0x40000                                             Maximum TRANSFER Size            True
node_name       0x500507680100b855                                  FC Node Name                     False
pvid            none                                                Physical volume identifier       False
q_err           yes                                                 Use QERR bit                     True
q_type          simple                                              Queuing TYPE                     True
queue_depth     1                                                   Queue DEPTH                      True
reassign_to     120                                                 REASSIGN time out value          True
reserve_policy  single_path                                         Reserve Policy                   True
rw_timeout      30                                                  READ/WRITE time out value        True
scsi_id         0x4d0d25                                            SCSI ID                          False
start_timeout   60                                                  START unit time out value        True
unique_id       3321360050768019102C0F000000000032F7904214503IBMfcp Unique device identifier         False
ww_name         0x500507680140b855                                  FC World Wide Name               False
Note the 'lun_id' value.

Get the VPD of the disk

$ lsdev -dev hdisk1 -vpd
  hdisk1           U5877.001.M09J131-P1-C6-T1-W500507680140B855-L1000000000000  MPIO Other FC SCSI Disk Drive
 
        Manufacturer................IBM
        Machine Type and Model......2145
        ROS Level and ID............30303030
        Serial Number...............2145
        Device Specific.(Z0)........0000063268181002
        Device Specific.(Z1)........
        Device Specific.(Z2)........
        Device Specific.(Z3)........
 
 
  PLATFORM SPECIFIC
 
  Name:  disk
    Node:  disk
    Device Type:  block
 

Change the reserve policy

$ chdev -dev hdisk1 -attr reserve_policy=no_reserve
hdisk1 changed
verify
$ lsdev -dev hdisk1 -attr | grep -i reserve_policy
reserve_policy  no_reserve                                          Reserve Policy                   True

Create a Virtual target device

$ mkvdev -vdev hdisk1 -vadapter vhost0 -dev sys414_lpar7
sys414_lpar7 Available
Details
§  -vdev -- the backing devic for the vdev
§  -vadapter -- the virtual adapter on the VIO to bind the vscsi disk
§  -dev -- the virtual device name that you want to assign

get the device mapping details

$ lsmap -vadapter vhost0
SVSA            Physloc                                      Client Partition ID
--------------- -------------------------------------------- ------------------
vhost0          U8233.E8B.1000A1P-V7-C12                     0x00000000
 
VTD                   sys414_lpar7
Status                Available
LUN                   0x8100000000000000
Backing device        hdisk1
Physloc               U5877.001.M09J131-P1-C6-T1-W500507680140B855-L1000000000000

(Optional) create an LPAR

Create an LPAR.. Follow the Wizzard...

When it asks for the virtual devices.. create a new Vitual SCSI device. Assign the server's virtual SCSI ID to this Virtual SCSI's 'Server Adapter id'
Example: