IBM Support

Learning AIX System Administration on PowerVS

How To


Summary

If you want to learn and experiment on AIX as a systems administrator, then this article is a series of YouTube videos to watch, hints, and tip to help you.
Access to a "sandpit" AIX environment can be expensive but the IBM Cloud PowerVS service offers a low daily cost.

AIX on PowerVS can be used for many other personal and professional projects, experiments, code development, and testing.

Objective

Nigels Banner

Environment

The classic AIX icon: The new 2021 AIX icon:
image 10590 image 10589
It is assumed that you are running AIX 7.2 or higher on Power processor-based IBM Cloud PowerVC virtual machine (VM) for less the £2, $3 or 3€ a day.
This article is not a book on AIX administration but many YouTube videos covering specific topics and then some commands to look up in the manuals followed by some examples.  If you find useful website for learning or building AIX skills, let us know by email, which is at the end of the article.

YouTube AIX in Focus Play list has more that 30 videos, can be found here: AIX in Focus Playlist
image 10592

image 10591
AIX Manuals can be found here: IBM AIX 7.2 Manual Pages
Note: AIX is based on AT&T UNIX System 5.3 and 5.4 with loads of extra IBM functions and highly advanced feature not found anywhere else. Everything in Section 1 and Section 2 is the same as any other UNIX operating System.

These PDF manual files are like a series of AIX Books
image 11529
Out of the PDF files in the above list are some important detailed books and significant documents are:
  1. AIX Commands file is 4842 pages.
  2. Installing AIX is 478 pages.
  3. Networking is 754 pages.
  4. Operating Systems Management is 426 pages.
  5. Performance Management is 462 pages.
  6. Performance Tools and Reference is 342 pages.
That is over 7000 pages of detailed AIX Documentation.

Steps


Section 0: IBM Cloud: PowerVS Getting Started

If you do not have your own copy of AIX to learn on, then you are in luck. In 2021, IBM Cloud with its PowerVS service on the Internet offer a AIX running on Power Servers at low prices per day. AIX prices start at £2 GBP, $3 US Dollars or €3 Euro per day. If these prices are not your local currency, then hopefully, you know a conversion rate from one of the currencies. To get you quickly started, we now have a YouTube Series of videos. This series is five videos with more planned and you can find them at this YouTube playlist here: https://www.youtube.com/playlist?list=PLKQlFnmiWVyeK1chlV8hFtHj7Y3plhW9d
Starter Pack for PowerVS: create, Account, Pricing, Credit Card, first Resource (project), and first small virtual machine (VM) image 10594
Demo of your first virtual machine, console access + Internet connection image 10595
Demo with Disks, growing the root volume group disk, adding more disks finding them from AIX, moving disks between virtual machines and deleting them. image 10596
Installing AIX Open Source tools by using the "yum" command image 10597
The video refers to this webpage, which covers lots of other videos to learn AIX and lots of suggestions to follow.
Learn AIX video   PowerVS: Learning AIX Systems Administration
Updating AIX to the latest Technology Level and Service Park by using the AIX "suma" command image 10593

Section 1: Classic 101 UNIX commands

This section is to remove fear, uncertainty, and doubt (FUD) that AIX is UNIX.
Note:
  • Your general Linux command skills apply to AIX because Linux commands were written to the UNIX POSIX standard. 
  • Linux and AIX differ mostly in the are of the Systems Management commands. Also, AIX administrator use "smitty" to speed up and accurately perform task.

If you use AIX, it is mandatory to know the vi editor. It is the only editor available in the default installed packages.
image 10655

AIX simple commands
What is my current directory (folder)?   
  • pwd
List the files and directories in my current directory:
  • # just the names
    ls
    
    # with details:
    ls -l
    
    # In order recently used files at the bottom:
    ls -ltr
Remove (delete) a file called myfile.txt.  Note: The file can never be recovered.
  • rm myfile.txt
Show on the screen the contents of file myfile.txt.
  • cat myfile.txt
