Wednesday, 17 December 2014

VIO COMMANDS


Vio Server Commands
--------------------
$ lsvg -pv rootvg
rootvg:
PV_NAME PV STATE TOTAL PPs FREE PPs FREE DISTRIBUTION
hdisk0 active 319 11 00..00..00..00..11
hdisk1 active 319 27 00..00..00..00..27

$ lsdev -dev hdisk0 -vpd
  hdisk0           U787B.001.DNW025F-P1-C5-T1-W500507630E0009E2-L4010400000000000  MPIO Other FC SCSI Disk Drive
$ ioslevel
2.1.0.0
$ lsmap -all
SVSA            Physloc                                      Client Partition ID
--------------- -------------------------------------------- ------------------
vhost0          U9113.550.10BE8DD-V1-C11                     0x00000003

VTD                   lpar1vg0
Status                Available
LUN                   0x8100000000000000
Backing device        lpar1_rootvg
Physloc

$ lstcpip

Name Mtu Network Address ZoneID Ipkts Ierrs Opkts Oerrs Coll
en2 1500 link#2        a6.24.d0.0.10.3 27642 0 8402 0 0
en2 1500 9.3.131 zlab081 27642 0 8402 0 0
lo0 16896 link#1 1197 0 1201 0 0
lo0 16896 127 localhost 1197 0 1201 0 0
lo0 16896 ::1 0 1197 0 1201 0 0

Cronjob for Virtual I/O Server with Fix Pack 8
-----------------------------------------------

The cron function was introduced to the padmin shell in VIOS 1.3 (fix pack 8). However, many commands fail when run from cron, even though they work when run from the CLI. Failing commands include mount <NFS directory> and backupios.
This is because /home/padmin/.profile is an important part of the CLI, changing the path and aliasing many commands. cron does not read a user's .profile, and so the commands fail. This is working as designed.
To enable cron to run commands in the same way as the CLI, the command should start with
/usr/ios/cli/ioscli
For example:
/usr/ios/cli/ioscli mount nimserver:/export /mnt          
/usr/ios/cli/ioscli backupios -file /mnt/vios_backup -mksysb
-----------------------------------------------
lsmap -vadapter vhost21
lstcpip -routtable
entstat -all <SEA adapter> | more

$ lsdev -dev hdisk3 -attr | grep lun_id
lun_id 0x3000000000000 Logical Unit Number ID False

$ lsdev -virtual | grep SCSI
vhost0 Available Virtual SCSI Server Adapter
»Here is example of the lsmap command output.
$ lsmap -all
SVSA Physloc Client Partition ID
--------------- -------------------------------------------- ------------------
vhost0 U8233.E8B.1084AER-V1-C12 0x00000000
VTD NO VIRTUAL TARGET DEVICE FOUND
»Note the virtual adapter slot number that

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


lsdev -virtual | grep -i ethernet
ent2 Available Virtual I/O Ethernet Adapter (l-lan)

$ lsdev -dev ent0 -attr media_speed
»Here is example output for this command:
value
Auto_Negotiation
»Here is an example for changing the media speed for adapter ent0. DO NOT ACTUALLY CHANGE THE ATTRIBUTE UNLESS IT IS NECESSARY:
$ chdev -dev ent0 -attr media_speed=100_Full_Duplex


The following example creates an SEA that maps the physical Ethernet adapter ent0 to the virtual Ethernet adapter ent2, using ent2 as the default adapter and 1 as the default VLAN ID. The IP configuration from the interface en0 is migrated to the interface en3 of the generated SEA.
$ mkvdev -sea ent0 -vadapter ent2 -default ent2 -defaultid 1 -migrate -auto
en0 changed
ent3 Available
en3
et3
en3 changed
inet0 changed


$ 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


$ mkvdev -vdev hdisk2 -vadapter vhost0 -dev lpar2_vtd
lpar2_vtd Available

$ lsdev -virtual | grep Shared
ent3 Available Shared Ethernet Adapter

In your virtual I/O server partition's console session, use the rmtcpip -interface <interface name> command to remove the virtual I/O server TCP/IP configuration. Specify the interface name of your SEA.
Student Exercises with hints
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
6-6 Power Virtualization I © Copyright IBM Corp. 2009, 2013
»Run the command:
$ rmtcpip -interface en3
Parameters to be reset:
Host name: No
Name server: No
Effective immediately: Yes
Routing: No
Answer y to Are you sure?
__ 5.In your Virtual I/O Server partition's console session, use the rmdev command to remove the existing SEA, and its associated interface devices. Use the SEA adapter name you wrote down in Step 3.
»If the SEA device is ent3, then run the following command sequence:
$ rmdev -dev ent3
$ rmdev -dev en3
$ rmdev -dev et3



