Sunday, March 20, 2016

How to update vio server in aix?

How to upgrade vio server in aix?


Pre-requisite:
Make sure to check the existing vio version $ioslevel
Collect all the connected lpars to the VIO server
Take the mksysb backup of lpars and backupios, viosbr backup of vio servers.
Take note of the important output configuration files and lsmap -all output before the upgrade start.
To get the vio upgrade package from the below site or from your nim server if you got already.
  
Implementation steps:
Copy the vio upgrade package to the /home/padmin of the VIO servers.
The upgrade package has to be placed in /home/padmin
Login as padmin mode.
$updateios -commit    --> To Commit previous updates by running the updateios command.
$updateios –accept –install –dev /home/padmin/<vio package>   --> To upgrade the vio version.
$shutdown -restart   -->Reboot the vio server to complete the update.
$ioslevel     --> Check the latest vio level has been achieved.  

Important notes:
When upgrading to VIOS 2.2.0.10-FP-24
 Fix Pack 24 enables Role Based Access Control (RBAC) roles and authorizations for thepadmin user on the VIOS. Roles and authorizations are enabled immediately. If you upgrade to VIOS 2.2.0.10-FP-24 via the updateios command, the only two commands that you can run before the VIOS is rebooted are the shutdown and swrole commands.
$ swrole - PAdmin 
$ shutdown -restart
$ license -accept

    

Thursday, March 3, 2016

How to mapping a disk from vio server to lpar in aix?

How to mapping a disk from vio server to lpar in aix?

Note: The below procedure is to assume that we need to add a new virutal disk to the root volume group on the lpar, for that we need to map a new disk from vio server to the lpar. 

Hence as a aix admin i need to map a new disk from vio server to the lpar like below. There are several methods to accomplish this task. The below procedure is one of them.

-------------------------------------------------------------------------------------------------------------------------------------------
Find out the slot number of the vscsi

#lspv -> To check the disk present on the lpar
hdisk0          0006a7df4403b4a6                  rootvg                      active

# lspath -F "name,status,parent,connection" -l hdisk0
            hdisk0,Enabled,vscsi0,810000000000
            hdisk0,Enabled,vscsi1,810000000000

# lscfg -l vscsi0
  vscsi0           U9111.520.0000034-V10-C50-T1  Virtual SCSI Client Adapter

# lscfg -l vscsi1
  vscsi1           U9111.520.0000034-V10-C51-T1  Virtual SCSI Client Adapter

U9111.520.0000034 -> model and serial number
V10 -> lpar id
C50 and C51 is client slot number of the vhost adapter

-------------------------------------------------------------------------------------------------------------------------------------------

Find out the VIO server associated with the lpar using HMC

# lsrsrc IBM.ManagementServer or lsrsrc IBM.MCP
------ login to the hmc with the hscroot password

The below command is used to find out the vio server name and vhost info associated with the lpar


# lshwres -r virtualio --rsubtype scsi -m U9111-520-0000034 --filter lpar_ids=10 -F "slot_num,remote_slot_num,remote_lpar_name"

Note: we can replace “-m U9111-520-0001234” with the name of your managed system

50,50,vio_server1
51,51,vio_server2

The above output shows the client slot number, server slot number, and VIO server name.
-------------------------------------------------------------------------------------------------------------------------------------------
Find out the vhost assigned for the lpar

we can find the vhost info using the slot number 


#lsdev -slots|grep -i c50
output: vhost10

So the vhost10 is associated with our target lpar.

#lsmap -vadapter vhost10
SVSA            Physloc                                      Client Partition ID
--------------- -------------------------------------------- ------------------
vhost10          U9111.520.0000034-V2-C50                      0x0000000a

VTD                   indprodfin_rootvg
Status                Available
LUN                   0x8100000000000000
Backing device        hdisk43
Physloc               L5000000000000

the slot number is the “C50” part of the U9111.520.0000034-V2-C50. So we got the correct vhost.  (we can also confirm the 0x0000000a is the hexa decimal value of the lpar id 10.
and the pvid of the backing device is same as the pvid of the disk on the lpar.)
-------------------------------------------------------------------------------------------------------------------------------------------