Change the permissions of a file to add r permission for everyone.
  • chmod ugo+r myfile.txt
    
    # ugo = User Group Owner
    # + add
    # r = Read permission
Change the ownership of a file to user Nigel and group Staff.
  • chown nag:staff myfile.txt
Change the current working directory to "/tmp".
  • # Change to /tmp
    cd /tmp
    
    # Return to you default user home directory
    cd
    
    # Go to a directory in your current working directory:
    cd bin
    
    # Go to the directory above the current working directory
    cd ..
Make a new directory
  • # The new directory will be sub_dir
    mkdir sub_dir
Remove (delete) an empty sub directory. Warning the files are not recoverable.
  • rmdir sub_dir
    
    # To the removal of a directory with files in it
    rm -fr sub_dur
Determine the contents of a file, by using any magic numbers at the start and character counting heuristics.
  • file myfile.txt
The Korn shell
CLI and Korn scripts
Processes
List your processes
  • ps
List all processes and more information
  • ps -ef
Other
  • grep "UNIX filesystems" myfile
  • Redirection
    ​​​​​​​ |  > & >
  • export $PATH

Section 2: Exploring AIX
 What is my user name
  • id
List the file systems with sizes in Gigabytes
  • df -g
List all the environment variables
  • env
Show the AIX release, Technology Level, and Service Pack plus the year (2 digits) and week number (2 digits)
  • oslevel -s
  The file "/etc/environment" sets the environment variables for all users.  To switch on vi editing for the Korn shell:
  • vi /etc/environment
    
    # To the end of the file add
    "EDITOR=/usr/bin/vi"
List logged in users
  • who
Display the contents of a text file use the cat command. For example, the file "/etc/passwd", which lists all the usernames but not passwords:
  • cat /etc/passwd
List the paging spaces
  • lsps -a  
List the disk volume groups
  • lsvg   
List disk logical volumes
  • lslv
Start a Secure Shell communication to another computer
  • ssh username@hostname

 

Section 3: smitty
  • YouTube video:
  • Managing a volume group and its logical volumes.
    • smitty lvm
  • Managing a journal file system type 2.
    • smitty jfs2
  • Managing users and setting their passwords.
    • smitty user
  • Managing the servers networks but don't change you IP address on IBM Cloud PowerVS
    • smitty tcpip
  • Set tome zone, date, and time
    smitty chtz_date

Section 4: Performance monitoring with nmon and nmonchart
  • YouTube Videos:
  • Run a workload so that the performance statistics are more interesting than mostly zeros or static numbers.
  • For "nmon" online monitoring, start the command:
    nmon
    Then type the following options
    ​​​​​​​ cmdnp
    
    # Key:
    # c = CPUs
    # m = memory
    # d = disks
    # n = network
    # p = top processes
  • For capturing the data to the comma separated values (CSV) file every 30 seconds for 10 minutes run:
    nmon -f -s30 -c 20
    Note some people assumed the commend crashed but it is sitting in the back ground as a daemon and finish collecting data, even if you log out. The command creates a file in the local directory with a file name in the format. You need to wait for 10 minutes.
    hostname_datetime.nmon
  • The file is a simple text file that can be edited with the command "vi".
  • Download the Korn script "nmonchart" from: http://nmon.sourceforge.net/pmwiki.php?n=Site.Nmonchart
  • Assuming your file is called "blue_210621_1237.nmon" us the "nmonchart" Korn shell script to generate graphs with:
    nmonchart blue210621_1237.nmon
    Then view the resulting file "blue_210621_1237.html" with a web browser.

Section 5: Update AIX
  • Preview mode to check for problems and perform the upgrade.
  • Check the result was OK.
  • Restart AIX
  • oslevel -s
  • lslpp -L