$ entstat -all ent2 | grep VLAN
Invalid VLAN ID Packets: 0
Port VLAN ID: 10
VLAN Tag IDs: None
$ entstat -all ent3 | grep VLAN
Invalid VLAN ID Packets: 0
Port VLAN ID: 19
VLAN Tag IDs: None
__ 11.Use the entstat -all entX | grep Switch command to check that both virtual Ethernet adapters are using the default virtual switch ID ETHERNET0. If not, do not proceed. Check your VIO server profile configuration.
»Here is an example command and its output, which shows ent2 and ent3 using the switch ID ETHERNET0.
$ entstat -all ent2 | grep Switch
Switch ID: ETHERNET0
$ entstat -all ent3 | grep Switch
Switch ID: ETHERNET0

Run the following command to see the VLAN ID of the virtual Ethernet adapter on your client partition. Here is an example with VLAN 30 on lpar3:
$ entstat -d ent0 | grep "Port VLAN ID"
Port VLAN ID: 30

$ mkvdev -sea ent0 -vadapter ent2 -default ent2 -defaultid 30
-attr ctl_chan=ent3 ha_mode=auto


$ lstcpip -adapters
Ethernet adapters:
ent0 Available 00-00 2-Port 10/100/1000 Base-TX PCI-Express Adapter (14104003)
ent1 Available 00-01 2-Port 10/100/1000 Base-TX PCI-Express Adapter (14104003)
ent2 Available Virtual I/O Ethernet Adapter (l-lan)
ent3 Available Virtual I/O Ethernet Adapter (l-lan)
ent4 Available Shared Ethernet Adapter
»Alternatively, the lsdev | grep ent command could have been used to get this information.



$ lsmap -all -net
SVEA Physloc
------ --------------------------------------------
ent2 U8233.E8B.1084AER-V1-C11-T1
SEA ent4
Backing device ent0
Status Available
Physloc U5877.001.RCH8623-P1-C4-T1
SVEA Physloc
------ --------------------------------------------
ent3 U8233.E8B.1084AER-V1-C13-T1
SEA NO SHARED ETHERNET ADAPTER FOUND

•The state of the SEA adapter (primary or backup).
»Example command and output if your VIO is primary:
$ entstat -all ent4 | grep "^ *State"
State: PRIMARY
»Example command and output if your VIO is backup:
$ entstat -all ent4 | grep "^ *State"
State: BACKUP
Student Exercises with hints
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
6-14 Power Virtualization I © Copyright IBM Corp. 2009, 2013
•The trunk adapter priority value and whether the adapter is active.
»Example command and output if your VIO is Primary.
$ entstat -all ent4 | grep Priority
Priority:1
Priority:1 Active: True
»Example command and output if your VIO is Backup:
$ entstat -all ent4 | grep Priority
Priority:2
Priority:2 Active: False
•The control channel adapter name and its PVID.
»Example command and output:
$ entstat -all ent4 | grep "Control Channel"
Control Channel PVID: 19
Control Channel Adapter: ent3
»Some more SEA attributes can be seen using the lsdev command. You should see the following information if you run the lsdev -dev ent4 -attr command:
$ lsdev -dev ent4 -attr
$ lsdev -dev ent4 -attr
attribute value description user_settable
accounting disabled Enable per-client accounting of network statistics True
ctl_chan ent3 Control Channel adapter for SEA failover True
gvrp no Enable GARP VLAN Registration Protocol (GVRP) True
ha_mode auto 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 10 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


$ errlog -ls
--------------------------------------------------
LABEL: SEAHA_PRIMARY
IDENTIFIER: E136EAFA
Date/Time: Tue Jan 8 05:05:43 CET 2013
Sequence Number: 63
Machine Id: 00F015B34C00
Node Id: sys464_vios1
Class: H
Type: INFO
WPAR: Global
Resource Name: ent4
Resource Class: adapter
Resource Type: sea
Location:
Description
BECOME PRIMARY
Probable Causes
BECOME PRIMARY
Failure Causes
BECOME PRIMARY
Recommended Actions
BECOME PRIMARY
Detail Data
Become the Primary SEA
Student Exercises with hints
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
6-16 Power Virtualization I © Copyright IBM Corp. 2009, 2013
»You should see an entry in the error log similar to the following when you issue the errlog command on the secondary VIO server:
$ errlog -ls
---------------------------------------------------
LABEL: SEAHA_BACKUP
IDENTIFIER: 40D97644
Date/Time: Tue Jan 8 05:24:08 CET 2013
Sequence Number: 70
Machine Id: 00F015B34C00
Node Id: sys464_vios2
Class: H
Type: INFO
WPAR: Global
Resource Name: ent4
Resource Class: adapter
Resource Type: sea
Location:
Description
BECOME BACKUP
Probable Causes
BECOME BACKUP
Failure Causes
BECOME BACKUP
Recommended Actions
BECOME BACKUP
Detail Data
Become the Backup SEA


