Friday, August 19, 2016

How to deal with VIO in aix?

How to deal with VIO in aix?


OS Management :



To display VIO Server level:
# ioslevel
To update the IOS software:
# updateios –dev /update
To installs a new filesets (mainly used for TL updates):
# updateios –dev /cd0 -install -accept
To commit all applied :
# updateios –commit
To rejects all uncommitted updates :
# updateios –reject
To clean all incomplete pieces of the preVIOus installation :
# updateios –clean
To remove a fileset :
# updateios –remove fileset_name
Just verifies the backup available in a tape :
# backupios –tape /dev/rmt0 -verify
Generates backup to a file. No user VGs are -nosvg back’d up :
# backupios –file /opt/file1
To display the underlying AIX OS version :
# oem_platform_level
To open a non-restricted root shell :
# oem_setup_env


License Management:



To display the current license :
# license –view
To accept the license :
# license –accept
To view if the license has been accepted :
# license
To list all the installed software and their history
# license –hist


Management of Virtual Terminals:



To open a virtual terminal for partition with id 2 :
# mkvt –id
To close a virtual terminal for a partition with id 2 :
# rmvt –id 2
To configures the devices in the VIO server :
# cfgdev
To configures the devices attached to scsi0 adapter :
# cfgdev –dev scsi0
To unconfigure the cd-rom device :
# rmdev –dev cd0




List Device Mapping:



To list all vtd and backing devices mapped to vhost2 :
# lsmap -vadapter vhost2
To list SEA and physical device mapped to ent4 :
# lsmap -vadapter ent4 –net
To list all vtd and back devices where backing devices are of type LV :
# lsmap -all -type lv
To list all network mapping :
# lsmap –all –net


List Devices :



To display all the devices :
# lsdev
To display all the virtual devices :
# lsdev –virtual
To display all the virtual adapters :
# lsdev –type adapter –virtual
To display all the slots :
# lsdev –slot s
To display all the adapters :
# lsdev –type adapter
To display parent device of a device :
# lsdev –dev hdisk0 -field parent
To list disks names and physical location alone :
# lsdev -type disk -field name physloc


Management of Virtual/Shared Devices:

 To create mapping with lv20 and vhost0
# mkvdev -vdev lv20 -vadapter vhost0
 To create mapping with hdisk6 and vhost2
# mkvdev -vdev hdisk6 -vadapter vhost2
To create a SEA that maps phy Ethernet ent4 as a vir.adap to clien

Virtual Ethernet adapters ent6 & ent7, using ent6
 # mkvdev -sea ent4 -vadapter ent6,ent7 -default ent6 -defaultid 8
To remove a specific virtual target device :
# rmvdev –vtd vtscsi10




Saturday, July 16, 2016

How to create a filesystem in hacmp cluster in aix?

How to create a filesystem in hacmp cluster in aix?


1. Ground work:

#lslpp -l|grep -i cluster.es.server.rte     --> To check the current version of the cluster
#clRGinfo                            --> Check if the RG is online status.
#cllsvg               --> check the cluster volume group names
#lsvg -o              --> check the active volume group.
#lsvg <volume group>    --> To check the free space of the VG where you create FS.
#lsrsrc -ls clstrmgrES     --> To check the cluster is stable on both nodes.


2. Implementation steps

#smitty hacmp
     system management (c-spoc)
         HACMP logical volume management
             shared filesystem
                Enhance journal file systems
                  Add an Enhanced journal file systems
                     (Select the VG where we need to create a filesystem)
                        (update the name of the FS (like abcdFS) and size of theFS)
                                    Press Enter

Note: The filesystem get mounted once it gets created
#lsvg -l <volume group>      --> Check and confirm the filesystem created
The filesystem will be added by hacmp on the secondary node
Check the directory on the secondary node:  #ls -ld /abcdFS

3. Validation

#df -gt /abcdFS    --> To confirm the version has been upgraded.



Friday, July 15, 2016

How to upgrade HACMP version in aix?

How to upgrade HACMP - Cluster version in aix?


1. Ground work:

#lslpp -l|grep -i cluster.es.server.rte     --> To check the current version of the cluster
#./clRGinfo                            --> Check if the RG is online status.
#lssrc -ls clstrmgrES               --> check if the cluster manager is stable on both nodes
#smitty hacmp ->
    Extended configuration
      snapshot configuration
        Create a snapshot of the cluster configuration  (Mandatory -snap name and description)
             output: .info and .odm file created (Required this for restoration)

#/var/hacmp/clverify/clverify.log   --> check clverify has no errors
#emgr -l                                          --> Check if the emergency fixes there on the server
#emgr -rL                                          --> To remove the emergency fix.
Check Download the hacmp upgrade filesets from fixcentral and save it in rootvg directory.

2. Implementation steps

Stop the cluster services on both the nodes.
#lssrc -ls clstrmgrES                    --> check if the cluster manager is st_stable on both nodes
#smitty hacmp
     system management (c-spoc)
         manage hacmp services
             stop cluster services  (now, select node/noes and bring resource groups offline)