Section 6: Logical Volume Manager
  • YouTube video
  • Manual Pages: https://www.ibm.com/docs/en/aix/7.2?topic=management-logical-volume-manager
  • "LVM Troubleshooting" Redbooks: http://www.redbooks.ibm.com/redbooks/pdfs/sg245433.pdf
  • Example use:
    • Volume groups:
       
      lsvg           # list the VG names
      lsvg rootvg       # list the VG specification options
      lsvg -l rootvg # list of logical volumes within rootvg
      
      # Other Volume Group commands:
      mkvg
      lsvg 
      chvg
      exportvg 
      importvg
      extendvg
      reducevg 
      varyoffvg
      varyonvg
      syncvg
      savevg
      restorevg
      
    • Logical volumes:
      lslv     lvname	details of a LV
       lslv -l  lvname	list PV of the LV
       lslv -p lvname	list PP in this LV
       lslv -m lvname	show LV mirroring	
       
      # List all LVs
      for vg in $(lsvg)
      do
          echo -- -- $vg
          lsvg -l $vg
      done
      
      # Other Logical Volumes commands:
      mklv
      lslv
      chlv
      rmlv 
      mklvcopy
      cplv
      extendlv  
    • Physical volumes:
      lspv			list all PV & their VGs
       lspv      hdiskN	details of a PV
       lspv -l   hdiskN	list LV in the PV
       lspv -p hdiskN	list PP in this PV
      
      # Other Physical Volumes commands:
      cfgmgr (find new disks) 
      rmdev
      lspv
      chpv
      migratepv
  • LVM Life cycle
  • image 10621
AIX LVM Rules:
  1. Make rootvg small and separate
  2. Get every disk working for high performance
  3. Don’t let a disk failure stop your system
  4. Monitor your AIX error logs for disk problems
  5. Don’t Meddle
  6. If you need help Call AIX Support
  7. Read and practice on a test system (No testing in production (tipping))
  8. Skill up so in a crisis you don’t panic and make it worse
     

Section 7: Journaling File Systems (JFS2)
  • YouTube video
  • You can use "smitty jfs2" for managing file systems.
  • Many system administrators use the underlying commands for common tasks like growing and shrinking file systems.
  • List the online file systems: 
    df -g
    
    # -g so the results are in Gigabytes
    # -m for megabytes
    
    # To see the file system attributes use:
    lsfs
    
    # To see the current file system mount points:
    mount
  • Create a JFS2 in a new logical volume and mount it
    crfs -v jfs2 -g scratchvg  -a size=42G -m /temp -A yes -p rw
    
    mount /temp
    
    # The filesystem details are in the text file /etc/filesystems
    
  • Create a JFS in a previously created logical volume called "mylv"
    crfs -v jfs2 -d mylv -m /temp -A yes -p rw
    
  • Grow & shrink JFS2
    Change size:
     chfs -a size=+8G /temp # add 8 GB          
     chfs -a size=-2G /	# remove 2 GB
     chfs -a size=50G	# change size to 50 GB
    

Section 8: AIX Tuning with the 'O' Commands
  • YouTube video:
  • Excellent "out of the box" settings for most AIX servers.
  • The 'O' commands optional parameter setting commands for AIX subsystems named:
    • "asoo" Active System Optimizer options
    • "ioo" Input Output options
    • "lvmo" Logical Volume Manager options
    • "nfso" Network File System options
    • "no" Network options 
    • "raso" Reliability, Availability, and Serviceability options
    • "schedo" Process Scheduler options
    • "vmo" Virtual Memory options
  • The command reports the parameter settings is a common report format:
    • Name of the tuning option.
    • Current value.
    • Default value.
    • Boot value after next reboot.
    • Minimum is the lowest valid value.
    • Maximum is the highest valid value.
    • Units the measurement value sizes.
  • Example 
    $ no -h
    Usage:  no -h [tunable] | {[-F] -L [tunable]}
            no [-p|-r] [-y] (-D | ({-d tunable} {-o tunable=value}))
      -h                      Display help about the command and its arguments
      -h tunable       Display help about a tunable
      -L [tunable]     List info about one or all tunables in a table
      -x [tunable]     List info about one or all tunables in CSV
      -a                    Display value for all tunables, one per line
      -F                    Force display of restricted tunables  -a/-L/-x
      -o tunable       Display current value of a tunable
      -o tunable=value Set tunable to value
      -D                   Reset all tunables to their default values
      -d tunable       Reset tunable to its default value
      -r                    Make change(s) (-D/-d/-o) to nextboot value
      -p                   Make change(s) (-D/-d/-o)  permanent (current + nextboot)
      -y                    Suppress prompt before executing bosboot

     

