===== Disk/LUN management =====
When you map a physical device from a VIOS to a LPAR, a logical device is created, called VTD.
**Virtual Target Device** (VTD) Name, is unique on a VIOS, it'a a label, but it cannot be changed easily.
* Map a LUN on a vhost:
# mkvdev -vdev hdisk4 -vadapter vhost6 -dev labotest_b1
* Map the same LUN on multiple vhost (LPAR):
# mkvdev -f -vdev hdisk4 -vadapter vhost7 -dev labotest123_b1
* Unmap a LUN from vhost (LPAR):
# rmvdev -vtd labotest123_b1
2 ways to change the VTD name:
* unmap and remap
* use **mig_name** option on VTD, and do a LPAR mobility
$ chdev -dev vtd01 -attr mig_name=mig_vtd01
===== VIOS tuning =====
Apply recommended settings
$ rulescfgset [ENTER]
Do you want to deploy default rules on top of the current system
settings now [y/N]?
Displays the differences between the factory default rules and the current system settings.
$ rules -o diff -d -s
Lists rules that will be deployed.
$ rules -o list
Lists the factory default rules.
$ rules -o list -d
Methods to disable rulescfgset message reminder after upgrading VIOS level
$ chdev -l viosrules0 -a motd=no
===== Which vhost on LPAR =====
* On an LPAR find the corresponding vhost on VIOS:
[root@nimsrv]/etc# echo "cvai" | kdb | grep vscsi
read vscsi_scsi_ptrs OK, ptr = 0x5AB0380
vscsi1 0x000007 0x0000000000 0x0 p550-vios1->vhost0
vscsi2 0x000007 0x0000000000 0x0 p550-vios2->vhost0
===== Which vfchost on LPAR =====
* On an LPAR find the corresponding vfchost on VIOS:
[root@arwen]/root # echo "vfcs" | kdb | grep fcs
(0)> vfcs
NAME ADDRESS STATE HOST HOST_ADAP OPENED NUM_ACTIVE
fcs2 0xF1000A00001EA000 0x0008 p7vios1 vfchost0 0x01 0x0000
fcs3 0xF1000A00001EC000 0x0008 p7vios1 vfchost1 0x01 0x0000
[root@nimsrv]/root/script/bin# kdb
START END
0000000000001000 00000000058A0000 start+000FD8
F00000002FF47600 F00000002FFDF9C8 __ublock+000000
000000002FF22FF4 000000002FF22FF8 environ+000000
000000002FF22FF8 000000002FF22FFC errno+000000
F1000F0A00000000 F1000F0A10000000 pvproc+000000
F1000F0A10000000 F1000F0A18000000 pvthread+000000
read vscsi_scsi_ptrs OK, ptr = 0x5AB0380
(0)> cvai
NAME STATE CMDS_ACTIVE ACTIVE_QUEUE HOST
vscsi1 0x000007 0x0000000000 0x0 p550-vios1->vhost0
vscsi2 0x000007 0x0000000000 0x0 p550-vios2->vhost0
(0)> quit
Starting with AIX 7.2 TL5 SP3 (and VIOS 3.1.3.00), AIX/Power system administrators can use an alternative to kdb for viewing VIOS "identifying info" from client AIX LPAR’s. i.e.
# cat /proc/sys/adapter/fc/fcs0/hostinfo
fcs0
VFC client adapter name : fcs0
Host partition name (VIOS) : vio1
VFC host adapter name : vfchost0
VFC host adapter location code : U9009.22A.7871D00-V3-C7
FC adapter name on VIOS : fcs2
FC adapter location code on VIOS : U78D3.001.WZS0AL9-P1-C8-T1
//Note// If your VIOS is not running the latest VIOS code, 3.1.3.00, you'll find that the "FC adapter name on VIOS" attribute will be blank
== You can mask theses informations on the VIOS ==
It is worth noting that you can prevent this information from being available to the client LPAR by changing the secure_va_info attribute on your 3.1.3.00 VIOS.
For example, if we were to change the secure_va_info value from no to yes, like so:
$ chdev -dev viosnpiv0 -attr secure_va_info=yes
viosnpiv0 changed
$ virtadapinfo -list
secure : yes
Then the client LPAR will see the following (Secure) output for that VIOS:
# cat /proc/sys/adapter/fc/fcs1/hostinfo
VFC client adapter name : fcs1
Host partition name (VIOS) : Secure
VFC host adapter name : Secure
VFC host adapter location code : Secure
FC adapter name on VIOS : Secure
FC adapter location code on VIOS : Secure
===== Virtual tape drive / library =====
https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/IBM+Removable+Media+on+IBM+i/page/Virtual+IO+Server+(VIOS)+partition+owned+SAS+and+USB+Tape+Drives
**Note:** The VIO Server cannot use Atape drive when attempting to virtualize a SAS tape drive such as the 3580 to AIX client lpar. The Atape driver can be used on the running AIX client lpar.
* Attach a tape drive to a virtual SCSI adapter (do not mix disks and tape on the same virtual SCSI):
$ mkvdev -vdev rmt0 -vadapter vhost3
vttape0 Available
$ lsmap -all
SVSA Physloc Client Partition ID
--------------- -------------------------------------------- ------------------
vhost3 U9117.MMD.1089BDP-V2-C16 0x00000017
VTD vttape0
Status Available
LUN 0x8100000000000000
Backing device rmt0
Physloc U2C4B.001.DBJG730-P2-C8-L1
Mirrored N/A
===== Network management =====
* Create an etherchannel 802.3ad (LACP):
# mkvdev -lnagg ent0 ent1 ent2 ent3 -attr mode=8023ad
* Create an etherchannel in failover mode:
# mkvdev -lnagg ent0 -attr backup_adapter=ent1
* Add or remove an adapter from an etherchannel (ent5):
# cfglnagg -add -parent ent5 ent4 ent1
# cfglnagg -rm -parent ent5 ent4 ent1
* Create a SEA (shared ethernet adapter), ent0(physical port), ent4(virtual port into VLAN 2,with flag external access and the right priority 1 or 2):
# mkvdev -sea ent0 -vadapter ent4 -default ent4 -defaultid 2 -attr ha_mode=auto
ent2 Available
en2
et2
* Create a SEA (shared ethernet adapter), as load sharing
# mkvdev -sea ent0 -vadapter ent1,ent2 -default ent1 -defaultid 1 -attr ha_mode=sharing
Do not specify a control channel adapter if you have a power7 with firmware higher than 7.8
* Force a SEA (ent2) as backup adapter:
# chdev -dev ent2 -attr ha_mode=standby
To check for a result, list errlog on both associated VIOS. Change again to auto to put it into normal mode.
* Put an IP and hostname on an adapter (en2 is the ethernet standard emulation on the SEA):
# mktcpip -hostname vio2 -interface en2 -inetaddr 9.3.5.137 -netmask 255.255.255.0 -gateway 9.3.5.41 -nsrvaddr 9.3.4.2 -nsrvdomain itsc.austin.ibm.com -start
===== What is the AIX command behind an ioscli command? =====
If you want to know what AIX command is behind the command you issued as user padmin yo can use a special debug mode:
$ export CLI_DEBUG=33
That's the output of the lsnports command in this mode:
$ lsnports
AIX: "/usr/lib/methods/viosmgr -t npiv -f query_fc_ports >/dev/null"
name physloc fabric tports aports swwpns awwpns
fcs0 U789C.001.DQDH231-P1-C2-T1 1 64 64 2048 2047
fcs1 U789C.001.DQDH231-P1-C2-T2 1 64 62 2048 2043
[root@viostst1]/home/padmin# ioscli ioslevel
AIX: "cat /usr/ios/cli/ios.level "
2.2.6.41
[root@viostst1]/home/padmin# cat /usr/ios/cli/ios.level
2.2.6.41
===== What options for a specific settings, for example disk =====
If you are unsure of the allowable value to use to deactivate the SCSI reserve lock, use
the following command to provide a list of allowable values:
# lsdev -dev hdisk6 -range reserve_policy