Find out the free disk /unassigned disk on the vios which needs to be mapped.


$lspv -free

The above output will show the list of free disk which are available on the vio server and not mapped with any vhost.  or if we already talked with storage team and they provide the lun details then we can get the disk like below.

odmget CuAt|grep -i 4386   -> The command will list out the hdisk name.

we will take hdisk20 as a free disk for instance.

-------------------------------------------------------------------------------------------------------------------------------------------

Changing the attributes (reserve_policy and health check ) of the disk before mapping.

 As we have a dual vio set up, we need to change the reserve policy as no_reserve. Hence the disk is not hold by any of the vio server.


chdev -dev hdisk20 -attr reserve_policy=no_reserve
chdev -dev hdisk0 -attr hcheck_interval=60
-------------------------------------------------------------------------------------------------------------------------------------------

Mapping the disk to the vhost

syntax:      mkvdev -vdev <hdisk> -vadapter <vhost> -dev <VTD name>

mkvdev -vdev hdisk20 -vadapter vhost10 -dev indprodfin_rootvg

lsmap -vadapter vhost10
SVSA            Physloc                                      Client Partition ID
--------------- -------------------------------------------- ------------------
vhost10          U9111.520.0000034-V2-C50                      0x0000000a

VTD                   indprodfin_rootvg
Status                Available
LUN                   0x8100000000000000
Backing device        hdisk43
Physloc               L5000000000000


VTD                   indprodfin_rootvg1
Status                Available
LUN                   0x8200000000000000
Backing device        hdisk47
Physloc               L3000000000000

We confirm that the disk has been mapped successfully.

Now come to lpar and scan the new disk.
-------------------------------------------------------------------------------------------------------------------------------------------

Scanning the newly assigned disk on the lpar
#lspv 
hdisk0          0006a7df4403b4a6                  rootvg                      active

#cfgmgr     --> scanning the server

#lspv
hdisk0          0006a7df4403b4a6                  rootvg                      active
hdisk1              0006a7dfd9f11858                none

------------we got the newly added disk hdisk1

#lspath -l hdisk1
hdisk1,Enabled
hdisk1,Enabled
------------------------ confirmed that hdisk1 has a dual path.

# chdev -l hdisk1 -a hcheck_interval=20

#extendvg rootvg hdisk1

#lspv
hdisk0          0006a7df4403b4a6                  rootvg                      active
hdisk1              0006a7dfd9f11858               rootvg                      active





Tuesday, March 1, 2016

How to deal with SRC and Deamons in aix?

How to deal with SRC and Deamons in aix?


SRC is nothing but "System Resource Controller".

We can control individual subsystem or group of subsystem.  The subsystem divided into sub server and the subserver is known as deamon.

If you see the pid is associated with a deamon, then it is operative

If there is NO PID associated with the deamon, then it  is showing as inoperative.


For single subsystem

Action
Command
Example
List
lssrc -s <deamon>
lssrc -s nfsd
Start
startsrc -s <deamon>
startsrc -s nfsd
stop
stopsrc -s <deamon>
stopsrc -s nfsd
Refresh
refresh -s <deamon>
refresh -s nfsd


For group of subsystems

Action
Command
Example
List
lssrc -g <deamon>
lssrc -g nfs
Start
startsrc -g <deamon>
startsrc -g nfs
stop
stopsrc -g <deamon>
stopsrc -g nfs
Refresh
refresh -g <deamon>
refresh -g nfs




To list out all the deamon

lssrc -a

suppose if you dont know the exact name of the deamon then you can simply grep like below

lssrc -a|grep -i ntp




How to leave a system dump during reboot in aix?

How to leave a system dump during reboot in aix?


HMC command line:

chsystate -m managedSystemName -r lpar -n lparName -o dumprestart

or

chsystate -m managedSystemName -r lpar -n lparName -o dumprestart --immed=hung



HMC GUI mode

Systems Management->Servers -> Managed system -> Target LPAR -> task button -> operations -> restart -> dump option --> click ok



LPAR using padmin command on VIO server 

chsysstate -r lpar -o dumprestart --id PartitionID