Section 9: Active Memory Expansion (AME)
  • WARNING: Active Memory Expansion requires an HMC setting (which is not currently possible with PowerVS).
  • YouTube video:
  • To see the benefits of AME the system must have many processes running by using memory otherwise AME is not needed.
  • Run workload that heavily uses a large proportion of memory so the free space is low or even some memory paging.
  • Run the command "amepat" to generate a report of the AME effect on higher CPU use and higher effective memory.

Section 10: "AIX Open Source Tools" and "yum"
  • YouTube video:
  • Example commands
  • #get the help info for yum
    yum
    
    # Update all the already installed package to the latest version
    yum update
    
    # Looking for a package by name
    yum list python3*
    
    # Looking for a package using a string
    yum search get
    
    # Find details of a package
    yum info python3
    
    # install and automatically add pre-reqs
    yum install python3.ppc
    
    rpm -qa
  • Can’t cover all packages wget, C, Python3, Go, Apache, and PostgreSQL
     

Section 11: Roll-Based Access Control (RBAC)
  • YouTube video: 
  • AIX, like all UNIX based operating systems, has the all powerful superuser called "root".  If you want less important function available for non-root users, then that is a problem. Some examples are a user that can control printers but no other "root" user functions. Or a user that is allowed to mount and unmount particular file systems. It is this class of problem that is addressed by Roll-based Access Control.
  • The RBAC feature allows fine grain access to a matrix of commands and resources to specific users or user groups.

Section 12: Workload Partitions
Workload Partition manual pages

Sections 13: AIX System Hardening with aixpert

Section 14: Performance monitoring with njmon 

Section 15: Network Installation Manager (NIM)
  • The NIM Redbooks: https://www.redbooks.ibm.com/redbooks/pdfs/sg247296.pdf
  • Installing AIX over a network by using a NIM server. The NIM server is running AIX and responds to "bootp" and "tftp" requests from a booting LPAR (VM) to mount the AIX installation media to allow the AIX installation.
  • There are many web articles on NIM.
  • NIM can be managed by using commands or by using "smitty".

Section 16: AIX Live Update (LU)
  • Live Update is a feature in AIX 7.2 and higher release.
  • Previously call Live Kernel Update (LKU) but now covers more than the AIX Kernel
  • Note Live Update is an advanced function for experience AIX system administrators and is aware of the prerequisites.
# Edit the details into this file: 
vi /var/adm/ras/liveupdate/lvupdate.data 

# Set the authorisation for HMC access
hmcauth -u hscroot -a hmc_name 

# Start the Update
geninstall -k [-p] [-Y] [-D] [ -d <media> ]
                [ -f <file> | <install_list...> | all | update_all ]

Other possible topics:
  • PowerHA
  • XIVE
  • Flash Cache
  • GZIP on the POWER9 processor
  • Dynamic LPAR

Additional Information

Other places to find content from Nigel Griffiths IBM (retired)

Document Location

Worldwide

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG10","label":"AIX"},"Component":"","Platform":[{"code":"PF002","label":"AIX"}],"Version":"All Versions","Edition":"","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}},{"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Product":{"code":"HW1W1","label":"Power -\u003EPowerLinux"},"Component":"","Platform":[{"code":"PF016","label":"Linux"}],"Version":"All Versions","Edition":"","Line of Business":{"code":"","label":""}}]

Document Information

Modified date:
15 June 2023

UID

ibm16441997