#lssrc -ls clstrmgrES                    --> Now the cluster manager demon should be ST_INIT
#lslpp -l|grep -i cluster.es.server.rte   --> To check the current version of hacmp
#cd <package_located directory>
#smitty update_all        -- > Do the preview first and commit next, once done follow below
#lslpp -l|grep -i cluster.es.server.rte    --> To confirm the version has been upgraded.
Reboot the node and perform the upgrade on the other node.
#smitty hacmp
     system management (c-spoc)
         manage hacmp services
             start cluster services  (now, select node/node names, automatically)

#/tmp/hacmp.out                      --> To check any error and warnings


3. Validation

#lslpp -l|grep -i cluster.es.server.rte    --> To confirm the version has been upgraded.
#lppchk –v                                           --> No output should displayed, only the prompt
#./clRGinfo                                         --> To check the RG is online as before.
#lssrc -ls clstrmgrES                            --> To check if the cluster manager is stable (ST_Stable)



Tuesday, July 12, 2016

How to capture the screen into the file in aix?

How to capture the screen into the file in aix?


Being as a system admin, whenever you are doing the task, you copy the screen and paste it on your notepad for your future reference.  Instead of notepad, you can save it on the server itself using the "script" command

#script

The output file name is "typescript"

so whatever you type on the screen is copied into typescript file.

To stop this script command, press ctrl+D and press enter

Now you check the file, you can see the output of your screen.







How to stop and start the error demon in aix?

How to stop and start the error demon in aix?


To stop the error demon:  #/usr/lib/errstop
To start the error demon: # /usr/lib/errdemon
For checking the errlog, we need to initiate the test logger
#errlogger "test"
#errpt   ---> you can see the test logger on the errpt

If the errpt corrupted, please follow the below.

 Delete the error log file   #rm /var/adm/ras/errlog
Stop the error demon:      # /usr/lib/errstop
Start the error demon:      #/usr/lib/errdemon   (When starting the errdemon, it will automatically creates the errlog files.






Sunday, July 10, 2016

How to troubleshoot disk related issues in aix?

How to troubleshoot disk related issues in aix?



If the disk is local disk, then please execute the below commands to troubleshoot the issue.


Commands
 Explanation
# lspv
To list the disk details
# lsvg -p <vg_name>
To check the vg whether it is in missing state
# varyonvg <vg_name>
To bring disk from missing to active
# errpt 
To check the error details
# errpt -N hdiskX
To check the error details for the particular disk.
# errpt -aj <identifier>
To check the detailed error output of disk
# lquerypv -h /dev/hdiskX
The output should not be all zero


if the issues found, then log a case with IBM and replace the disk.

-========================================================================


If the disk is virtual which is provided by VIOS , then please execute the below commands to troubleshoot the issue.


Commands
Explanation
# lspv
To list the disk details
# lsdev -Cc disk
To check whether the disk is local,virtual
# errpt
To check the error details
# errpt -N hdiskX
To check the error details for the particular disk.
# lspath
To check paths that is is single/dual path
# lscfg -vpl hdiskX
To get the C# of the disk (example: C110)
Execute below cmd on VIO 
# lsdev -slots|grep -i CXX
To identify the vhost details corresponding to the disk on the lpar
# lsmap -all|grep -p vhostX
To get the disk details corresponding to the disk on the lpar
# errpt
To check the error details (execute on aix prompt)
# errpt -N hdiskX
To check error details for particular disk.(execute on aix prompt)
# errpt -aj <identifier> 
To check the detailed error output of disk. (execute on aix prompt)

if the issues found, then log a case with IBM and replace the disk.


======================================================================


If the disk is provided by any other storage,  then please execute the below commands to troubleshoot the issue.



Commands
Explanation
# lsdev -Cc
To check the disk is local/virtual/storage
# lsdev -Cl hdiskX -F parent
To identify the parent of the hard disk
# lsdev -Cl fscsiX -F parent
To identify the fcs details.
# fcstat fcsX
To check the FC card details
# fcstat fcsX|awk '/Transmit/,/Words/'  
if the data transfer and send is not changing 
-then we have connectivity problem


if everything seems to be normal up on fcs, the problem should be on the storage side.. pass it to storage team.






How to troubleshoot network related issues?

How to troubleshoot network related issues?


The below commands are very useful when you troubleshoot any network related issues.


Commands
         Explanation
# errpt   
To Check the errpt error
# errpt|more   
To check the error
# errpt -aj <identifier>  
To Check the detailed error
# lsdev -Cc adapter
To Check the adapter device details
# entstat ethX    
To check the ethernet statistics
# netstat -v      
To check the detailed output of ethernet card
# netstat -v|grep -E "ETHERNET|Adapter|Errors|State"   
To check the errors with detailed output
# netstat -v|grep -E "ETHERNET|Adapter|State"   
To check the detailed output
# netstat -v|grep -E "ETHERNET|Device|State"    
To check the link status and state.