$ chdev -dev ent4 -attr ha_mode=standby
ent4 changed


$ cfgdev
$ lsdev -virtual | grep ^en
ent2 Available Virtual I/O Ethernet Adapter (l-lan)
ent3 Available Virtual I/O Ethernet Adapter (l-lan)
ent5 Available Virtual I/O Ethernet Adapter (l-lan)
ent4 Available Shared Ethernet Adapter

$ cfgdev
$ lsdev -virtual | grep vhost
vhost0 Available Virtual SCSI Server Adapter
vhost1 Available Virtual SCSI Server Adapter

lsmap -vadapter vhost0
SVSA Physloc Client Partition ID
--------------- -------------------------------------------- ------------------
vhost0 U8233.E8B.1084AER-V1-C12 0x00000015
VTD lpar1_vtd
Status Available
LUN 0x8100000000000000
Backing device hdisk1
Physloc U5877.001.RCH8623-P1-C6-T1-W500507680140B855-L1000000000000

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


$ shutdown -force

$ chpath -l hdisk0 -p vscsi1 -a priority=2
Path changed


$ lsdev -dev vfchost*
name status description
vfchost0 Available Virtual FC Server Adapter


$ lsmap -all -npiv
Name Physloc ClntID ClntName ClntOS
------------- ---------------------------------- ------ -------------- ------
vfchost0 U8233.E8B.1084AER-V1-C21 21
Status:NOT_LOGGED_IN
FC name: FC loc code:
Ports logged in:0
Flags:1<NOT_MAPPED,NOT_CONNECTED>
VFC client name: VFC client DRC:

$ lsdev -dev fcs*
name status description
fcs0 Available 8Gb PCI Express Dual Port FC Adapter (df1000f114108a03)
fcs1 Available 8Gb PCI Express Dual Port FC Adapter (df1000f114108a03)

Run the lsnports command to list the ports that are capable of N_Port ID virtualization (NPIV). Verify the fabric attribute is set to 1. This means the adapter and the SAN switch are NPIV ready.
»Example command and output:
$ lsnports
name physloc fabric tports aports swwpns awwpns
fcs0 U5877.001.RCH8623-P1-C6-T1 1 64 64 2048 2036
__ c.Run the vfcmap command to map your virtual Fibre Channel server adapter to the physical Fibre Channel adapter port fcs0.
»Here is an example, using the vfchost0 virtual adapter:
$ vfcmap -vadapter vfchost0 -fcp fcs0
vfchost0 changed


$ lsmap -all -npiv
Name Physloc ClntID ClntName ClntOS
------------- ---------------------------------- ------ -------------- ------
vfchost0 U8233.E8B.1084AER-V1-C21 21 sys464_lpar1 AIX
Status:LOGGED_IN
FC name:fcs0 FC loc code:U5877.001.RCH8623-P1-C6-T1
Ports logged in:1
Flags:a<LOGGED_IN,STRIP_MERGE>
VFC client name:fcs0 VFC client DRC:U8233.E8B.1084AER-V21-C21-T1




on aix
# chdev -l hdisk0 -a hcheck_interval=6 -P
# lspath -Ht -l hdisk0
status name parent path_id
Enabled hdisk0 vscsi0 0
Enabled hdisk0 vscsi1 1
# lspath -AHE -l hdisk0 -p vscsi0
attribute value description user_settable
priority 1 Priority True
# lspath -AHE -l hdisk0 -p vscsi1
attribute value description user_settable
priority 1 Priority True
»The output shows there are two paths available to hdisk0

# lspath -Ht
status name parent path_id
Enabled hdisk0 vscsi0 0
Enabled hdisk0 vscsi1 1

# lspath -Ht -l hdisk0
status name parent path_id
Enabled hdisk0 vscsi0 0
Enabled hdisk0 vscsi1 1
# chpath -l hdisk0 -p vscsi0 -a priority=2
path Changed
----------------------------------------------------------------------------------------------------------------------------------------------------
To get the lun numbers for the IBM XIV disks
---------------------------------------------
cd /opt/xiv
then run the below command
# xiv_devlist
It will provide us the lun number as well as the disk size.
----------------------------------------------------------------------------------------------------------------------------------------------------
o find the vio server from vio client.
kdb then enter
if vscsi type "cvai vscsi1" and enter
if vfcs type " vfcs fcs2"
----------------------------------------------------------------------------------------------------------------------------------------------------